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

Commit 6a20063c 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 9a8a3269
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -34,4 +34,7 @@
    <java-symbol type="bool" name="config_ledCanPulse" />
    <java-symbol type="bool" name="config_ledCanPulse" />


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

</resources>
</resources>
+12 −0
Original line number Original line Diff line number Diff line
@@ -1027,6 +1027,18 @@
    -->
    -->
    <integer name="config_longPressOnMenuBehavior">3</integer>
    <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.
    <!-- Hardware keys present on the device, stored as a bit field.
         This integer should equal the sum of the corresponding value for each
         This integer should equal the sum of the corresponding value for each
         of the following keys present:
         of the following keys present:
+0 −1
Original line number Original line Diff line number Diff line
@@ -1575,7 +1575,6 @@
  <java-symbol type="integer" name="config_lidNavigationAccessibility" />
  <java-symbol type="integer" name="config_lidNavigationAccessibility" />
  <java-symbol type="integer" name="config_lidOpenRotation" />
  <java-symbol type="integer" name="config_lidOpenRotation" />
  <java-symbol type="integer" name="config_longPressOnHomeBehavior" />
  <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_item" />
  <java-symbol type="layout" name="global_actions_silent_mode" />
  <java-symbol type="layout" name="global_actions_silent_mode" />
  <java-symbol type="layout" name="recent_apps_dialog" />
  <java-symbol type="layout" name="recent_apps_dialog" />
+2 −1
Original line number Original line Diff line number Diff line
@@ -2051,7 +2051,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mPressOnAssistBehavior = KEY_ACTION_SEARCH;
        mPressOnAssistBehavior = KEY_ACTION_SEARCH;
        mLongPressOnAssistBehavior = KEY_ACTION_VOICE_SEARCH;
        mLongPressOnAssistBehavior = KEY_ACTION_VOICE_SEARCH;
        mPressOnAppSwitchBehavior = KEY_ACTION_APP_SWITCH;
        mPressOnAppSwitchBehavior = KEY_ACTION_APP_SWITCH;
        mLongPressOnAppSwitchBehavior = KEY_ACTION_NOTHING;
        mLongPressOnAppSwitchBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longPressOnAppSwitchBehavior);


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