diff options
author | Ben Kwa <kenobi@google.com> | 2015-05-05 11:58:38 -0700 |
---|---|---|
committer | Ben Kwa <kenobi@google.com> | 2015-05-05 11:58:38 -0700 |
commit | 75597d0dc568efa29f6ef2aadbbb0f9986848bda (patch) | |
tree | 68adba97467167978dee3adf9bc82ab65f937587 /packages | |
parent | efb70fd8a0a37ddd08356120fb63ff62694eaea0 (diff) | |
download | frameworks_base-75597d0dc568efa29f6ef2aadbbb0f9986848bda.zip frameworks_base-75597d0dc568efa29f6ef2aadbbb0f9986848bda.tar.gz frameworks_base-75597d0dc568efa29f6ef2aadbbb0f9986848bda.tar.bz2 |
Clean up error handling in CopyService.
Change-Id: I87b9f2c2cfddc222fbee64578b0a1349508a244f
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); |