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

Commit b785fddb authored by David Morgan's avatar David Morgan Committed by Steve Kondik
Browse files

Keyboard Slide Unlock (1/2)

Make slide-to-unlock configurable. Instead of using overlays to configure
whether or not a device can slide out the keyboard to unlock, make it a
system setting.

Change-Id: I4e2e6da8c660390e48a668e31c59e67308143dc4
parent 578a10ba
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2466,6 +2466,12 @@ public final class Settings {
         */
        public static final String TRACKBALL_UNLOCK_SCREEN = "trackball_unlock_screen";

        /**
         * Whether to unlock the screen with the slide-out keyboard. The value is boolean (1 or 0).
         * @hide
         */
        public static final String SLIDER_UNLOCK_SCREEN = "slider_unlock_screen";

        /**
         * Whether to wake the screen with the volume keys. The value is boolean (1 or 0).
         * @hide
+9 −4
Original line number Diff line number Diff line
@@ -148,6 +148,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
    private boolean mTrackballUnlockScreen = (Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.TRACKBALL_UNLOCK_SCREEN, 0) == 1);

    private boolean mSliderUnlockScreen = (Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.SLIDER_UNLOCK_SCREEN, 0) == 1);

    private boolean mMenuUnlockScreen = (Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.MENU_UNLOCK_SCREEN, 0) == 1);

@@ -1210,15 +1213,17 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM

    void updateConfiguration() {
        Configuration newConfig = getResources().getConfiguration();
        if (newConfig.orientation != mCreationOrientation) {
            mCallback.recreateMe(newConfig);
        } else if (newConfig.hardKeyboardHidden != mKeyboardHidden) {
        if (newConfig.hardKeyboardHidden != mKeyboardHidden) {
            mKeyboardHidden = newConfig.hardKeyboardHidden;
            final boolean isKeyboardOpen = mKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;
            if (mUpdateMonitor.isKeyguardBypassEnabled() && isKeyboardOpen) {
            if (mSliderUnlockScreen && isKeyboardOpen) {
                mCallback.goToUnlockScreen();
                return;
            }
        }
        if (newConfig.orientation != mCreationOrientation) {
            mCallback.recreateMe(newConfig);
        }
    }

    @Override