From a4b11dd984268a173e3acffcd68f85bc51fe06b9 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 1 May 2020 09:23:38 -0700 Subject: [PATCH] Skip setting the controller if the animation is already finished Bug: 154568748 Change-Id: I999c0cc3a4d9661bcf6dcd1e804746a3a0959a83 --- .../src/com/android/quickstep/TaskAnimationManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index f5088e7e5a..21e8c92494 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -71,6 +71,12 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn @Override public void onRecentsAnimationStart(RecentsAnimationController controller, RecentsAnimationTargets targets) { + if (mCallbacks == null) { + // It's possible for the recents animation to have finished and be cleaned up + // by the time we process the start callback, and in that case, just we can skip + // handling this call entirely + return; + } mController = controller; mTargets = targets; }