Cleanup error handling in jobs.
Change-Id: Icf6a7aad1b84dc92285064810776239e93494e38
diff --git a/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java b/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
index 11c3a29..374d27b 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/services/DeleteJob.java
@@ -22,7 +22,6 @@
import android.app.Notification;
import android.app.Notification.Builder;
import android.content.Context;
-import android.os.RemoteException;
import android.util.Log;
import com.android.documentsui.Metrics;
@@ -81,13 +80,13 @@
}
@Override
- void start() throws RemoteException {
+ void start() {
for (DocumentInfo doc : mSrcs) {
if (DEBUG) Log.d(TAG, "Deleting document @ " + doc.derivedUri);
- // TODO: Start using mSrcParent as soon as DocumentsProvider::removeDocument() is
- // implemented.
- if (!deleteDocument(doc)) {
- Log.w(TAG, "Failed to delete document @ " + doc.derivedUri);
+ try {
+ deleteDocument(doc);
+ } catch (ResourceException e) {
+ Log.e(TAG, "Failed to delete document @ " + doc.derivedUri);
onFileFailed(doc);
}
}