From a379435d0436576b93facb7d9b6e3b15e45d0ab6 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 15 Jun 2022 11:59:59 -0700 Subject: [PATCH] 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 --- .../inputconsumers/OtherActivityInputConsumer.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index 11f0ff3259..e458c1f022 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -425,12 +425,18 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mMainThreadHandler.removeCallbacks(mCancelRecentsAnimationRunnable); mMainThreadHandler.postDelayed(mCancelRecentsAnimationRunnable, 100); } - mVelocityTracker.recycle(); - mVelocityTracker = null; - mMotionPauseDetector.clear(); + cleanupAfterGesture(); TraceHelper.INSTANCE.endSection(traceToken); } + private void cleanupAfterGesture() { + if (mVelocityTracker != null) { + mVelocityTracker.recycle(); + mVelocityTracker = null; + } + mMotionPauseDetector.clear(); + } + @Override public void notifyOrientationSetup() { mRotationTouchHelper.onStartGesture(); @@ -453,6 +459,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC Preconditions.assertUIThread(); removeListener(); mInteractionHandler = null; + cleanupAfterGesture(); mOnCompleteCallback.accept(this); }