diff options
author | Ben Kwa <kenobi@google.com> | 2015-05-05 21:53:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-05 21:53:22 +0000 |
commit | e74007ded3a34d6aaf7dc4fe7f2c18b04b47de3b (patch) | |
tree | 3cc268b230341b43661434aba4f11ace5ecd4b6d /packages | |
parent | 570de1e0e903f11ab74b0fd386b17494cd66ff33 (diff) | |
parent | 75597d0dc568efa29f6ef2aadbbb0f9986848bda (diff) | |
download | frameworks_base-e74007ded3a34d6aaf7dc4fe7f2c18b04b47de3b.zip frameworks_base-e74007ded3a34d6aaf7dc4fe7f2c18b04b47de3b.tar.gz frameworks_base-e74007ded3a34d6aaf7dc4fe7f2c18b04b47de3b.tar.bz2 |
Merge "Clean up error handling in CopyService." into mnc-dev
Diffstat (limited to 'packages')
-rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/CopyService.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/CopyService.java b/packages/DocumentsUI/src/com/android/documentsui/CopyService.java index 9dd2b20..202402f 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/CopyService.java +++ b/packages/DocumentsUI/src/com/android/documentsui/CopyService.java @@ -466,14 +466,12 @@ public class CopyService extends IntentService { srcFile.checkError(); } catch (IOException e) { copyError = e; - } finally { - if (copyError != null) { - try { - dstFile.closeWithError(copyError.getMessage()); - } catch (IOException e) { - Log.e(TAG, "Error closing destination", e); - } + try { + dstFile.closeWithError(copyError.getMessage()); + } catch (IOException closeError) { + Log.e(TAG, "Error closing destination", closeError); } + } finally { // This also ensures the file descriptors are closed. IoUtils.closeQuietly(src); IoUtils.closeQuietly(dst); |