Loading src/com/android/documentsui/archives/Archive.java +48 −34 Original line number Diff line number Diff line Loading @@ -199,6 +199,9 @@ public class Archive implements Closeable { * * If the file descriptor is not seekable, then a snapshot will be created. * * This method takes ownership for the passed descriptor. The caller must * not close it. * * @param context Context of the provider. * @param descriptor File descriptor for the archive's contents. * @param archiveUri Uri of the archive document. Loading @@ -208,8 +211,12 @@ public class Archive implements Closeable { Context context, ParcelFileDescriptor descriptor, Uri archiveUri, @Nullable Uri notificationUri) throws IOException { FileDescriptor fd = null; try { if (canSeek(descriptor)) { return new Archive(context, null, descriptor.getFileDescriptor(), archiveUri, fd = new FileDescriptor(); fd.setInt$(descriptor.detachFd()); return new Archive(context, null, fd, archiveUri, notificationUri); } Loading Loading @@ -246,6 +253,13 @@ public class Archive implements Closeable { snapshotFile.delete(); } } } catch (Exception e) { // Since the method takes ownership of the passed descriptor, close it // on exception. IoUtils.closeQuietly(descriptor); IoUtils.closeQuietly(fd); throw e; } } /** Loading Loading
src/com/android/documentsui/archives/Archive.java +48 −34 Original line number Diff line number Diff line Loading @@ -199,6 +199,9 @@ public class Archive implements Closeable { * * If the file descriptor is not seekable, then a snapshot will be created. * * This method takes ownership for the passed descriptor. The caller must * not close it. * * @param context Context of the provider. * @param descriptor File descriptor for the archive's contents. * @param archiveUri Uri of the archive document. Loading @@ -208,8 +211,12 @@ public class Archive implements Closeable { Context context, ParcelFileDescriptor descriptor, Uri archiveUri, @Nullable Uri notificationUri) throws IOException { FileDescriptor fd = null; try { if (canSeek(descriptor)) { return new Archive(context, null, descriptor.getFileDescriptor(), archiveUri, fd = new FileDescriptor(); fd.setInt$(descriptor.detachFd()); return new Archive(context, null, fd, archiveUri, notificationUri); } Loading Loading @@ -246,6 +253,13 @@ public class Archive implements Closeable { snapshotFile.delete(); } } } catch (Exception e) { // Since the method takes ownership of the passed descriptor, close it // on exception. IoUtils.closeQuietly(descriptor); IoUtils.closeQuietly(fd); throw e; } } /** Loading