Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master d9b90461f -> fe7b78142


CB-11115 android: Removing dependency on FileDescriptor toString in content 
provider tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/fe7b7814
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/fe7b7814
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/fe7b7814

Branch: refs/heads/master
Commit: fe7b78142d02aa2b28056d8472728ce90ad331e0
Parents: d9b9046
Author: Richard Knoll <richard.b.kn...@gmail.com>
Authored: Tue Apr 19 17:14:01 2016 -0700
Committer: Richard Knoll <richard.b.kn...@gmail.com>
Committed: Tue Apr 19 18:28:50 2016 -0700

----------------------------------------------------------------------
 tests/src/android/TestContentProvider.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/fe7b7814/tests/src/android/TestContentProvider.java
----------------------------------------------------------------------
diff --git a/tests/src/android/TestContentProvider.java 
b/tests/src/android/TestContentProvider.java
index cf4fadf..9eba0d0 100644
--- a/tests/src/android/TestContentProvider.java
+++ b/tests/src/android/TestContentProvider.java
@@ -50,10 +50,7 @@ public class TestContentProvider extends ContentProvider {
         try {
             File f = File.createTempFile("test-content-provider", ".tmp");
             resourceApi.copyResource(Uri.parse("file:///android_asset" + 
fileName), Uri.fromFile(f));
-            FileInputStream fis = new FileInputStream(f);
-            String thisIsDumb = fis.getFD().toString();
-            int fd = 
Integer.parseInt(thisIsDumb.substring("FileDescriptor[".length(), 
thisIsDumb.length() - 1));
-            return ParcelFileDescriptor.adoptFd(fd);
+            return ParcelFileDescriptor.open(f, 
ParcelFileDescriptor.MODE_READ_ONLY);
         } catch (FileNotFoundException e) {
             throw e;
         } catch (IOException e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to