diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-07-08 18:18:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-07-08 18:18:13 +0000 |
commit | 58f26e9dfbd3986037fa5e52e8def1cb6b741bc3 (patch) | |
tree | e67996197a675424f13a1b334404710890139230 | |
parent | a4854d39ae6e03d6b9430bfdef85ecb7505e0139 (diff) | |
parent | 187350915315ded09fd97164bd7e8882e7aaefb3 (diff) | |
download | base-58f26e9dfbd3986037fa5e52e8def1cb6b741bc3.tar.gz |
Merge "The order of child windows is switched"
-rw-r--r-- | services/java/com/android/server/wm/WindowState.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index 81eac20cb11e..e81486279e99 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -314,7 +314,32 @@ final class WindowState implements WindowManagerPolicy.WindowState { mSubLayer = mPolicy.subWindowTypeToLayerLw(a.type); mAttachedWindow = attachedWindow; if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + mAttachedWindow); - mAttachedWindow.mChildWindows.add(this); + + int children_size = mAttachedWindow.mChildWindows.size(); + if (children_size == 0) { + mAttachedWindow.mChildWindows.add(this); + } else { + for (int i = 0; i < children_size; i++) { + WindowState child = (WindowState)mAttachedWindow.mChildWindows.get(i); + if (this.mSubLayer < child.mSubLayer) { + mAttachedWindow.mChildWindows.add(i, this); + break; + } else if (this.mSubLayer > child.mSubLayer) { + continue; + } + + if (this.mBaseLayer <= child.mBaseLayer) { + mAttachedWindow.mChildWindows.add(i, this); + break; + } else { + continue; + } + } + if (children_size == mAttachedWindow.mChildWindows.size()) { + mAttachedWindow.mChildWindows.add(this); + } + } + mLayoutAttached = mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; mIsImWindow = attachedWindow.mAttrs.type == TYPE_INPUT_METHOD |