Check Read permissions when getDocumentMetadata

Test: manually tested
Bug: 151095863

Change-Id: I4f04f08f76d039196c2c67bac80d4a46ebec87f2
(cherry picked from commit 0e75809955)
This commit is contained in:
Diksha Gohlyan
2020-04-01 12:37:04 -07:00
parent 246360bf4f
commit c94646177c

View File

@@ -1144,6 +1144,8 @@ public abstract class DocumentsProvider extends ContentProvider {
out.putParcelable(DocumentsContract.EXTRA_RESULT, path);
} else if (METHOD_GET_DOCUMENT_METADATA.equals(method)) {
enforceReadPermissionInner(documentUri, getCallingPackage(),
getCallingAttributionTag(), null);
return getDocumentMetadata(documentId);
} else {
throw new UnsupportedOperationException("Method not supported " + method);