diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 409e04b94b046..56e592208eb6f 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -181,8 +181,8 @@ class DisplayContent extends WindowContainer= TYPE_INPUT_METHOD_DIALOG) { + t.setRelativeLayer(imeContainer.getSurfaceControl(), + wt.getSurfaceControl(), -1); + needAssignIme = false; + } + } + if (needAssignIme) { + t.setRelativeLayer(imeContainer.getSurfaceControl(), + getSurfaceControl(), Integer.MIN_VALUE); + } + } + } + /** * Window container class that contains all containers on this display that are not related to * Apps. E.g. status bar. */ - private final class NonAppWindowContainers extends DisplayChildWindowContainer { + private class NonAppWindowContainers extends DisplayChildWindowContainer { /** * Compares two child window tokens returns -1 if the first is lesser than the second in * terms of z-order and 1 otherwise. @@ -3848,12 +3877,8 @@ class DisplayContent extends WindowContainer extends ConfigurationContainer< final WindowContainer p = getParent(); // Give the parent a chance to set properties. In hierarchy v1 we rely // on this to set full-screen dimensions on all our Surface-less Layers. - final SurfaceControl.Builder b = p.makeChildSurface(child); - if (child != null && child.isScreenOverlay()) { - // If it's a screen overlay it's been promoted in the hierarchy (wrt to the - // WindowContainer hierarchy vs the SurfaceControl hierarchy) - // and we shouldn't set ourselves as the parent. - return b; - } else { - return b.setParent(mSurfaceControl); - } - } - - /** - * There are various layers which require promotion from the WindowContainer - * hierarchy to the Overlay layer described in {@link DisplayContent}. See {@link WindowState} - * for the particular usage. - * - * TODO: Perhaps this should be eliminated, either through modifying - * the window container hierarchy or through modifying the way we express these overlay - * Surfaces (for example, the Magnification Overlay could be implemented like the Strict-mode - * Flash and not actually use a WindowState). - */ - boolean isScreenOverlay() { - return false; + return p.makeChildSurface(child) + .setParent(mSurfaceControl); } /** diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 90e9c230b5015..502fc127e0cf9 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -58,6 +58,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_MAGNIFICATION_OVERLAY; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; +import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; @@ -4346,26 +4347,18 @@ class WindowState extends WindowContainer implements WindowManagerP @Override boolean shouldMagnify() { if (mAttrs.type == TYPE_INPUT_METHOD || - mAttrs.type == TYPE_INPUT_METHOD_DIALOG) { - return false; - } else if (isScreenOverlay()) { + mAttrs.type == TYPE_INPUT_METHOD_DIALOG || + mAttrs.type == TYPE_MAGNIFICATION_OVERLAY || + mAttrs.type == TYPE_NAVIGATION_BAR || + // It's tempting to wonder: Have we forgotten the rounded corners overlay? + // worry not: it's a fake TYPE_NAVIGATION_BAR_PANEL + mAttrs.type == TYPE_NAVIGATION_BAR_PANEL || + mAttrs.type == TYPE_STATUS_BAR) { return false; } return true; } - @Override - boolean isScreenOverlay() { - // It's tempting to wonder: Have we forgotten the rounded corners overlay? - // worry not: it's a fake TYPE_NAVIGATION_BAR. - if (mAttrs.type == TYPE_MAGNIFICATION_OVERLAY || - mAttrs.type == TYPE_NAVIGATION_BAR || - mAttrs.type == TYPE_STATUS_BAR) { - return true; - } - return false; - } - @Override SurfaceSession getSession() { if (mSession.mSurfaceSession != null) { diff --git a/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java b/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java index f7c4b1f51c467..4e23b515eb4ba 100644 --- a/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java +++ b/services/tests/servicestests/src/com/android/server/wm/ZOrderingTests.java @@ -185,7 +185,6 @@ public class ZOrderingTests extends WindowTestsBase { // target. assertWindowLayerGreaterThan(mTransaction, mImeWindow, mChildAppWindowAbove); assertWindowLayerGreaterThan(mTransaction, mImeWindow, mAppWindow); - assertWindowLayerGreaterThan(mTransaction, mImeWindow, mDockedDividerWindow); assertWindowLayerGreaterThan(mTransaction, mNavBarWindow, mImeWindow); assertWindowLayerGreaterThan(mTransaction, mStatusBarWindow, mImeWindow);