Merge "Allow the system server to query suspendable packages on any user."

This commit is contained in:
Jonathan Scott
2022-11-03 10:32:20 +00:00
committed by Android (Google) Code Review

View File

@@ -5063,8 +5063,11 @@ public class PackageManagerService implements PackageSender, TestUtilityService
"getUnsuspendablePackagesForUser");
final int callingUid = Binder.getCallingUid();
if (UserHandle.getUserId(callingUid) != userId) {
throw new SecurityException("Calling uid " + callingUid
+ " cannot query getUnsuspendablePackagesForUser for user " + userId);
mContext.enforceCallingOrSelfPermission(
Manifest.permission.INTERACT_ACROSS_USERS_FULL,
"Calling uid " + callingUid
+ " cannot query getUnsuspendablePackagesForUser for user "
+ userId);
}
return mSuspendPackageHelper.getUnsuspendablePackagesForUser(snapshotComputer(),
packageNames, userId, callingUid);