Limit IsSeparateProfileChallengeAllowed to system callers
Fixes: 128599668 Test: build, set up separate challenge Merged-In: I2fef9ab13614627c0f1bcca04759d0974fc6181a Change-Id: I2fef9ab13614627c0f1bcca04759d0974fc6181a
This commit is contained in:
@@ -2999,6 +2999,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
|
|
||||||
@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 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user