diff options
author | Filip Gruszczynski <gruszczy@google.com> | 2015-09-01 23:11:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-01 23:11:46 +0000 |
commit | cbacd4f0cee10b63adf6e2d482e7b4f62c0104a0 (patch) | |
tree | 68fc064913668f5737bddc3a3a7e1a66eda3a782 /services | |
parent | f50d4ce6d31c8401b36cbf07df75264bc417519d (diff) | |
parent | d66af6a65533e86468db402907b35ed3e96e6bec (diff) | |
download | frameworks_base-cbacd4f0cee10b63adf6e2d482e7b4f62c0104a0.zip frameworks_base-cbacd4f0cee10b63adf6e2d482e7b4f62c0104a0.tar.gz frameworks_base-cbacd4f0cee10b63adf6e2d482e7b4f62c0104a0.tar.bz2 |
Merge "Don't perform layout while adjusting displays/stacks state." into mnc-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/wm/TaskStack.java | 5 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 22 |
2 files changed, 20 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index 794b49c..985bbfb 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -375,7 +375,10 @@ public class TaskStack { for (int appNdx = appWindowTokens.size() - 1; appNdx >= 0; --appNdx) { final WindowList appWindows = appWindowTokens.get(appNdx).allAppWindows; for (int winNdx = appWindows.size() - 1; winNdx >= 0; --winNdx) { - mService.removeWindowInnerLocked(appWindows.get(winNdx)); + // We are in the middle of changing the state of displays/stacks/tasks. We need + // to finish that, before we let layout interfere with it. + mService.removeWindowInnerLocked(appWindows.get(winNdx), + false /* performLayout */); doAnotherLayoutPass = true; } } diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index bc5ef36..03c10d4 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2793,6 +2793,10 @@ public class WindowManagerService extends IWindowManager.Stub } void removeWindowInnerLocked(WindowState win) { + removeWindowInnerLocked(win, true); + } + + void removeWindowInnerLocked(WindowState win, boolean performLayout) { if (win.mRemoved) { // Nothing to do. return; @@ -2890,7 +2894,9 @@ public class WindowManagerService extends IWindowManager.Stub if (displayContent != null) { displayContent.layoutNeeded = true; } - performLayoutAndPlaceSurfacesLocked(); + if (performLayout) { + performLayoutAndPlaceSurfacesLocked(); + } if (win.mAppToken != null) { win.mAppToken.updateReportedVisibilityLocked(); } @@ -5193,7 +5199,9 @@ public class WindowManagerService extends IWindowManager.Stub } public void removeStack(int stackId) { - mStackIdToStack.remove(stackId); + synchronized (mWindowMap) { + mStackIdToStack.remove(stackId); + } } public void removeTask(int taskId) { @@ -5267,10 +5275,12 @@ public class WindowManagerService extends IWindowManager.Stub } public void getStackBounds(int stackId, Rect bounds) { - final TaskStack stack = mStackIdToStack.get(stackId); - if (stack != null) { - stack.getBounds(bounds); - return; + synchronized (mWindowMap) { + final TaskStack stack = mStackIdToStack.get(stackId); + if (stack != null) { + stack.getBounds(bounds); + return; + } } bounds.setEmpty(); } |