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
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 473eeda..03b733c 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 @@
                     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 @@
             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;