summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilsonshih <wilsonshih@google.com>2022-05-23 12:36:26 +0800
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-11 02:29:05 +0000
commit15ee7610607abe7da74265ede010b48ee57f63ee (patch)
tree5296b1fb6e239b46ea0a1913fe6147ff3435eebf
parent51b4a6c81265fc3c1303f4195799ed5b6a6873f2 (diff)
downloadbase-15ee7610607abe7da74265ede010b48ee57f63ee.tar.gz
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) (cherry picked from commit ea100e579e067fe117b42803e9a776419490bf48) Merged-In: Iea264cd8b605443c695165c1136d56b86ffd4eb1
-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.