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

Commit 8239ed87 authored by Tony Wickham's avatar Tony Wickham
Browse files

Remove mOnRecentsScrollListener when continuing quick switch gesture

Test: Quick switch from A to B, touch nav during the transition and
continue quick switching to C; ensure running task doesn't jump to
fullscreen randomly throughout the scroll
Fixes: 186269584

Change-Id: Ibebad3d8c8e8f86c7f53a028c75bb5916369df7f
parent 9d16d7f1
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1376,7 +1376,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
    private void invalidateHandlerWithLauncher() {
        endLauncherTransitionController();

        mRecentsView.removeOnScrollChangedListener(mOnRecentsScrollListener);
        mRecentsView.onGestureAnimationEnd();
        resetLauncherListeners();
    }
@@ -1391,12 +1390,18 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        }
    }

    /**
     * Unlike invalidateHandlerWithLauncher, this is called even when switching consumers, e.g. on
     * continued quick switch gesture, which cancels the previous handler but doesn't invalidate it.
     */
    private void resetLauncherListeners() {
        // Reset the callback for deferred activity launches
        if (!LIVE_TILE.get()) {
            mActivityInterface.setOnDeferredActivityLaunchCallback(null);
        }
        mActivity.getRootView().setOnApplyWindowInsetsListener(null);

        mRecentsView.removeOnScrollChangedListener(mOnRecentsScrollListener);
    }

    private void resetStateForAnimationCancel() {