diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-07-08 11:25:44 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-07-08 11:25:44 -0700 |
commit | a998fa2df957ad3f1c860d5ab8903041cf53a2f0 (patch) | |
tree | 7999c8f9267f1fc878d62db6503a3e3d4ea6fc59 /services | |
parent | 4e4cb74f2e8ee3c45fec4283f020d1f727832dac (diff) | |
parent | e14afe7163a9d25c4d06e40165051f5c2d4d540a (diff) | |
download | frameworks_base-a998fa2df957ad3f1c860d5ab8903041cf53a2f0.zip frameworks_base-a998fa2df957ad3f1c860d5ab8903041cf53a2f0.tar.gz frameworks_base-a998fa2df957ad3f1c860d5ab8903041cf53a2f0.tar.bz2 |
am e14afe71: am 58f26e9d: Merge "The order of child windows is switched"
* commit 'e14afe7163a9d25c4d06e40165051f5c2d4d540a':
The order of child windows is switched
Diffstat (limited to 'services')
-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 dfb22a7..da15856 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -361,7 +361,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 |