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
This commit is contained in:
wilsonshih
2022-05-23 12:36:26 +08:00
parent 39cf0dcd14
commit 24697fe3fd

View File

@@ -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.