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

Commit b4e21883 authored by Benjamin Franz's avatar Benjamin Franz Committed by Android (Google) Code Review
Browse files

Merge "Fix a SecurityException in setKeyguardEnabledState"

parents 5c1405e1 3223106d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5817,12 +5817,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        final int userId = UserHandle.getCallingUserId();
        LockPatternUtils utils = new LockPatternUtils(mContext);

        long ident = Binder.clearCallingIdentity();
        try {
            // disallow disabling the keyguard if a password is currently set
            if (!enabled && utils.isSecure(userId)) {
                return false;
            }
        long ident = Binder.clearCallingIdentity();
        try {
            utils.setLockScreenDisabled(!enabled, userId);
        } finally {
            Binder.restoreCallingIdentity(ident);