From a554a02f30261505e8e9bc5feb30cabf1942edf0 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 12 Jun 2023 23:49:30 +0000 Subject: [PATCH] Fix NPE from accessing pausing tasks - It's possible for mPausingTasks to be unset between startRecentsTransition() and startAnimation(), and in these cases canceling with a screenshot can not take the snapshots as we have no leashes of the tasks in the animation itself. For now, just cancel the transition without the snapshots. Fixes: 286874048 Test: Just adding an NPE check Change-Id: Ie1315d8f6451cfb9b2ee2782c7d89db3cbb36aac --- .../com/android/wm/shell/recents/RecentsTransitionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java index a612f5f09e886..8024a4c22f36d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java @@ -313,7 +313,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler { private Pair getSnapshotsForPausingTasks() { int[] taskIds = null; TaskSnapshot[] snapshots = null; - if (mPausingTasks.size() > 0) { + if (mPausingTasks != null && mPausingTasks.size() > 0) { taskIds = new int[mPausingTasks.size()]; snapshots = new TaskSnapshot[mPausingTasks.size()]; try {