Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7abd726 authored by Ayush Sharma's avatar Ayush Sharma
Browse files

Add missing check in hasGrantedPolicy

Add check that if component name is specified, it belong to the caller.

Bug: 192247339
Test: NA

Change-Id: I6f821d039a6dfd70fb005165af2c5cb13ad3de9b
parent 12f914e3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3624,6 +3624,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
        Preconditions.checkCallAuthorization(
                isCallingFromPackage(adminReceiver.getPackageName(), caller.getUid())
                        || isSystemUid(caller));
        synchronized (getLockObject()) {
            ActiveAdmin administrator = getActiveAdminUncheckedLocked(adminReceiver, userHandle);