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

Commit 08c57fca authored by Phil Tunstall's avatar Phil Tunstall Committed by Steve Kondik
Browse files

Hardware key custom rebinding (1/2)

Framework changes to allow rebinding of the actions performed on the
following key press events: Home long-press, home double-tap, menu press,
menu long-press, search press, search long-press, app-switch press and
app-switch long-press.

The available actions are: Nothing, open/close menu, recent apps
switcher, search assistant, voice search, in-app search, device sleep,
and launch camera.

Change-Id: I72c0d220a09d79230bfa299e0521ed693e5c25f1
parent f175024a
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
@@ -3248,6 +3248,71 @@ public final class Settings {
         */
        public static final String WIFI_AUTO_CONNECT_TYPE = "wifi_auto_connect_type";

        /**
         * Action to perform when the home key is long-pressed.
         * (Default can be configured via config_longPressOnHomeBehavior)
         * 0 - Nothing
         * 1 - Menu
         * 2 - App-switch
         * 3 - Search
         * 4 - Voice search
         * 5 - In-app search
         * 6 - Launch Camera
         * 7 - Last app
         * @hide
         */
        public static final String KEY_HOME_LONG_PRESS_ACTION = "key_home_long_press_action";

        /**
         * Action to perform when the home key is double-tapped.
         * (Default can be configured via config_doubleTapOnHomeBehavior)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_HOME_DOUBLE_TAP_ACTION = "key_home_double_tap_action";

        /**
         * Action to perform when the menu key is pressed. (Default is 1)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_MENU_ACTION = "key_menu_action";

        /**
         * Action to perform when the menu key is long-pressed.
         * (Default is 0 on devices with a search key, 3 on devices without)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_MENU_LONG_PRESS_ACTION = "key_menu_long_press_action";

        /**
         * Action to perform when the assistant (search) key is pressed. (Default is 3)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_ASSIST_ACTION = "key_assist_action";

        /**
         * Action to perform when the assistant (search) key is long-pressed. (Default is 4)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_ASSIST_LONG_PRESS_ACTION = "key_assist_long_press_action";

        /**
         * Action to perform when the app switch key is pressed. (Default is 2)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_APP_SWITCH_ACTION = "key_app_switch_action";

        /**
         * Action to perform when the app switch key is long-pressed. (Default is 0)
         * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
         * @hide
         */
        public static final String KEY_APP_SWITCH_LONG_PRESS_ACTION = "key_app_switch_long_press_action";

        /**
         * Settings to backup. This is here so that it's in the same place as the settings
+25 −0
Original line number Diff line number Diff line
@@ -928,6 +928,31 @@
    -->
    <integer name="config_doubleTapOnHomeBehavior">0</integer>

    <!-- Control the behavior when the user long presses the menu button.
            0 - Nothing
            1 - Menu key
            2 - Recent apps view in SystemUI
            3 - Launch assist intent
            4 - Voice Search
            5 - In-app Search
         This needs to match the constants in
         policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
    -->
    <integer name="config_longPressOnMenuBehavior">3</integer>

    <!-- Hardware 'face' keys present on the device, stored as a bit field.
         This integer should equal the sum of the corresponding value for each
         of the following keys present:
             1 - Home
             2 - Back
             4 - Menu
             8 - Assistant (search)
            16 - App switch
            32 - Camera
         For example, a device with Home, Back and Menu keys would set this
         config to 7. -->
    <integer name="config_deviceHardwareKeys">15</integer>

    <!-- Minimum screen brightness setting allowed by the power manager.
         The user is forbidden from setting the brightness below this level. -->
    <integer name="config_screenBrightnessSettingMinimum">10</integer>
+2 −0
Original line number Diff line number Diff line
@@ -1525,11 +1525,13 @@
  <java-symbol type="integer" name="config_carDockRotation" />
  <java-symbol type="integer" name="config_defaultUiModeType" />
  <java-symbol type="integer" name="config_deskDockRotation" />
  <java-symbol type="integer" name="config_deviceHardwareKeys" />
  <java-symbol type="integer" name="config_doubleTapOnHomeBehavior" />
  <java-symbol type="integer" name="config_lidKeyboardAccessibility" />
  <java-symbol type="integer" name="config_lidNavigationAccessibility" />
  <java-symbol type="integer" name="config_lidOpenRotation" />
  <java-symbol type="integer" name="config_longPressOnHomeBehavior" />
  <java-symbol type="integer" name="config_longPressOnMenuBehavior" />
  <java-symbol type="layout" name="global_actions_item" />
  <java-symbol type="layout" name="global_actions_silent_mode" />
  <java-symbol type="layout" name="recent_apps_dialog" />
+287 −71

File changed.

Preview size limit exceeded, changes collapsed.