Fix IME for status bar in docked mode
If the dock divider is visible, window manager raises the IME from the app's layer on top of the divider. However if the IME was targeting the status bar, it would also remove it from the status bar's layer and move it atop the divider (but below the status bar). To fix this, we now only perform the adjustment to the IME's layer if that moves the IME up, but never down. Change-Id: I1308f51b98fffee64a5075c49697f5bc177ea32e Fixes: 28024606
This commit is contained in:
@@ -208,7 +208,11 @@ public class WindowLayersController {
|
||||
|
||||
if (mDockDivider != null && mDockDivider.isVisibleLw()) {
|
||||
while (!mInputMethodWindows.isEmpty()) {
|
||||
layer = assignAndIncreaseLayerIfNeeded(mInputMethodWindows.remove(), layer);
|
||||
final WindowState w = mInputMethodWindows.remove();
|
||||
// Only ever move IME windows up, else we brake IME for windows above the divider.
|
||||
if (layer > w.mLayer) {
|
||||
layer = assignAndIncreaseLayerIfNeeded(w, layer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1567,11 +1567,13 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
// If the docked divider is visible, we still need to go through this whole
|
||||
// excercise to find the appropriate input method target (used for animations
|
||||
// and dialog adjustments), but for purposes of Z ordering we simply wish to
|
||||
// place it above the docked divider.
|
||||
// place it above the docked divider. Unless it is already above the divider.
|
||||
WindowState dockedDivider = w.mDisplayContent.mDividerControllerLocked.getWindow();
|
||||
if (dockedDivider != null && dockedDivider.isVisibleLw()) {
|
||||
int dividerIndex = windows.indexOf(dockedDivider);
|
||||
return dividerIndex > 0 ? dividerIndex + 1 : i + 1;
|
||||
if (dividerIndex > 0 && dividerIndex > i) {
|
||||
return dividerIndex + 1;
|
||||
}
|
||||
}
|
||||
return i+1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user