Merge "Verify caller before auto granting slice permission" into qt-dev am: 3d226b76c1 am: b4fb5feffc am: 12448ab311

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17089346

Change-Id: I3ae47b70497d8dd3e12cd69ac2e1ec1cf63cb423
This commit is contained in:
TreeHugger Robot
2022-03-09 06:56:06 +00:00
committed by Automerger Merge Worker

View File

@@ -242,6 +242,8 @@ public class SliceManagerService extends ISliceManager.Stub {
if (autoGrantPermissions != null && callingPkg != null) { if (autoGrantPermissions != null && callingPkg != null) {
// Need to own the Uri to call in with permissions to grant. // Need to own the Uri to call in with permissions to grant.
enforceOwner(callingPkg, uri, userId); enforceOwner(callingPkg, uri, userId);
// b/208232850: Needs to verify caller before granting slice access
verifyCaller(callingPkg);
for (String perm : autoGrantPermissions) { for (String perm : autoGrantPermissions) {
if (mContext.checkPermission(perm, pid, uid) == PERMISSION_GRANTED) { if (mContext.checkPermission(perm, pid, uid) == PERMISSION_GRANTED) {
int providerUser = ContentProvider.getUserIdFromUri(uri, userId); int providerUser = ContentProvider.getUserIdFromUri(uri, userId);