aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2015-08-13 08:14:52 -0700
committerMatt Garnes <matt@cyngn.com>2015-08-13 09:54:11 -0700
commite1fac533425ffe54ad58a22215bd4fbbc48612e8 (patch)
tree317149363d2e96d16addc61d680900432cbe3826
parent81d466c7eea61897335ccbfa0d06b330e3002bae (diff)
downloadandroid_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.java8
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 {