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

Commit faa50315 authored by Alex Johnston's avatar Alex Johnston
Browse files

Move isAdminTestOnlyLocked inside synchronized block

Calling isAdminTestOnlyLocked outside the getLockObject
was causing error logs:
https://paste.googleplex.com/6318193934073856?raw

Bug: 167960209
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecondaryLockscreen
Change-Id: I2bbfd651f308859b3ff50d6dd63f5f19f5ce4558
parent 56a028be
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -10374,12 +10374,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        Preconditions.checkCallAuthorization(!isManagedProfile(caller.getUserId()),
                "User %d is not allowed to call setSecondaryLockscreenEnabled",
                        caller.getUserId());
        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());
        synchronized (getLockObject()) {
            DevicePolicyData policy = getUserData(caller.getUserId());
            policy.mSecondaryLockscreenEnabled = enabled;
            saveSettingsLocked(caller.getUserId());