[automerger] Limit IsSeparateProfileChallengeAllowed to system callers am: 9061fcc46b am: 39f5432697 am: 9c0bc5405e am: 55209aca88 am: d5ce9a41b6

am: 20007cb46f

Change-Id: I3bf88bf3a830dc7dea61e32d1df31b273a5d1afe
This commit is contained in:
Pavel Grafov
2019-04-10 16:41:27 -07:00
committed by android-build-merger

View File

@@ -3434,6 +3434,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
@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 &&