Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14ff0a66 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by android-build-merger
Browse files

Merge "Close FileChannels in UpdateHandler#copyFile." into nyc-dev

am: fce8ed98

* commit 'fce8ed98':
  Close FileChannels in UpdateHandler#copyFile.
parents 9f1498ca fce8ed98
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -689,8 +689,16 @@ public final class UpdateHandler {
        } else {
            try {
                final FileChannel sourceChannel = ((FileInputStream) in).getChannel();
                try {
                    final FileChannel destinationChannel = ((FileOutputStream) out).getChannel();
                    try {
                        sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel);
                    } finally {
                        destinationChannel.close();
                    }
                } finally {
                    sourceChannel.close();
                }
            } catch (IOException e) {
                // Can't work with channels, or something went wrong. Copy by hand.
                DebugLogUtils.l("Won't work");