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

Commit 75597d0d authored by Ben Kwa's avatar Ben Kwa
Browse files

Clean up error handling in CopyService.

Change-Id: I87b9f2c2cfddc222fbee64578b0a1349508a244f
parent efb70fd8
Loading
Loading
Loading
Loading
+5 −7
Original line number Original line Diff line number Diff line
@@ -466,14 +466,12 @@ public class CopyService extends IntentService {
            srcFile.checkError();
            srcFile.checkError();
        } catch (IOException e) {
        } catch (IOException e) {
            copyError = e;
            copyError = e;
        } finally {
            if (copyError != null) {
            try {
            try {
                dstFile.closeWithError(copyError.getMessage());
                dstFile.closeWithError(copyError.getMessage());
                } catch (IOException e) {
            } catch (IOException closeError) {
                    Log.e(TAG, "Error closing destination", e);
                Log.e(TAG, "Error closing destination", closeError);
                }
            }
            }
        } finally {
            // This also ensures the file descriptors are closed.
            // This also ensures the file descriptors are closed.
            IoUtils.closeQuietly(src);
            IoUtils.closeQuietly(src);
            IoUtils.closeQuietly(dst);
            IoUtils.closeQuietly(dst);