When restacking IM windows preserve relative order.
We were still having some troubles with attached windows which we werent properly promoting here. Now we catch everything with the mIsImWindow flag. Before it was safe to assume dialogs were on top of the Input Method but with a whole range of child windows we need to be more careful. WindowManagerService has been very careful preparing the window list for us, so carry out its wishes and preserve the original relative ordering of input method windows when restacking. Bug: 28235787 Change-Id: Ied96d83f77b82df81b3b0aa94cb61e9c22999d23
This commit is contained in:
@@ -59,6 +59,7 @@ public class WindowLayersController {
|
||||
private int mHighestApplicationLayer = 0;
|
||||
private ArrayDeque<WindowState> mPinnedWindows = new ArrayDeque<>();
|
||||
private ArrayDeque<WindowState> mDockedWindows = new ArrayDeque<>();
|
||||
private ArrayDeque<WindowState> mInputMethodWindows = new ArrayDeque<>();
|
||||
private WindowState mDockDivider = null;
|
||||
private ArrayDeque<WindowState> mReplacingWindows = new ArrayDeque<>();
|
||||
|
||||
@@ -166,6 +167,7 @@ public class WindowLayersController {
|
||||
private void clear() {
|
||||
mHighestApplicationLayer = 0;
|
||||
mPinnedWindows.clear();
|
||||
mInputMethodWindows.clear();
|
||||
mDockedWindows.clear();
|
||||
mReplacingWindows.clear();
|
||||
mDockDivider = null;
|
||||
@@ -179,6 +181,10 @@ public class WindowLayersController {
|
||||
if (w.mWillReplaceWindow) {
|
||||
mReplacingWindows.add(w);
|
||||
}
|
||||
if (w.mIsImWindow) {
|
||||
mInputMethodWindows.add(w);
|
||||
return;
|
||||
}
|
||||
final TaskStack stack = w.getStack();
|
||||
if (stack == null) {
|
||||
return;
|
||||
@@ -200,12 +206,9 @@ public class WindowLayersController {
|
||||
|
||||
layer = assignAndIncreaseLayerIfNeeded(mDockDivider, layer);
|
||||
|
||||
if (mDockDivider != null && mDockDivider.isVisibleLw()
|
||||
&& mService.mInputMethodWindow != null) {
|
||||
layer = assignAndIncreaseLayerIfNeeded(mService.mInputMethodWindow, layer);
|
||||
for (int i = mService.mInputMethodDialogs.size() - 1; i >= 0; i--) {
|
||||
final WindowState dialog = mService.mInputMethodDialogs.get(i);
|
||||
layer = assignAndIncreaseLayerIfNeeded(dialog, layer);
|
||||
if (mDockDivider != null && mDockDivider.isVisibleLw()) {
|
||||
while (!mInputMethodWindows.isEmpty()) {
|
||||
layer = assignAndIncreaseLayerIfNeeded(mInputMethodWindows.remove(), layer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user