*/
SurfaceControl mAppAnimationLayer = null;
SurfaceControl mBoostedAppAnimationLayer = null;
+ SurfaceControl mHomeAppAnimationLayer = null;
/**
* Given that the split-screen divider does not have an AppWindowToken, it
int layer = 0;
int layerForAnimationLayer = 0;
int layerForBoostedAnimationLayer = 0;
+ int layerForHomeAnimationLayer = 0;
for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) {
for (int i = 0; i < mChildren.size(); i++) {
layerForBoostedAnimationLayer = layer++;
}
}
+ if (state == HOME_STACK_STATE) {
+ layerForHomeAnimationLayer = layer++;
+ }
}
if (mAppAnimationLayer != null) {
t.setLayer(mAppAnimationLayer, layerForAnimationLayer);
if (mBoostedAppAnimationLayer != null) {
t.setLayer(mBoostedAppAnimationLayer, layerForBoostedAnimationLayer);
}
+ if (mHomeAppAnimationLayer != null) {
+ t.setLayer(mHomeAppAnimationLayer, layerForHomeAnimationLayer);
+ }
}
@Override
- SurfaceControl getAppAnimationLayer(boolean boosted) {
- return boosted ? mBoostedAppAnimationLayer : mAppAnimationLayer;
+ SurfaceControl getAppAnimationLayer(@AnimationLayer int animationLayer) {
+ switch (animationLayer) {
+ case ANIMATION_LAYER_BOOSTED:
+ return mBoostedAppAnimationLayer;
+ case ANIMATION_LAYER_HOME:
+ return mHomeAppAnimationLayer;
+ case ANIMATION_LAYER_STANDARD:
+ default:
+ return mAppAnimationLayer;
+ }
}
SurfaceControl getSplitScreenDividerAnchor() {
mBoostedAppAnimationLayer = makeChildSurface(null)
.setName("boostedAnimationLayer")
.build();
+ mHomeAppAnimationLayer = makeChildSurface(null)
+ .setName("homeAnimationLayer")
+ .build();
mSplitScreenDividerAnchor = makeChildSurface(null)
.setName("splitScreenDividerAnchor")
.build();
getPendingTransaction()
.show(mAppAnimationLayer)
.show(mBoostedAppAnimationLayer)
+ .show(mHomeAppAnimationLayer)
.show(mSplitScreenDividerAnchor);
scheduleAnimation();
} else {
mAppAnimationLayer = null;
mBoostedAppAnimationLayer.destroy();
mBoostedAppAnimationLayer = null;
+ mHomeAppAnimationLayer.destroy();
+ mHomeAppAnimationLayer = null;
mSplitScreenDividerAnchor.destroy();
mSplitScreenDividerAnchor = null;
}
import static com.android.server.wm.WindowContainerProto.VISIBLE;
import android.annotation.CallSuper;
+import android.annotation.IntDef;
+import android.app.WindowConfiguration;
import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Rect;
private static final String TAG = TAG_WITH_CLASS_NAME ? "WindowContainer" : TAG_WM;
+ /** Animation layer that happens above all animating {@link TaskStack}s. */
+ static final int ANIMATION_LAYER_STANDARD = 0;
+
+ /** Animation layer that happens above all {@link TaskStack}s. */
+ static final int ANIMATION_LAYER_BOOSTED = 1;
+
+ /**
+ * Animation layer that is reserved for {@link WindowConfiguration#ACTIVITY_TYPE_HOME}
+ * activities that happens below all {@link TaskStack}s.
+ */
+ static final int ANIMATION_LAYER_HOME = 2;
+
+ @IntDef(prefix = { "ANIMATION_LAYER_" }, value = {
+ ANIMATION_LAYER_STANDARD,
+ ANIMATION_LAYER_BOOSTED,
+ ANIMATION_LAYER_HOME,
+ })
+ @interface AnimationLayer {}
+
static final int POSITION_TOP = Integer.MAX_VALUE;
static final int POSITION_BOTTOM = Integer.MIN_VALUE;
}
/**
- * @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.
*/
- SurfaceControl getAppAnimationLayer(boolean boosted) {
+ SurfaceControl getAppAnimationLayer(@AnimationLayer int animationLayer) {
final WindowContainer parent = getParent();
if (parent != null) {
- return parent.getAppAnimationLayer(boosted);
+ return parent.getAppAnimationLayer(animationLayer);
}
return null;
}