summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2022-05-23 12:36:26 +0800
committer Wei Sheng Shih <wilsonshih@google.com> 2022-08-08 06:41:22 +0000
commitf5909156007fb7976c34ec187a68792d92a6edc2 (patch)
tree681de671d30393bdab4d46d7e18c5f638d95ded1
parentc4b0e9318df1429539234eed3ff670052ecf8dcd (diff)
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 Bug: 240032099 Test: atest SplashscreenTests ActivityRecordTests Change-Id: Iea264cd8b605443c695165c1136d56b86ffd4eb1 Merged-In: Iea264cd8b605443c695165c1136d56b86ffd4eb1 (cherry picked from commit 24697fe3fdf92cac03b553892a3e1d17ae30c8a1)
-rw-r--r--services/core/java/com/android/server/wm/StartingSurfaceController.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/StartingSurfaceController.java b/services/core/java/com/android/server/wm/StartingSurfaceController.java
index f83173bd46c0..0bb773ae5e41 100644
--- a/services/core/java/com/android/server/wm/StartingSurfaceController.java
+++ b/services/core/java/com/android/server/wm/StartingSurfaceController.java
@@ -220,6 +220,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.