/**
* Value to increment the z-layer when boosting a layer during animations. BOOST in l33tsp34k.
*/
- private static final int Z_BOOST_BASE = 800570000;
+ @VisibleForTesting static final int Z_BOOST_BASE = 800570000;
// Non-null only for application tokens.
final IApplicationToken appToken;
private boolean mFreezingScreen;
/** Whether this token should be boosted at the top of all app window tokens. */
- private boolean mNeedsZBoost;
+ @VisibleForTesting boolean mNeedsZBoost;
private Letterbox mLetterbox;
private final Point mTmpPoint = new Point();
if (mNeedsZBoost) {
layer += Z_BOOST_BASE;
}
- leash.setLayer(layer);
+ if (!mNeedsAnimationBoundsLayer) {
+ leash.setLayer(layer);
+ }
final DisplayContent dc = getDisplayContent();
dc.assignStackOrdering();
// Crop to stack bounds.
t.setWindowCrop(mAnimationBoundsLayer, mTmpRect);
+ t.setLayer(mAnimationBoundsLayer, layer);
// Reparent leash to animation bounds layer.
t.reparent(leash, mAnimationBoundsLayer);
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.intThat;
import android.platform.test.annotations.Presubmit;
import android.view.SurfaceControl;
}
@Test
+ public void clipAfterAnim_boundsLayerZBoosted() {
+ mToken.mNeedsAnimationBoundsLayer = true;
+ mToken.mNeedsZBoost = true;
+
+ mToken.mSurfaceAnimator.startAnimation(mTransaction, mSpec, true /* hidden */);
+ verify(mTransaction).setLayer(eq(mToken.mAnimationBoundsLayer),
+ intThat(layer -> layer >= AppWindowToken.Z_BOOST_BASE));
+ }
+
+ @Test
public void clipAfterAnim_boundsLayerIsDestroyed() {
mToken.mNeedsAnimationBoundsLayer = true;
mToken.mSurfaceAnimator.startAnimation(mTransaction, mSpec, true /* hidden */);