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

Commit 19243ce2 authored by Sam Mortimer's avatar Sam Mortimer Committed by Michael Bestas
Browse files

frameworks/base: Allow customisation of navbar app switch long press action

Change-Id: Idfb12a7bae6d921d207b5becd69b1005ce3d2b92
parent f453600c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
    android:layout_width="@dimen/navigation_key_width"
    android:layout_height="match_parent"
    android:layout_weight="0"
    systemui:keyCode="187"
    android:scaleType="fitCenter"
    android:contentDescription="@string/accessibility_recent"
    android:paddingTop="15dp"
+7 −1
Original line number Diff line number Diff line
@@ -522,7 +522,13 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
                    mNavigationBarView.setDisabledFlags(mDisabledFlags1, true);
                    return true;
                } else if (v.getId() == R.id.recent_apps) {
                    return onLongPressRecents();
                    // Send long press key event so that Lineage button handling can intercept
                    KeyButtonView keyButtonView = (KeyButtonView) v;
                    keyButtonView.sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS);
                    keyButtonView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
                    return true;
                    // Original AOSP handling:
                    //return onLongPressRecents();
                }
            }
            if (sendBackLongPress) {
+3 −3
Original line number Diff line number Diff line
@@ -2496,10 +2496,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            mAppSwitchPressAction = Action.fromSettings(resolver,
                    LineageSettings.System.KEY_APP_SWITCH_ACTION,
                    mAppSwitchPressAction);
        }
        mAppSwitchLongPressAction = Action.fromSettings(resolver,
                LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION,
                mAppSwitchLongPressAction);
        }

        mShortPressWindowBehavior = SHORT_PRESS_WINDOW_NOTHING;
        if (mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE)) {