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

Commit 4691e778 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Merge remote-tracking branch 'origin/lineage-18.1' into v1-r

parents 82a084a6 14749db6
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1216,6 +1216,12 @@ public class KeyEvent extends InputEvent implements Parcelable {
     */
     */
    public static final int FLAG_FALLBACK = 0x400;
    public static final int FLAG_FALLBACK = 0x400;


    /**
     * Private flag that indicates that event was sent from EdgeBackGestureHandler.
     * @hide
     */
    public static final int FLAG_LONG_SWIPE = 0x800;

    /**
    /**
     * Signifies that the key is being predispatched.
     * Signifies that the key is being predispatched.
     * @hide
     * @hide
+2 −2
Original line number Original line Diff line number Diff line
@@ -235,9 +235,9 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa
                @Override
                @Override
                public void triggerBack(boolean isLongPress) {
                public void triggerBack(boolean isLongPress) {
                    sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK,
                    sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK,
                            isLongPress ? KeyEvent.FLAG_LONG_PRESS : 0);
                            isLongPress ? KeyEvent.FLAG_LONG_SWIPE : 0);
                    sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK,
                    sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK,
                            isLongPress ? KeyEvent.FLAG_LONG_PRESS : 0);
                            isLongPress ? KeyEvent.FLAG_LONG_SWIPE : 0);


                    mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x,
                    mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x,
                            (int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
                            (int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
+1 −3
Original line number Original line Diff line number Diff line
@@ -719,8 +719,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private PendingIntent mTorchOffPendingIntent;
    private PendingIntent mTorchOffPendingIntent;


    private boolean mLongSwipeDown;
    private boolean mLongSwipeDown;
    private static final int LONG_SWIPE_FLAGS = KeyEvent.FLAG_LONG_PRESS
            | KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY;


    private LineageHardwareManager mLineageHardware;
    private LineageHardwareManager mLineageHardware;


@@ -4263,7 +4261,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        // Handle special keys.
        // Handle special keys.
        switch (keyCode) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK: {
            case KeyEvent.KEYCODE_BACK: {
                boolean isLongSwipe = (event.getFlags() & LONG_SWIPE_FLAGS) == LONG_SWIPE_FLAGS;
                boolean isLongSwipe = (event.getFlags() & KeyEvent.FLAG_LONG_SWIPE) != 0;
                if (mLongSwipeDown && isLongSwipe && !down) {
                if (mLongSwipeDown && isLongSwipe && !down) {
                    // Trigger long swipe action
                    // Trigger long swipe action
                    performKeyAction(mEdgeLongSwipeAction, event);
                    performKeyAction(mEdgeLongSwipeAction, event);