Merge "Move isAdminTestOnlyLocked inside synchronized block"
This commit is contained in:
committed by
Android (Google) Code Review
commit
6fa73c8e20
@@ -10431,12 +10431,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
||||
Preconditions.checkCallAuthorization(!isManagedProfile(caller.getUserId()),
|
||||
"User %d is not allowed to call setSecondaryLockscreenEnabled",
|
||||
caller.getUserId());
|
||||
// Allow testOnly admins to bypass supervision config requirement.
|
||||
Preconditions.checkCallAuthorization(isAdminTestOnlyLocked(who, caller.getUserId())
|
||||
|| isDefaultSupervisor(caller), "Admin %s is not the "
|
||||
+ "default supervision component", caller.getComponentName());
|
||||
|
||||
synchronized (getLockObject()) {
|
||||
// Allow testOnly admins to bypass supervision config requirement.
|
||||
Preconditions.checkCallAuthorization(isAdminTestOnlyLocked(who, caller.getUserId())
|
||||
|| isDefaultSupervisor(caller), "Admin %s is not the "
|
||||
+ "default supervision component", caller.getComponentName());
|
||||
DevicePolicyData policy = getUserData(caller.getUserId());
|
||||
policy.mSecondaryLockscreenEnabled = enabled;
|
||||
saveSettingsLocked(caller.getUserId());
|
||||
|
||||
Reference in New Issue
Block a user