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

Commit 26571b90 authored by Pavel Grafov's avatar Pavel Grafov Committed by android-build-merger
Browse files

Limit IsSeparateProfileChallengeAllowed to system callers am: 1b6301cf am:...

Limit IsSeparateProfileChallengeAllowed to system callers am: 1b6301cf am: 406229f0 am: 7b68bad0
am: 9a2f6c0c

Change-Id: Ic7ee9309888f02ad9de8fe604e31f7f199004799
parents 7132a5fd 9a2f6c0c
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -4096,6 +4096,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    @Override
    @Override
    public boolean isSeparateProfileChallengeAllowed(int userHandle) {
    public boolean isSeparateProfileChallengeAllowed(int userHandle) {
        if (!isCallerWithSystemUid()) {
            throw new SecurityException("Caller must be system");
        }
        ComponentName profileOwner = getProfileOwner(userHandle);
        ComponentName profileOwner = getProfileOwner(userHandle);
        // Profile challenge is supported on N or newer release.
        // Profile challenge is supported on N or newer release.
        return profileOwner != null &&
        return profileOwner != null &&