Revert "Close FileChannels in UpdateHandler#copyFile."

am: 4b46e71163

* commit '4b46e711632f6e5d868e6d84a6211384d37e1911':
  Revert "Close FileChannels in UpdateHandler#copyFile."
This commit is contained in:
Yohei Yukawa 2016-03-03 22:00:47 +00:00 committed by android-build-merger
commit e1a9d7ae67

View file

@ -689,16 +689,8 @@ public final class UpdateHandler {
} else { } else {
try { try {
final FileChannel sourceChannel = ((FileInputStream) in).getChannel(); final FileChannel sourceChannel = ((FileInputStream) in).getChannel();
try {
final FileChannel destinationChannel = ((FileOutputStream) out).getChannel(); final FileChannel destinationChannel = ((FileOutputStream) out).getChannel();
try {
sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel); sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel);
} finally {
destinationChannel.close();
}
} finally {
sourceChannel.close();
}
} catch (IOException e) { } catch (IOException e) {
// Can't work with channels, or something went wrong. Copy by hand. // Can't work with channels, or something went wrong. Copy by hand.
DebugLogUtils.l("Won't work"); DebugLogUtils.l("Won't work");