Enforce QUERY_ADMIN_POLICY for getGlobalProxyAdmin

Bug: 206127671
Test: NA
Change-Id: Id4bce828bc69867c9c4d20b991e9e53e8ae385f2
This commit is contained in:
Ayush Sharma
2021-12-14 22:13:11 +00:00
parent f774fb2f75
commit 554e19a375

View File

@@ -7459,7 +7459,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId");
final CallerIdentity caller = getCallerIdentity(); final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); Preconditions.checkCallAuthorization(
hasFullCrossUsersPermission(caller, userHandle) && canQueryAdminPolicy(caller));
synchronized (getLockObject()) { synchronized (getLockObject()) {
DevicePolicyData policy = getUserData(UserHandle.USER_SYSTEM); DevicePolicyData policy = getUserData(UserHandle.USER_SYSTEM);