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

Commit 533ac839 authored by Danny Baumann's avatar Danny Baumann Committed by Steve Kondik
Browse files

fw/base: allow home button to wake device [1/2]

Change-Id: I2b79561dcfa7e569b2e24bbabfffb11517d4d313
parent e007e73c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3599,6 +3599,12 @@ public final class Settings {
         */
        public static final String KEY_APP_SWITCH_LONG_PRESS_ACTION = "key_app_switch_long_press_action";

        /**
         * Whether to wake the screen with the home key, the value is boolean.
         * @hide
         */
        public static final String HOME_WAKE_SCREEN = "home_wake_screen";

        /**
         * Color temperature of the display during the day
         * @hide
+15 −0
Original line number Diff line number Diff line
@@ -461,6 +461,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    boolean mUseTvRouting;
    int mBackKillTimeout;

    // Behavior of home wake
    boolean mHomeWakeScreen;

    int mDeviceHardwareKeys;

    int mPointerLocationMode = 0; // guarded by mLock
@@ -850,6 +853,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.USE_EDGE_SERVICE_FOR_GESTURES), false, this,
                    UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.HOME_WAKE_SCREEN), false, this,
                    UserHandle.USER_ALL);

            updateSettings();
        }

@@ -2054,6 +2061,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    UserHandle.USER_CURRENT);
            mVolBtnMusicControls = (Settings.System.getIntForUser(resolver,
                    Settings.System.VOLBTN_MUSIC_CONTROLS, 1, UserHandle.USER_CURRENT) == 1);
            mHomeWakeScreen = (Settings.System.getIntForUser(resolver,
                    Settings.System.HOME_WAKE_SCREEN, 1, UserHandle.USER_CURRENT) == 1);

            // Configure wake gesture.
            boolean wakeGestureEnabledSetting = Settings.Secure.getIntForUser(resolver,
@@ -5539,6 +5548,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
                break;

            case KeyEvent.KEYCODE_HOME:
                if (down && !interactive && mHomeWakeScreen) {
                    isWakeKey = true;
                }
                break;

            case KeyEvent.KEYCODE_ENDCALL: {
                result &= ~ACTION_PASS_TO_USER;
                if (down) {