Merge "Do not create starting window if there is no task." into tm-dev

This commit is contained in:
Wei Sheng Shih
2022-08-17 06:23:15 +00:00
committed by Android (Google) Code Review

View File

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