Revoke the uri permission when the file is deleted
When the file is deleted, renamed or moved, revoke all uri
permissions with the file
Bug: 157474195
Test: manual test with DocumentsUI
Test: atest DocumentsTest#testAfterMoveDocumentInStorage_revokeUriPermission
Change-Id: I4ffb183630aadb2d87b0965e8cecf88af15f4534
Merged-In: I4ffb183630aadb2d87b0965e8cecf88af15f4534
(cherry picked from commit 9efd606f43)
This commit is contained in:
@@ -482,6 +482,13 @@ public class ExternalStorageProvider extends FileSystemProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDocIdDeleted(String docId) {
|
||||
Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, docId);
|
||||
getContext().revokeUriPermission(uri, ~0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
|
||||
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
|
||||
|
||||
Reference in New Issue
Block a user