summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Garfield Tan <xutan@google.com> 2017-03-23 13:06:03 -0700
committer Garfield Tan <xutan@google.com> 2017-03-24 18:31:50 +0000
commit0ef07d9215d2f0c2c6adc33149f9d52b830a5462 (patch)
tree16f6386d83d71e73cebfd105d040ef1ffffb68dd
parent7d5f2b9c099b7e9727c19e34cd203356a722a30d (diff)
Eject throws when it failed.
Test: Builds. Bug: 36483910 Change-Id: I1c4d4d622cf68fc51e88bb08ac190fcfaed10c7f (cherry picked from commit bb1d2816a90c65a57187050e5e63e41a3673a360)
-rw-r--r--src/com/android/documentsui/sidebar/EjectRootTask.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/documentsui/sidebar/EjectRootTask.java b/src/com/android/documentsui/sidebar/EjectRootTask.java
index 2ce065853..2baeb4c9e 100644
--- a/src/com/android/documentsui/sidebar/EjectRootTask.java
+++ b/src/com/android/documentsui/sidebar/EjectRootTask.java
@@ -29,14 +29,14 @@ import com.android.documentsui.base.Shared;
public final class EjectRootTask extends AsyncTask<Void, Void, Boolean> {
+ private final String TAG = "EjectRootTask";
+
private final ContentResolver mResolver;
private final String mAuthority;
private final String mRootId;
private final BooleanConsumer mCallback;
/**
- * @param ejectCanceledCheck The method reference we use to see whether eject should be stopped
- * at any point
* @param finishCallback The end callback necessary when the eject task finishes
*/
public EjectRootTask(
@@ -57,9 +57,12 @@ public final class EjectRootTask extends AsyncTask<Void, Void, Boolean> {
try {
client = DocumentsApplication.acquireUnstableProviderOrThrow(
mResolver, mAuthority);
- return DocumentsContract.ejectRoot(client, rootUri);
+ DocumentsContract.ejectRoot(client, rootUri);
+ return true;
+ } catch (IllegalStateException e) {
+ Log.w(TAG, "Failed to eject root.", e);
} catch (Exception e) {
- Log.w(Shared.TAG, "Failed to eject root", e);
+ Log.w(TAG, "Binder call failed.", e);
} finally {
ContentProviderClient.releaseQuietly(client);
}