Clear identity when deleting downloads.
Jeff Sharkey [Mon, 19 Aug 2013 04:12:27 +0000 (21:12 -0700)]
Bug: 10329983
Change-Id: Iff3db6e5210ae9f33ec13af91561475b269dcc40

src/com/android/providers/downloads/DownloadStorageProvider.java

index 9ce1199..f66f526 100644 (file)
@@ -310,7 +310,12 @@ public class DownloadStorageProvider extends ContentProvider {
 
                 // Delegate to real provider
                 // TODO: only storage UI should be allowed to delete?
-                mDm.remove(getDownloadFromDocument(docId));
+                final long token = Binder.clearCallingIdentity();
+                try {
+                    return mDm.remove(getDownloadFromDocument(docId));
+                } finally {
+                    Binder.restoreCallingIdentity(token);
+                }
             }
             default: {
                 throw new UnsupportedOperationException("Unsupported Uri " + uri);