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

Commit a814c8ff authored by Kra1o5's avatar Kra1o5 Committed by Steve Kondik
Browse files

Buttons: Allow setting default long-press app switch behavior

Enables the ability to assign different default actions to longpress on
the app switch button.

Change-Id: I6fa124d4ad97d1014f9f71052abf5c6081cf6ef0
parent 9e2ae7e5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -34,4 +34,7 @@
    <java-symbol type="bool" name="config_ledCanPulse" />

    <java-symbol type="bool" name="config_singleStageCameraKey" />
    <java-symbol type="integer" name="config_longPressOnMenuBehavior" />
    <java-symbol type="integer" name="config_longPressOnAppSwitchBehavior" />

</resources>
+12 −0
Original line number Diff line number Diff line
@@ -1026,6 +1026,18 @@
    -->
    <integer name="config_longPressOnMenuBehavior">3</integer>

    <!-- Control the behavior when the user long presses the app switch 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
         services/core/java/com/android/server/policy/policy/impl/PhoneWindowManager.java
    -->
    <integer name="config_longPressOnAppSwitchBehavior">0</integer>

    <!-- Hardware 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:
+0 −1
Original line number Diff line number Diff line
@@ -1562,7 +1562,6 @@
  <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" />
+2 −1
Original line number Diff line number Diff line
@@ -2031,7 +2031,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mPressOnAssistBehavior = KEY_ACTION_SEARCH;
        mLongPressOnAssistBehavior = KEY_ACTION_VOICE_SEARCH;
        mPressOnAppSwitchBehavior = KEY_ACTION_APP_SWITCH;
        mLongPressOnAppSwitchBehavior = KEY_ACTION_NOTHING;
        mLongPressOnAppSwitchBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longPressOnAppSwitchBehavior);

        mLongPressOnHomeBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longPressOnHomeBehavior);