Loading services/core/java/com/android/server/wm/AppWindowToken.java +6 −3 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree /** * 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; Loading Loading @@ -291,7 +291,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree 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(); Loading Loading @@ -2693,7 +2693,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (mNeedsZBoost) { layer += Z_BOOST_BASE; } if (!mNeedsAnimationBoundsLayer) { leash.setLayer(layer); } final DisplayContent dc = getDisplayContent(); dc.assignStackOrdering(); Loading Loading @@ -2730,6 +2732,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // Crop to stack bounds. t.setWindowCrop(mAnimationBoundsLayer, mTmpRect); t.setLayer(mAnimationBoundsLayer, layer); // Reparent leash to animation bounds layer. t.reparent(leash, mAnimationBoundsLayer); Loading services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java +11 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.google.common.truth.Truth.assertThat; 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; Loading Loading @@ -74,6 +75,16 @@ public class AppWindowTokenAnimationTests extends WindowTestsBase { eq(mToken.mAnimationBoundsLayer)); } @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; Loading Loading
services/core/java/com/android/server/wm/AppWindowToken.java +6 −3 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree /** * 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; Loading Loading @@ -291,7 +291,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree 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(); Loading Loading @@ -2693,7 +2693,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (mNeedsZBoost) { layer += Z_BOOST_BASE; } if (!mNeedsAnimationBoundsLayer) { leash.setLayer(layer); } final DisplayContent dc = getDisplayContent(); dc.assignStackOrdering(); Loading Loading @@ -2730,6 +2732,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // Crop to stack bounds. t.setWindowCrop(mAnimationBoundsLayer, mTmpRect); t.setLayer(mAnimationBoundsLayer, layer); // Reparent leash to animation bounds layer. t.reparent(leash, mAnimationBoundsLayer); Loading
services/tests/wmtests/src/com/android/server/wm/AppWindowTokenAnimationTests.java +11 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.google.common.truth.Truth.assertThat; 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; Loading Loading @@ -74,6 +75,16 @@ public class AppWindowTokenAnimationTests extends WindowTestsBase { eq(mToken.mAnimationBoundsLayer)); } @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; Loading