summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/wm/AppWindowToken.java
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2014-08-14 16:08:26 -0700
committerCraig Mautner <cmautner@google.com>2014-08-14 23:17:15 +0000
commit7c9ee19cbd0360a62dc4322169afc1b0b9c9e022 (patch)
treefbd8136a7374b780cb53b6364cb8a4e751604d75 /services/core/java/com/android/server/wm/AppWindowToken.java
parent9fde9a250fffc15c6bcdfc985de12c8646a9813c (diff)
downloadframeworks_base-7c9ee19cbd0360a62dc4322169afc1b0b9c9e022.zip
frameworks_base-7c9ee19cbd0360a62dc4322169afc1b0b9c9e022.tar.gz
frameworks_base-7c9ee19cbd0360a62dc4322169afc1b0b9c9e022.tar.bz2
Fix race condition between binder deaths
If a Binder dies there is a race between activity manager and window manager to see who can handle the binderDied call first. If the activity manager wins the race it will remove the activity and task but leave the windows around. Until the WindowState.binderDied call is made and all animation is complete the windows will try to access the task that they were associated with. This fix removes the windows of an activity when the activity is removed. It also defers removal of the activity and task until exiting windows have completed their animation. Fixes bug 17031518. Change-Id: Idf52f55c5feb0cad4e3664ef2eae5b7e95bbf490
Diffstat (limited to 'services/core/java/com/android/server/wm/AppWindowToken.java')
-rw-r--r--services/core/java/com/android/server/wm/AppWindowToken.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 3fcd067..b2575e6 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -252,6 +252,15 @@ class AppWindowToken extends WindowToken {
return false;
}
+ void removeAllWindows() {
+ for (int winNdx = allAppWindows.size() - 1; winNdx >= 0; --winNdx) {
+ WindowState win = allAppWindows.get(winNdx);
+ if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) Slog.w(WindowManagerService.TAG,
+ "removeAllWindows: removing win=" + win);
+ win.mService.removeWindowLocked(win.mSession, win);
+ }
+ }
+
@Override
void dump(PrintWriter pw, String prefix) {
super.dump(pw, prefix);