diff options
4 files changed, 15 insertions, 11 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java index e4ed06c9314a..d70857a4b221 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java @@ -308,9 +308,11 @@ public class WMShellModule { Transitions transitions, ShellTaskOrganizer shellTaskOrganizer, PipAnimationController pipAnimationController, PipBoundsAlgorithm pipBoundsAlgorithm, PipBoundsState pipBoundsState, PipTransitionState pipTransitionState, - PhonePipMenuController pipMenuController) { + PhonePipMenuController pipMenuController, + PipSurfaceTransactionHelper pipSurfaceTransactionHelper) { return new PipTransition(context, pipBoundsState, pipTransitionState, pipMenuController, - pipBoundsAlgorithm, pipAnimationController, transitions, shellTaskOrganizer); + pipBoundsAlgorithm, pipAnimationController, transitions, shellTaskOrganizer, + pipSurfaceTransactionHelper); } @WMSingleton diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java index b31e6e0750ce..0c443ce51116 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java @@ -62,6 +62,7 @@ public class PipTransition extends PipTransitionController { private final PipTransitionState mPipTransitionState; private final int mEnterExitAnimationDuration; + private final PipSurfaceTransactionHelper mSurfaceTransactionHelper; private @PipAnimationController.AnimationType int mOneShotAnimationType = ANIM_TYPE_BOUNDS; private Transitions.TransitionFinishCallback mFinishCallback; private Rect mExitDestinationBounds = new Rect(); @@ -74,12 +75,14 @@ public class PipTransition extends PipTransitionController { PipBoundsAlgorithm pipBoundsAlgorithm, PipAnimationController pipAnimationController, Transitions transitions, - @NonNull ShellTaskOrganizer shellTaskOrganizer) { + @NonNull ShellTaskOrganizer shellTaskOrganizer, + PipSurfaceTransactionHelper pipSurfaceTransactionHelper) { super(pipBoundsState, pipMenuController, pipBoundsAlgorithm, pipAnimationController, transitions, shellTaskOrganizer); mPipTransitionState = pipTransitionState; mEnterExitAnimationDuration = context.getResources() .getInteger(R.integer.config_pipResizeAnimationDuration); + mSurfaceTransactionHelper = pipSurfaceTransactionHelper; } @Override @@ -286,7 +289,10 @@ public class PipTransition extends PipTransitionController { final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds(); final Rect currentBounds = taskInfo.configuration.windowConfiguration.getBounds(); PipAnimationController.PipTransitionAnimator animator; - finishTransaction.setPosition(leash, destinationBounds.left, destinationBounds.top); + // Set corner radius for entering pip. + mSurfaceTransactionHelper + .crop(finishTransaction, leash, destinationBounds) + .round(finishTransaction, leash, true /* applyCornerRadius */); if (taskInfo.pictureInPictureParams != null && taskInfo.pictureInPictureParams.isAutoEnterEnabled() && mPipTransitionState.getInSwipePipToHomeTransition()) { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt index 16fc0489fbc8..59bbdfee1366 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt @@ -33,7 +33,6 @@ import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.statusBarLayerRotatesScales import com.android.wm.shell.flicker.helpers.FixedAppHelper import org.junit.Assume.assumeFalse -import org.junit.Before import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -84,12 +83,6 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) } } - @Before - fun onBefore() { - // This CUJ don't work in shell transitions because of b/204570898 b/204562589 b/206753786 - assumeFalse(isShellTransitionsEnabled) - } - /** * Checks that all parts of the screen are covered at the start and end of the transition */ @@ -128,6 +121,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) @Presubmit @Test fun appLayerRotates_EndingBounds() { + // This CUJ don't work in shell transitions because of b/204570898 b/204562589 b/206753786 + assumeFalse(isShellTransitionsEnabled) testSpec.assertLayersEnd { visibleRegion(fixedApp.component).coversExactly(screenBoundsEnd) } diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index c7c3bb6b31e2..c6948eee5a0c 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -368,6 +368,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe t.setPosition(targetLeash, tmpPos.x, tmpPos.y); t.setCornerRadius(targetLeash, 0); t.setShadowRadius(targetLeash, 0); + t.setMatrix(targetLeash, 1, 0, 0, 1); // The bounds sent to the transition is always a real bounds. This means we lose // information about "null" bounds (inheriting from parent). Core will fix-up // non-organized window surface bounds; however, since Core can't touch organized |