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

Commit 32a3bf35 authored by Benjamin Franz's avatar Benjamin Franz
Browse files

Update DPM.setKeyguardDisabled to also dismiss the keyguard

Currently if the keyguard is shown, setKeyguardDisabled does not
dismiss it but disables it for the future. This change also dismisses
the keyguard in this situation.

Test: manual
Bug: 64383815
Change-Id: Idb89f363510a18c741d335d96d11c5492c0eaee3
parent 409c1b95
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -6764,6 +6764,7 @@ public class DevicePolicyManager {
        return null;
        return null;
    }
    }


    // STOPSHIP: Remove reference to CUR_DEVELOPMENT before shipping
    /**
    /**
     * Called by a device owner to disable the keyguard altogether.
     * Called by a device owner to disable the keyguard altogether.
     * <p>
     * <p>
@@ -6772,6 +6773,10 @@ public class DevicePolicyManager {
     * password, pin or pattern is set after the keyguard was disabled, the keyguard stops being
     * password, pin or pattern is set after the keyguard was disabled, the keyguard stops being
     * disabled.
     * disabled.
     *
     *
     * <p>
     * As of {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT}, this call also dismisses the
     * keyguard if it is currently shown.
     *
     * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
     * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
     * @param disabled {@code true} disables the keyguard, {@code false} reenables it.
     * @param disabled {@code true} disables the keyguard, {@code false} reenables it.
     * @return {@code false} if attempting to disable the keyguard while a lock password was in
     * @return {@code false} if attempting to disable the keyguard while a lock password was in
+3 −0
Original line number Original line Diff line number Diff line
@@ -9077,6 +9077,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                return false;
                return false;
            }
            }
            mLockPatternUtils.setLockScreenDisabled(disabled, userId);
            mLockPatternUtils.setLockScreenDisabled(disabled, userId);
            mInjector.getIWindowManager().dismissKeyguard(null);
        } catch (RemoteException e) {
            // Same process, does not happen.
        } finally {
        } finally {
            mInjector.binderRestoreCallingIdentity(ident);
            mInjector.binderRestoreCallingIdentity(ident);
        }
        }