From b9a3a8f7abbc408fcef75729a33754db3d14938b Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 24 Nov 2021 04:23:10 +0000 Subject: [PATCH] Fix NPE from null thumbnail data when canceling recents animation Bug: 206339573 Test: Presubmit (unable to reproduce) Change-Id: Ia4144fe1d09e7a0a178b9d4f102769c3ab3c376a --- .../android/quickstep/RecentsAnimationCallbacks.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java index dd6392cb9a..b50267633b 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationCallbacks.java @@ -23,6 +23,7 @@ import android.util.ArraySet; import android.view.RemoteAnimationTarget; import androidx.annotation.BinderThread; +import androidx.annotation.NonNull; import androidx.annotation.UiThread; import com.android.launcher3.Utilities; @@ -77,7 +78,7 @@ public class RecentsAnimationCallbacks implements public void notifyAnimationCanceled() { mCancelled = true; - onAnimationCanceled(null); + onAnimationCanceled(new HashMap<>()); } // Called only in Q platform @@ -167,16 +168,17 @@ public class RecentsAnimationCallbacks implements * Callback from the system when the recents animation is canceled. {@param thumbnailData} * is passed back for rendering screenshot to replace live tile. */ - default void onRecentsAnimationCanceled(HashMap thumbnailDatas) {} + default void onRecentsAnimationCanceled( + @NonNull HashMap thumbnailDatas) {} /** * Callback made whenever the recents animation is finished. */ - default void onRecentsAnimationFinished(RecentsAnimationController controller) {} + default void onRecentsAnimationFinished(@NonNull RecentsAnimationController controller) {} /** * Callback made when a task started from the recents is ready for an app transition. */ - default void onTasksAppeared(RemoteAnimationTargetCompat[] appearedTaskTarget) {} + default void onTasksAppeared(@NonNull RemoteAnimationTargetCompat[] appearedTaskTarget) {} } }