Merge "Check Read permissions when getDocumentMetadata" into pi-dev

This commit is contained in:
Diksha Gohlyan
2020-05-06 22:51:59 +00:00
committed by Android (Google) Code Review

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);