diff options
| author | 2018-02-13 13:54:00 -0800 | |
|---|---|---|
| committer | 2018-02-26 14:27:06 -0800 | |
| commit | b950603470a4a174000b75975c25e0c6072dc3d2 (patch) | |
| tree | 2232b45944aeaa1174846b889d7a0d2871ba213b | |
| parent | 29f1cdd5d3acc79a787e372cac02f7e216ea033e (diff) | |
Picture in picture Z ordering fixes.
We fix two seperate issues here related to animation of the pip menu
activity within the stack. The first is that it may trigger an unexpected
call to assignChildLayers on aboveAppWindowContainers. assignChildLayers
was not overriden as it was assumed DisplayContent was the only caller.
This was causing the default implementation from WindowContainer to be called
and the docked divider to be assigned the wrong layer. We fix
this by adding an override that forwards to the correct implementation.
The second issue is we need to be more careful when placing the animation layer
above the highest animating stack. The pinned stack may be animating due to the
menu activity.
Bug: 69553456
Change-Id: I1a2205925a2f7e4d20a9dbb23b8aedd511d411cc
| -rw-r--r-- | services/core/java/com/android/server/wm/AppWindowToken.java | 22 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 7 |
2 files changed, 25 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index 8155656cd5f4..75ac70728b5f 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -1618,7 +1618,15 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree @Override public SurfaceControl getAnimationLeashParent() { - return getAppAnimationLayer(); + // All normal app transitions take place in an animation layer which is below the pinned + // stack but may be above the parent stacks of the given animating apps. + // For transitions in the pinned stack (menu activity) we just let them occur as a child + // of the pinned stack. + if (!inPinnedWindowingMode()) { + return getAppAnimationLayer(); + } else { + return getStack().getSurfaceControl(); + } } boolean applyAnimationLocked(WindowManager.LayoutParams lp, int transit, boolean enter, @@ -1758,10 +1766,18 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree @Override public void onAnimationLeashCreated(Transaction t, SurfaceControl leash) { - // The leash is parented to the animation layer. We need to preserve the z-order by using // the prefix order index, but we boost if necessary. - int layer = getPrefixOrderIndex(); + int layer = 0; + if (!inPinnedWindowingMode()) { + layer = getPrefixOrderIndex(); + } else { + // Pinned stacks have animations take place within themselves rather than an animation + // layer so we need to preserve the order relative to the stack (e.g. the order of our + // task/parent). + layer = getParent().getPrefixOrderIndex(); + } + if (mNeedsZBoost) { layer += Z_BOOST_BASE; } diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 473eeda57fde..03b733cfaa8f 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -3577,7 +3577,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo if (s.inSplitScreenWindowingMode() && mSplitScreenDividerAnchor != null) { t.setLayer(mSplitScreenDividerAnchor, layer++); } - if (s.isSelfOrChildAnimating()) { + if (s.isAppAnimating() && state != ALWAYS_ON_TOP_STATE) { // Ensure the animation layer ends up above the // highest animating stack and no higher. layerForAnimationLayer = layer++; @@ -3626,6 +3626,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo super(name, service); } + @Override + void assignChildLayers(SurfaceControl.Transaction t) { + assignChildLayers(t, null /* imeContainer */); + } + void assignChildLayers(SurfaceControl.Transaction t, WindowContainer imeContainer) { boolean needAssignIme = imeContainer != null && imeContainer.getSurfaceControl() != null; |