summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 255a003bb542..09fce79bbcaf 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -1086,6 +1086,12 @@ final class ActivityRecord extends ConfigurationContainer {
Slog.w(TAG_WM, "Attempted to set icon of non-existing app token: " + appToken);
return false;
}
+ if (mAppWindowToken.getTask() == null) {
+ // Can be removed after unification of Task and TaskRecord.
+ Slog.w(TAG_WM, "Attempted to start a window to an app token not having attached to any"
+ + " task: " + appToken);
+ return false;
+ }
return mAppWindowToken.addStartingWindow(pkg, theme, compatInfo, nonLocalizedLabel,
labelRes, icon, logo, windowFlags, transferFrom, newTask, taskSwitch,
processRunning, allowTaskSnapshot, activityCreated, fromRecents);