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

Commit dcf3d9f8 authored by Pavel Grafov's avatar Pavel Grafov Committed by android-build-team Robot
Browse files

Limit IsSeparateProfileChallengeAllowed to system callers

Fixes: 128599668
Test: build, set up separate challenge
Change-Id: I2fef9ab13614627c0f1bcca04759d0974fc6181a
(cherry picked from commit 1b6301cf)
parent bac376dd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3930,6 +3930,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    @Override
    public boolean isSeparateProfileChallengeAllowed(int userHandle) {
        if (!isCallerWithSystemUid()) {
            throw new SecurityException("Caller must be system");
        }
        ComponentName profileOwner = getProfileOwner(userHandle);
        // Profile challenge is supported on N or newer release.
        return profileOwner != null &&