Loading services/core/java/com/android/server/wm/AppWindowToken.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -1660,6 +1660,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree true /* topToBottom */); true /* topToBottom */); } } SurfaceControl getAppAnimationLayer() { return getAppAnimationLayer(needsZBoost()); } @Override @Override public SurfaceControl getAnimationLeashParent() { public SurfaceControl getAnimationLeashParent() { // All normal app transitions take place in an animation layer which is below the pinned // All normal app transitions take place in an animation layer which is below the pinned Loading Loading @@ -1855,7 +1859,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree leash.setLayer(layer); leash.setLayer(layer); final DisplayContent dc = getDisplayContent(); final DisplayContent dc = getDisplayContent(); dc.assignStackOrdering(t); dc.assignStackOrdering(); if (mAnimatingAppWindowTokenRegistry != null) { if (mAnimatingAppWindowTokenRegistry != null) { mAnimatingAppWindowTokenRegistry.notifyStarting(this); mAnimatingAppWindowTokenRegistry.notifyStarting(this); } } Loading services/core/java/com/android/server/wm/DisplayContent.java +19 −4 Original line number Original line Diff line number Diff line Loading @@ -3180,6 +3180,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo * A control placed at the appropriate level for transitions to occur. * A control placed at the appropriate level for transitions to occur. */ */ SurfaceControl mAppAnimationLayer = null; SurfaceControl mAppAnimationLayer = null; SurfaceControl mBoostedAppAnimationLayer = null; /** /** * Given that the split-screen divider does not have an AppWindowToken, it * Given that the split-screen divider does not have an AppWindowToken, it Loading Loading @@ -3531,12 +3532,14 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } } void assignStackOrdering(SurfaceControl.Transaction t) { void assignStackOrdering(SurfaceControl.Transaction t) { final int HOME_STACK_STATE = 0; final int HOME_STACK_STATE = 0; final int NORMAL_STACK_STATE = 1; final int NORMAL_STACK_STATE = 1; final int ALWAYS_ON_TOP_STATE = 2; final int ALWAYS_ON_TOP_STATE = 2; int layer = 0; int layer = 0; int layerForAnimationLayer = 0; int layerForAnimationLayer = 0; int layerForBoostedAnimationLayer = 0; for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) { for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) { for (int i = 0; i < mChildren.size(); i++) { for (int i = 0; i < mChildren.size(); i++) { Loading @@ -3558,16 +3561,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // highest animating stack and no higher. // highest animating stack and no higher. layerForAnimationLayer = layer++; layerForAnimationLayer = layer++; } } if (state != ALWAYS_ON_TOP_STATE) { layerForBoostedAnimationLayer = layer++; } } } } } if (mAppAnimationLayer != null) { if (mAppAnimationLayer != null) { t.setLayer(mAppAnimationLayer, layerForAnimationLayer); t.setLayer(mAppAnimationLayer, layerForAnimationLayer); } } if (mBoostedAppAnimationLayer != null) { t.setLayer(mBoostedAppAnimationLayer, layerForBoostedAnimationLayer); } } } @Override @Override SurfaceControl getAppAnimationLayer() { SurfaceControl getAppAnimationLayer(boolean boosted) { return mAppAnimationLayer; return boosted ? mBoostedAppAnimationLayer : mAppAnimationLayer; } } SurfaceControl getSplitScreenDividerAnchor() { SurfaceControl getSplitScreenDividerAnchor() { Loading @@ -3581,16 +3590,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mAppAnimationLayer = makeChildSurface(null) mAppAnimationLayer = makeChildSurface(null) .setName("animationLayer") .setName("animationLayer") .build(); .build(); mBoostedAppAnimationLayer = makeChildSurface(null) .setName("boostedAnimationLayer") .build(); mSplitScreenDividerAnchor = makeChildSurface(null) mSplitScreenDividerAnchor = makeChildSurface(null) .setName("splitScreenDividerAnchor") .setName("splitScreenDividerAnchor") .build(); .build(); getPendingTransaction() getPendingTransaction() .show(mAppAnimationLayer) .show(mAppAnimationLayer) .show(mBoostedAppAnimationLayer) .show(mSplitScreenDividerAnchor); .show(mSplitScreenDividerAnchor); scheduleAnimation(); scheduleAnimation(); } else { } else { mAppAnimationLayer.destroy(); mAppAnimationLayer.destroy(); mAppAnimationLayer = null; mAppAnimationLayer = null; mBoostedAppAnimationLayer.destroy(); mBoostedAppAnimationLayer = null; mSplitScreenDividerAnchor.destroy(); mSplitScreenDividerAnchor.destroy(); mSplitScreenDividerAnchor = null; mSplitScreenDividerAnchor = null; } } Loading Loading @@ -3872,7 +3887,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo super.prepareSurfaces(); super.prepareSurfaces(); } } void assignStackOrdering(SurfaceControl.Transaction t) { void assignStackOrdering() { mTaskStackContainers.assignStackOrdering(t); mTaskStackContainers.assignStackOrdering(getPendingTransaction()); } } } } services/core/java/com/android/server/wm/WindowContainer.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -1125,12 +1125,15 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } } /** /** * @param boosted If true, returns an animation layer that happens above all {@link TaskStack}s * Otherwise, the layer will be positioned above all animating * {@link TaskStack}s. * @return The layer on which all app animations are happening. * @return The layer on which all app animations are happening. */ */ SurfaceControl getAppAnimationLayer() { SurfaceControl getAppAnimationLayer(boolean boosted) { final WindowContainer parent = getParent(); final WindowContainer parent = getParent(); if (parent != null) { if (parent != null) { return parent.getAppAnimationLayer(); return parent.getAppAnimationLayer(boosted); } } return null; return null; } } Loading Loading
services/core/java/com/android/server/wm/AppWindowToken.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -1660,6 +1660,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree true /* topToBottom */); true /* topToBottom */); } } SurfaceControl getAppAnimationLayer() { return getAppAnimationLayer(needsZBoost()); } @Override @Override public SurfaceControl getAnimationLeashParent() { public SurfaceControl getAnimationLeashParent() { // All normal app transitions take place in an animation layer which is below the pinned // All normal app transitions take place in an animation layer which is below the pinned Loading Loading @@ -1855,7 +1859,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree leash.setLayer(layer); leash.setLayer(layer); final DisplayContent dc = getDisplayContent(); final DisplayContent dc = getDisplayContent(); dc.assignStackOrdering(t); dc.assignStackOrdering(); if (mAnimatingAppWindowTokenRegistry != null) { if (mAnimatingAppWindowTokenRegistry != null) { mAnimatingAppWindowTokenRegistry.notifyStarting(this); mAnimatingAppWindowTokenRegistry.notifyStarting(this); } } Loading
services/core/java/com/android/server/wm/DisplayContent.java +19 −4 Original line number Original line Diff line number Diff line Loading @@ -3180,6 +3180,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo * A control placed at the appropriate level for transitions to occur. * A control placed at the appropriate level for transitions to occur. */ */ SurfaceControl mAppAnimationLayer = null; SurfaceControl mAppAnimationLayer = null; SurfaceControl mBoostedAppAnimationLayer = null; /** /** * Given that the split-screen divider does not have an AppWindowToken, it * Given that the split-screen divider does not have an AppWindowToken, it Loading Loading @@ -3531,12 +3532,14 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } } void assignStackOrdering(SurfaceControl.Transaction t) { void assignStackOrdering(SurfaceControl.Transaction t) { final int HOME_STACK_STATE = 0; final int HOME_STACK_STATE = 0; final int NORMAL_STACK_STATE = 1; final int NORMAL_STACK_STATE = 1; final int ALWAYS_ON_TOP_STATE = 2; final int ALWAYS_ON_TOP_STATE = 2; int layer = 0; int layer = 0; int layerForAnimationLayer = 0; int layerForAnimationLayer = 0; int layerForBoostedAnimationLayer = 0; for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) { for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) { for (int i = 0; i < mChildren.size(); i++) { for (int i = 0; i < mChildren.size(); i++) { Loading @@ -3558,16 +3561,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // highest animating stack and no higher. // highest animating stack and no higher. layerForAnimationLayer = layer++; layerForAnimationLayer = layer++; } } if (state != ALWAYS_ON_TOP_STATE) { layerForBoostedAnimationLayer = layer++; } } } } } if (mAppAnimationLayer != null) { if (mAppAnimationLayer != null) { t.setLayer(mAppAnimationLayer, layerForAnimationLayer); t.setLayer(mAppAnimationLayer, layerForAnimationLayer); } } if (mBoostedAppAnimationLayer != null) { t.setLayer(mBoostedAppAnimationLayer, layerForBoostedAnimationLayer); } } } @Override @Override SurfaceControl getAppAnimationLayer() { SurfaceControl getAppAnimationLayer(boolean boosted) { return mAppAnimationLayer; return boosted ? mBoostedAppAnimationLayer : mAppAnimationLayer; } } SurfaceControl getSplitScreenDividerAnchor() { SurfaceControl getSplitScreenDividerAnchor() { Loading @@ -3581,16 +3590,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mAppAnimationLayer = makeChildSurface(null) mAppAnimationLayer = makeChildSurface(null) .setName("animationLayer") .setName("animationLayer") .build(); .build(); mBoostedAppAnimationLayer = makeChildSurface(null) .setName("boostedAnimationLayer") .build(); mSplitScreenDividerAnchor = makeChildSurface(null) mSplitScreenDividerAnchor = makeChildSurface(null) .setName("splitScreenDividerAnchor") .setName("splitScreenDividerAnchor") .build(); .build(); getPendingTransaction() getPendingTransaction() .show(mAppAnimationLayer) .show(mAppAnimationLayer) .show(mBoostedAppAnimationLayer) .show(mSplitScreenDividerAnchor); .show(mSplitScreenDividerAnchor); scheduleAnimation(); scheduleAnimation(); } else { } else { mAppAnimationLayer.destroy(); mAppAnimationLayer.destroy(); mAppAnimationLayer = null; mAppAnimationLayer = null; mBoostedAppAnimationLayer.destroy(); mBoostedAppAnimationLayer = null; mSplitScreenDividerAnchor.destroy(); mSplitScreenDividerAnchor.destroy(); mSplitScreenDividerAnchor = null; mSplitScreenDividerAnchor = null; } } Loading Loading @@ -3872,7 +3887,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo super.prepareSurfaces(); super.prepareSurfaces(); } } void assignStackOrdering(SurfaceControl.Transaction t) { void assignStackOrdering() { mTaskStackContainers.assignStackOrdering(t); mTaskStackContainers.assignStackOrdering(getPendingTransaction()); } } } }
services/core/java/com/android/server/wm/WindowContainer.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -1125,12 +1125,15 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer< } } /** /** * @param boosted If true, returns an animation layer that happens above all {@link TaskStack}s * Otherwise, the layer will be positioned above all animating * {@link TaskStack}s. * @return The layer on which all app animations are happening. * @return The layer on which all app animations are happening. */ */ SurfaceControl getAppAnimationLayer() { SurfaceControl getAppAnimationLayer(boolean boosted) { final WindowContainer parent = getParent(); final WindowContainer parent = getParent(); if (parent != null) { if (parent != null) { return parent.getAppAnimationLayer(); return parent.getAppAnimationLayer(boosted); } } return null; return null; } } Loading