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

Commit db2734ca authored by Matthew Ng's avatar Matthew Ng
Browse files

Prevent quickscrub when swipe up has already started

Prevents quickscrub from starting when launcher sends the recents
started event to systemui.

Bug: 73351745
Test: manual - swipe up a little from left of home button and
immediately swipe right to start quickscrub

Change-Id: If72275ce591e80d85d8d89e6e0baf7e733d5cb1c
parent 961b465a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
        @Override
        public void onRecentsAnimationStarted() {
            mRecentsAnimationStarted = true;
            mQuickScrubController.cancelQuickSwitch();
            mQuickScrubController.setRecentsAnimationStarted(true /* started */);
        }
    };

@@ -159,6 +159,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
                mNavigationBarView.transformMatrixToGlobal(mTransformGlobalMatrix);
                mNavigationBarView.transformMatrixToLocal(mTransformLocalMatrix);
                mRecentsAnimationStarted = false;
                mQuickScrubController.setRecentsAnimationStarted(false /* started */);
                break;
            }
        }
+9 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
    private boolean mDraggingActive;
    private boolean mQuickScrubActive;
    private boolean mAllowQuickSwitch;
    private boolean mRecentsAnimationStarted;
    private float mDownOffset;
    private float mTranslation;
    private int mTouchDownX;
@@ -279,7 +280,7 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
                    }

                    // Control the button movement
                    if (!mDraggingActive && exceededTouchSlop) {
                    if (!mDraggingActive && exceededTouchSlop && !mRecentsAnimationStarted) {
                        boolean allowDrag = !mDragPositive
                                ? offset < 0 && pos < touchDown : offset >= 0 && pos > touchDown;
                        if (allowDrag) {
@@ -417,6 +418,13 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
        mDraggingActive = false;
    }

    public void setRecentsAnimationStarted(boolean started) {
        mRecentsAnimationStarted = started;
        if (started) {
            cancelQuickSwitch();
        }
    }

    public void cancelQuickSwitch() {
        mAllowQuickSwitch = false;
        mHandler.removeCallbacks(mLongPressRunnable);