From 255fe1ea45e77e25c9cce86b0999a16e6c8d3b7c Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 8 Jul 2021 10:12:34 -0700 Subject: [PATCH] Fix crash when handling recents animation canceled - If Launcher finishes the animation, that also cleans up the screenshot on the server side, so we can skip calling it Fixes: 192684578 Test: N/a, adding a null check Change-Id: I8bf1ad5089762469697d14842cc14c184055e925 --- quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index e867f07fb7..7e45369692 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -387,8 +387,11 @@ public abstract class AbsSwipeUpHandler, mGestureState.runOnceAtState(STATE_RECENTS_ANIMATION_CANCELED, () -> { ThumbnailData snapshot = mGestureState.consumeRecentsAnimationCanceledSnapshot(); if (snapshot != null) { - mRecentsView.switchToScreenshot(snapshot, - () -> mRecentsAnimationController.cleanupScreenshot()); + mRecentsView.switchToScreenshot(snapshot, () -> { + if (mRecentsAnimationController != null) { + mRecentsAnimationController.cleanupScreenshot(); + } + }); mRecentsView.onRecentsAnimationComplete(); } });