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

Commit e5d1dd02 authored by Phil Tunstall's avatar Phil Tunstall Committed by Matt Garnes
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 fb76664d
Loading
Loading
Loading
Loading
+66 −0
Original line number Diff line number Diff line
@@ -2773,6 +2773,72 @@ public final class Settings {
         */
        public static final String DIALER_OPENCNAM_AUTH_TOKEN = "dialer_opencnam_auth_token";

        /**
         * 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";

        /**
         * I am the lolrus.
         * <p>
+25 −0
Original line number Diff line number Diff line
@@ -755,6 +755,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>
+4 −0
Original line number Diff line number Diff line
@@ -1521,11 +1521,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" />
@@ -1823,6 +1825,8 @@
  <java-symbol type="string" name="wildcardProfile" />
  <java-symbol type="string" name="profile_picker_title" />
  <java-symbol type="string" name="profile_none" />
  <java-symbol type="string" name="global_action_choose_profile" />
  <java-symbol type="drawable" name="ic_lock_profile" />

  <java-symbol type="layout" name="resolver_list" />
  <java-symbol type="id" name="resolver_list" />
+287 −77

File changed.

Preview size limit exceeded, changes collapsed.