diff options
author | 2016-03-03 13:02:27 -0800 | |
---|---|---|
committer | 2016-03-03 21:11:14 +0000 | |
commit | 4b46e711632f6e5d868e6d84a6211384d37e1911 (patch) | |
tree | 9ec8626366e938a2fa790ce772bb2fbdd1ea0c88 | |
parent | fce8ed98aa738a13332b6ccc9c5b145f17fae51f (diff) | |
download | latinime-4b46e711632f6e5d868e6d84a6211384d37e1911.tar.gz latinime-4b46e711632f6e5d868e6d84a6211384d37e1911.tar.xz latinime-4b46e711632f6e5d868e6d84a6211384d37e1911.zip |
Revert "Close FileChannels in UpdateHandler#copyFile."
This reverts commit 3e2670265e17e91c5a8cfff01711f973dccd2a0c.
It turns out that the behavior change in libcore was unintentional, and
it was already fixed [1]. Let's revert our workaround back to see if
the existing code is compatible with N.
[1]: Ibacb192abc37870c74a2500d65b94d68f9c2318e
5e7b572c2b494ab86ddd2baca3883a40a6064c1e
Bug: 26239281
Change-Id: I6cd2340492d93251231e7ee37c3d4f82c1721293
-rw-r--r-- | java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java index 6b32c684f..0517bc814 100644 --- a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java +++ b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java @@ -689,16 +689,8 @@ 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(); - } + final FileChannel destinationChannel = ((FileOutputStream) out).getChannel(); + sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel); } catch (IOException e) { // Can't work with channels, or something went wrong. Copy by hand. DebugLogUtils.l("Won't work"); |