summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2018-04-16 11:09:22 -0700
committer Robert Carr <racarr@google.com> 2018-04-19 13:02:48 -0700
commit4a1cdbd4e90a71290214f17b94ab65125e64d896 (patch)
tree683080c961ffbf8685930a592a0e65db1771a680
parenta194a6bee36365b7aa2cdf3e86fe26e600ef338b (diff)
Fix layering of non-IME target windows in IME-target app in split-screen.
In split-screen mode we elevate child windows of the IME target with relative layering to ensure they and the IME can exist above the docked divider while the IME target itself still exists below. For behavior compatibility with O we need to give this same treatment to all windows with the same token as the IME target. Bug: 70811741 Test: Manual. go/wm-smoke. Change-Id: Ife174069ec2571c95d546981d196b7f519bb08ca
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java32
1 files changed, 27 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 61ce062d6047..425a2e16d064 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -4708,16 +4708,38 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
outPoint.offset(-mAttrs.surfaceInsets.left, -mAttrs.surfaceInsets.top);
}
+ boolean needsRelativeLayeringToIme() {
+ // We only use the relative layering mode in split screen, as part of elevating the IME
+ // and windows above it's target above the docked divider.
+ if (!inSplitScreenWindowingMode()) {
+ return false;
+ }
+
+ if (isChildWindow()) {
+ // If we are a child of the input method target we need this promotion.
+ if (getParentWindow().isInputMethodTarget()) {
+ return true;
+ }
+ } else if (mAppToken != null) {
+ // Likewise if we share a token with the Input method target and are ordered
+ // above it but not necessarily a child (e.g. a Dialog) then we also need
+ // this promotion.
+ final WindowState imeTarget = mService.mInputMethodTarget;
+ boolean inTokenWithAndAboveImeTarget = imeTarget != null && imeTarget != this
+ && imeTarget.mToken == mToken && imeTarget.compareTo(this) <= 0;
+ return inTokenWithAndAboveImeTarget;
+ }
+ return false;
+ }
+
@Override
void assignLayer(Transaction t, int layer) {
// See comment in assignRelativeLayerForImeTargetChild
- if (!isChildWindow()
- || (!getParentWindow().isInputMethodTarget())
- || !inSplitScreenWindowingMode()) {
- super.assignLayer(t, layer);
+ if (needsRelativeLayeringToIme()) {
+ getDisplayContent().assignRelativeLayerForImeTargetChild(t, this);
return;
}
- getDisplayContent().assignRelativeLayerForImeTargetChild(t, this);
+ super.assignLayer(t, layer);
}
@Override