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

Unverified Commit 7300b02f authored by OnlyTomInSecond's avatar OnlyTomInSecond Committed by Skyblueborb
Browse files

fixup! Implement edge long swipe gesture.

Do not send a key event when gesture isn't finished.

Test: Enable edge long swipe in settings, open an app that doesn't
      support predictive back gesture, then trigger edge long swipe.
Change-Id: Ie55a7f4adefd49c76b0ecc811e3c6568e749946a
parent a8e396d5
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -854,6 +854,11 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
                dispatchOnBackInvoked(callback);
            } else {
                tryDispatchOnBackCancelled(callback);
                if (mTriggerLongSwipe) {
                    sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK,
                            KeyEvent.FLAG_LONG_SWIPE);
                    sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, KeyEvent.FLAG_LONG_SWIPE);
                }
            }
        }
        mRealCallbackInvoked = false;
@@ -872,11 +877,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
            return;
        }
        if (mTriggerLongSwipe) {
            // Let key event handlers deal with back long swipe gesture
            sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK, KeyEvent.FLAG_LONG_SWIPE);
            sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, KeyEvent.FLAG_LONG_SWIPE);
            finishBackNavigation(false);
            return;
            mCurrentTracker.setTriggerBack(false);
        }
        boolean triggerBack = activeTouchTracker.getTriggerBack();
        ProtoLog.d(WM_SHELL_BACK_PREVIEW, "onGestureFinished() mTriggerBack == %s", triggerBack);