diff options
| author | Matt Garnes <matt@cyngn.com> | 2015-08-13 08:14:52 -0700 |
|---|---|---|
| committer | Matt Garnes <matt@cyngn.com> | 2015-08-13 09:54:11 -0700 |
| commit | e1fac533425ffe54ad58a22215bd4fbbc48612e8 (patch) | |
| tree | 317149363d2e96d16addc61d680900432cbe3826 | |
| parent | 81d466c7eea61897335ccbfa0d06b330e3002bae (diff) | |
| download | android_packages_apps_CMFileManager-e1fac533425ffe54ad58a22215bd4fbbc48612e8.tar.gz android_packages_apps_CMFileManager-e1fac533425ffe54ad58a22215bd4fbbc48612e8.tar.bz2 android_packages_apps_CMFileManager-e1fac533425ffe54ad58a22215bd4fbbc48612e8.zip | |
Fix improper exception handling during copy operation.
- Do not cast ClosedByInterruptException to CancelledOperationException;
return a new CancelledOperationException instead.
Change-Id: I41cb0c605c55fc896a3e483cb5b1f1fcc913676e
(cherry picked from commit 2444ef323fc5920588f45c96a36533a969ab6be2)
| -rw-r--r-- | src/com/cyanogenmod/filemanager/util/FileHelper.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/filemanager/util/FileHelper.java b/src/com/cyanogenmod/filemanager/util/FileHelper.java index 48a3be09..736c6981 100644 --- a/src/com/cyanogenmod/filemanager/util/FileHelper.java +++ b/src/com/cyanogenmod/filemanager/util/FileHelper.java @@ -1184,10 +1184,14 @@ public final class FileHelper { if (e.getCause() instanceof ErrnoException && ((ErrnoException)e.getCause()).errno == OsConstants.ENOSPC) { throw new ExecutionException(R.string.msgs_no_disk_space); - } else if ((e instanceof CancelledOperationException) - || (e instanceof ClosedByInterruptException)) { + } else if (e instanceof CancelledOperationException) { // If the user cancelled this operation, let it through. throw (CancelledOperationException)e; + } else if (e instanceof ClosedByInterruptException) { + // The thread running this operation was interrupted. + // This is likely because the user cancelled the operation, + // which cancelled the AsyncTask. + throw new CancelledOperationException(); } return false; } finally { |
