From c35c6b8863305692bf0358ba5da0a38644cfedb0 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 27 Jul 2021 22:06:00 -1000 Subject: [PATCH] Nullify mParallelRunningAnim after it ends to avoid updating it Keeping the stale reference after the animation ends is dangerous because if we call end() on it, it will jump to the now-obsolete end value. Test: atest NexusLauncherTests:com.android.launcher3.memory.MemoryTests#testAppLaunchFromWorkspace Bug: 193440212 Change-Id: I8ca45db7ceec2d6e6a9c6e69a6e0359fd73a7d27 --- quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index c412eceba0..97f46a5463 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1153,6 +1153,12 @@ public abstract class AbsSwipeUpHandler, mGestureState.getEndTarget(), duration, mTaskAnimationManager.getCurrentCallbacks()); if (mParallelRunningAnim != null) { + mParallelRunningAnim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mParallelRunningAnim = null; + } + }); mParallelRunningAnim.start(); } }