Skip to content
Permalink
Browse files
CB-11115 android: Removing dependency on FileDescriptor toString in c…
…ontent provider tests
  • Loading branch information
riknoll committed Apr 20, 2016
1 parent d9b9046 commit fe7b78142d02aa2b28056d8472728ce90ad331e0
Showing 1 changed file with 1 addition and 4 deletions.
@@ -50,10 +50,7 @@ public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundEx
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) {

0 comments on commit fe7b781

Please sign in to comment.