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

Commit a379435d authored by Tony Wickham's avatar Tony Wickham
Browse files

Clear MotionPauseDetector onRecentsAnimationCanceled()

Fixes: 234022857
Test: Open ImCapture and swipe up to home; repeat 20 times and ensure never see empty overview tasks over launcher
Change-Id: Icef6d7a54000e1e21453feeae7e207679077b772
parent fe83fce4
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -425,10 +425,16 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
            mMainThreadHandler.removeCallbacks(mCancelRecentsAnimationRunnable);
            mMainThreadHandler.postDelayed(mCancelRecentsAnimationRunnable, 100);
        }
        cleanupAfterGesture();
        TraceHelper.INSTANCE.endSection(traceToken);
    }

    private void cleanupAfterGesture() {
        if (mVelocityTracker != null) {
            mVelocityTracker.recycle();
            mVelocityTracker = null;
        }
        mMotionPauseDetector.clear();
        TraceHelper.INSTANCE.endSection(traceToken);
    }

    @Override
@@ -453,6 +459,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
        Preconditions.assertUIThread();
        removeListener();
        mInteractionHandler = null;
        cleanupAfterGesture();
        mOnCompleteCallback.accept(this);
    }