summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wei Sheng Shih <wilsonshih@google.com> 2021-03-18 04:38:20 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-03-18 04:38:20 +0000
commit6397a19ee896723cb463b25cda5a2f51c51dfbac (patch)
treeaa3f69a75b7650447ece948cb4bedbc351f8958f
parentfc97737b46ed1601a90e80bd35ac1121bcf29412 (diff)
parente19a5a29d65bb9765bc3ae635c43de73df798cb9 (diff)
Merge "Do not add starting window after the starting data was cleared." into sc-dev
-rw-r--r--data/etc/services.core.protolog.json6
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java3
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java16
3 files changed, 20 insertions, 5 deletions
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index 115bd9b08a53..6076c2ad1a1d 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -3307,6 +3307,12 @@
"group": "WM_DEBUG_WINDOW_TRANSITIONS",
"at": "com\/android\/server\/wm\/TransitionController.java"
},
+ "1804245629": {
+ "message": "Attempted to add starting window to token but already cleaned",
+ "level": "WARN",
+ "group": "WM_ERROR",
+ "at": "com\/android\/server\/wm\/WindowManagerService.java"
+ },
"1810019902": {
"message": "TRANSIT_FLAG_OPEN_BEHIND, adding %s to mOpeningApps",
"level": "DEBUG",
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index d361a8c03fbd..b12ce67832ef 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -2247,6 +2247,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// Go ahead and cancel the request.
ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Clearing startingData for token=%s", this);
mStartingData = null;
+ // Clean surface up since we don't want the window to be added back, so we don't
+ // need to keep the surface to remove it.
+ mStartingSurface = null;
}
return;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index dce79a093a6f..c5e000000eee 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -1600,11 +1600,17 @@ public class WindowManagerService extends IWindowManager.Stub
ProtoLog.w(WM_ERROR, "Attempted to add window with exiting application token "
+ ".%s Aborting.", token);
return WindowManagerGlobal.ADD_APP_EXITING;
- } else if (type == TYPE_APPLICATION_STARTING && activity.mStartingWindow != null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add starting window to token with already existing"
- + " starting window");
- return WindowManagerGlobal.ADD_DUPLICATE_ADD;
+ } else if (type == TYPE_APPLICATION_STARTING) {
+ if (activity.mStartingWindow != null) {
+ ProtoLog.w(WM_ERROR, "Attempted to add starting window to "
+ + "token with already existing starting window");
+ return WindowManagerGlobal.ADD_DUPLICATE_ADD;
+ }
+ if (activity.mStartingData == null) {
+ ProtoLog.w(WM_ERROR, "Attempted to add starting window to "
+ + "token but already cleaned");
+ return WindowManagerGlobal.ADD_DUPLICATE_ADD;
+ }
}
} else if (rootType == TYPE_INPUT_METHOD) {
if (token.windowType != TYPE_INPUT_METHOD) {