From 24697fe3fdf92cac03b553892a3e1d17ae30c8a1 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Mon, 23 May 2022 12:36:26 +0800 Subject: [PATCH] Do not create starting window if there is no task. Do not add starting window on the activity if no task exists in the activity. Also add an error log for the activity without task. Bug: 233153876 Test: atest SplashscreenTests ActivityRecordTests Change-Id: Iea264cd8b605443c695165c1136d56b86ffd4eb1 --- .../com/android/server/wm/StartingSurfaceController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/StartingSurfaceController.java b/services/core/java/com/android/server/wm/StartingSurfaceController.java index ccd018faf075d..cf939ab1b0129 100644 --- a/services/core/java/com/android/server/wm/StartingSurfaceController.java +++ b/services/core/java/com/android/server/wm/StartingSurfaceController.java @@ -223,6 +223,11 @@ public class StartingSurfaceController { // Attempt to add starting window from the top-most activity. for (int i = mDeferringAddStartActivities.size() - 1; i >= 0; --i) { final DeferringStartingWindowRecord next = mDeferringAddStartActivities.get(i); + if (next.mDeferring.getTask() == null) { + Slog.e(TAG, "No task exists: " + next.mDeferring.shortComponentName + + " parent: " + next.mDeferring.getParent()); + continue; + } next.mDeferring.showStartingWindow(next.mPrev, mInitNewTask, mInitTaskSwitch, mInitProcessRunning, true /* startActivity */, next.mSource, topOptions); // If one succeeds, it is done.