diff options
author | Kevin Ma <kma@google.com> | 2014-09-26 18:30:37 +0000 |
---|---|---|
committer | Kevin Ma <kma@google.com> | 2014-09-26 18:51:16 +0000 |
commit | 8174879e091aa2b9b96c026714bd3e5b5f308dff (patch) | |
tree | 1fe64a92b5bdfc3e562f29f4476a2551cdc3d4c9 | |
parent | 04c6d73fd0e4472505275688ef8497bc6697647c (diff) | |
download | frameworks_base-8174879e091aa2b9b96c026714bd3e5b5f308dff.zip frameworks_base-8174879e091aa2b9b96c026714bd3e5b5f308dff.tar.gz frameworks_base-8174879e091aa2b9b96c026714bd3e5b5f308dff.tar.bz2 |
Revert "Revert "DO NOT MERGE Fix race condition between binder deaths""
This reverts commit 04c6d73fd0e4472505275688ef8497bc6697647c.
Bug: 17286687
Change-Id: Ic11d1e35198accb5a05cd419f5a522bc39fc789b
3 files changed, 13 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index ca4ad8a..4fe37e8 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -245,6 +245,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); diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 72b4034..6823577 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -155,7 +155,7 @@ public class TaskStack { final ArrayList<WindowState> windows = activities.get(activityNdx).allAppWindows; for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) { final WindowStateAnimator winAnimator = windows.get(winNdx).mWinAnimator; - if (winAnimator.isAnimating() && !winAnimator.isDummyAnimation()) { + if (winAnimator.isAnimating() || winAnimator.mWin.mExiting) { return true; } } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 751919b..2b57f50 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -3540,7 +3540,7 @@ public class WindowManagerService extends IWindowManager.Stub return; } final Task oldTask = mTaskIdToTask.get(atoken.groupId); - removeAppFromTaskLocked(atoken); + oldTask.removeAppToken(atoken); atoken.groupId = groupId; Task newTask = mTaskIdToTask.get(groupId); @@ -4562,6 +4562,8 @@ public class WindowManagerService extends IWindowManager.Stub } void removeAppFromTaskLocked(AppWindowToken wtoken) { + wtoken.removeAllWindows(); + final Task task = mTaskIdToTask.get(wtoken.groupId); if (task != null) { if (!task.removeAppToken(wtoken)) { |