Fix issues with z-ordering during animations

- Make sure to use DC pending transaction when updating z-layers,
as it could lead to reordering of z-order assignment due to how
we apply pending transactions in the hierarchy

- Create a separate boosted animation layer in which AWT with
zOrder=top animate, which happens above all stack. This brings
back the boosting logic in O without boosting non-boosted stack
above non-animating tokens

Bug: 70730519
Bug: 72649981
Bug: 72686618
Bug: 37953606
Test: Share link from Chrome to Clipboard, make sure disappear
animation happens properly
Test: go/wm-smoke
Change-Id: I3957daac76b991402bf3f520c4a3d3f519933f72
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 85436da..56c9e51 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1660,6 +1660,10 @@
                 true /* topToBottom */);
     }
 
+    SurfaceControl getAppAnimationLayer() {
+        return getAppAnimationLayer(needsZBoost());
+    }
+
     @Override
     public SurfaceControl getAnimationLeashParent() {
         // All normal app transitions take place in an animation layer which is below the pinned
@@ -1855,7 +1859,7 @@
         leash.setLayer(layer);
 
         final DisplayContent dc = getDisplayContent();
-        dc.assignStackOrdering(t);
+        dc.assignStackOrdering();
         if (mAnimatingAppWindowTokenRegistry != null) {
             mAnimatingAppWindowTokenRegistry.notifyStarting(this);
         }