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

Commit 1fd70b1a authored by Kra1o5's avatar Kra1o5 Committed by Ethan Chen
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 8113df18
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@
    <java-symbol type="integer" name="config_deviceHardwareWakeKeys" />
    <java-symbol type="bool" name="config_singleStageCameraKey" />
    <java-symbol type="integer" name="config_longPressOnMenuBehavior" />
    <java-symbol type="integer" name="config_longPressOnAppSwitchBehavior" />

    <java-symbol type="string" name="global_action_reboot" />
    <java-symbol type="string" name="lockscreen_missing_sim_message_short" />
+12 −0
Original line number Diff line number Diff line
@@ -886,6 +886,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
         policy/src/com/android/internal/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:
+2 −1
Original line number Diff line number Diff line
@@ -1767,7 +1767,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);