Loading services/core/java/com/android/server/wm/DisplayContent.java +7 −1 Original line number Diff line number Diff line Loading @@ -1424,7 +1424,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mWaitingForConfig = true; if (mTransitionController.isShellTransitionsEnabled()) { requestChangeTransitionIfNeeded(changes, null /* displayChange */); } else { } else if (mLastHasContent) { mWmService.startFreezingDisplay(0 /* exitAnim */, 0 /* enterAnim */, this); } sendNewConfiguration(); Loading Loading @@ -3220,6 +3220,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp */ void requestChangeTransitionIfNeeded(@ActivityInfo.Config int changes, @Nullable TransitionRequestInfo.DisplayChange displayChange) { if (!mLastHasContent) return; final TransitionController controller = mTransitionController; if (controller.isCollecting()) { if (displayChange != null) { Loading Loading @@ -5088,6 +5089,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return mLastHasContent; } @VisibleForTesting void setLastHasContent() { mLastHasContent = true; } void registerPointerEventListener(@NonNull PointerEventListener listener) { mPointerEventDispatcher.registerInputEventListener(listener); } Loading services/core/java/com/android/server/wm/FadeRotationAnimationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -256,7 +256,7 @@ public class FadeRotationAnimationController extends FadeAnimationController { false /* applyFixedTransformationHint */); for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) { final SurfaceControl leash = mTargetWindowTokens.valueAt(i); if (leash != null) { if (leash != null && leash.isValid()) { rotator.applyTransform(t, leash); } } Loading @@ -265,7 +265,7 @@ public class FadeRotationAnimationController extends FadeAnimationController { // Hide the windows immediately because a screenshot layer should cover the screen. for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) { final SurfaceControl leash = mTargetWindowTokens.valueAt(i); if (leash != null) { if (leash != null && leash.isValid()) { t.setAlpha(leash, 0f); } } Loading services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -1718,6 +1718,7 @@ public class DisplayContentTests extends WindowTestsBase { @Test public void testShellTransitRotation() { DisplayContent dc = createNewDisplay(); dc.setLastHasContent(); final TestTransitionPlayer testPlayer = registerTestTransitionPlayer(); final DisplayRotation dr = dc.getDisplayRotation(); Loading services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +5 −1 Original line number Diff line number Diff line Loading @@ -488,6 +488,7 @@ public class TransitionTests extends WindowTestsBase { final TestTransitionPlayer player = registerTestTransitionPlayer(); mDisplayContent.getDisplayRotation().setRotation(mDisplayContent.getRotation() + 1); mDisplayContent.setLastHasContent(); mDisplayContent.requestChangeTransitionIfNeeded(1 /* any changes */, null /* displayChange */); final FadeRotationAnimationController fadeController = Loading Loading @@ -536,6 +537,7 @@ public class TransitionTests extends WindowTestsBase { null /* remoteTransition */, null /* displayChange */); mDisplayContent.getDisplayRotation().setRotation(mDisplayContent.getRotation() + 1); final int anyChanges = 1; mDisplayContent.setLastHasContent(); mDisplayContent.requestChangeTransitionIfNeeded(anyChanges, null /* displayChange */); transition.setKnownConfigChanges(mDisplayContent, anyChanges); final FadeRotationAnimationController fadeController = Loading @@ -550,9 +552,11 @@ public class TransitionTests extends WindowTestsBase { assertTrue(app.getTask().inTransition()); final SurfaceControl.Transaction startTransaction = mock(SurfaceControl.Transaction.class); final SurfaceControl leash = statusBar.mToken.getAnimationLeash(); doReturn(true).when(leash).isValid(); player.onTransactionReady(startTransaction); // The leash should be unrotated. verify(startTransaction).setMatrix(eq(statusBar.mToken.getAnimationLeash()), any(), any()); verify(startTransaction).setMatrix(eq(leash), any(), any()); // The redrawn window will be faded in when the transition finishes. And because this test // only use one non-activity window, the fade rotation controller should also be cleared. Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +7 −1 Original line number Diff line number Diff line Loading @@ -1424,7 +1424,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mWaitingForConfig = true; if (mTransitionController.isShellTransitionsEnabled()) { requestChangeTransitionIfNeeded(changes, null /* displayChange */); } else { } else if (mLastHasContent) { mWmService.startFreezingDisplay(0 /* exitAnim */, 0 /* enterAnim */, this); } sendNewConfiguration(); Loading Loading @@ -3220,6 +3220,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp */ void requestChangeTransitionIfNeeded(@ActivityInfo.Config int changes, @Nullable TransitionRequestInfo.DisplayChange displayChange) { if (!mLastHasContent) return; final TransitionController controller = mTransitionController; if (controller.isCollecting()) { if (displayChange != null) { Loading Loading @@ -5088,6 +5089,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return mLastHasContent; } @VisibleForTesting void setLastHasContent() { mLastHasContent = true; } void registerPointerEventListener(@NonNull PointerEventListener listener) { mPointerEventDispatcher.registerInputEventListener(listener); } Loading
services/core/java/com/android/server/wm/FadeRotationAnimationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -256,7 +256,7 @@ public class FadeRotationAnimationController extends FadeAnimationController { false /* applyFixedTransformationHint */); for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) { final SurfaceControl leash = mTargetWindowTokens.valueAt(i); if (leash != null) { if (leash != null && leash.isValid()) { rotator.applyTransform(t, leash); } } Loading @@ -265,7 +265,7 @@ public class FadeRotationAnimationController extends FadeAnimationController { // Hide the windows immediately because a screenshot layer should cover the screen. for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) { final SurfaceControl leash = mTargetWindowTokens.valueAt(i); if (leash != null) { if (leash != null && leash.isValid()) { t.setAlpha(leash, 0f); } } Loading
services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -1718,6 +1718,7 @@ public class DisplayContentTests extends WindowTestsBase { @Test public void testShellTransitRotation() { DisplayContent dc = createNewDisplay(); dc.setLastHasContent(); final TestTransitionPlayer testPlayer = registerTestTransitionPlayer(); final DisplayRotation dr = dc.getDisplayRotation(); Loading
services/tests/wmtests/src/com/android/server/wm/TransitionTests.java +5 −1 Original line number Diff line number Diff line Loading @@ -488,6 +488,7 @@ public class TransitionTests extends WindowTestsBase { final TestTransitionPlayer player = registerTestTransitionPlayer(); mDisplayContent.getDisplayRotation().setRotation(mDisplayContent.getRotation() + 1); mDisplayContent.setLastHasContent(); mDisplayContent.requestChangeTransitionIfNeeded(1 /* any changes */, null /* displayChange */); final FadeRotationAnimationController fadeController = Loading Loading @@ -536,6 +537,7 @@ public class TransitionTests extends WindowTestsBase { null /* remoteTransition */, null /* displayChange */); mDisplayContent.getDisplayRotation().setRotation(mDisplayContent.getRotation() + 1); final int anyChanges = 1; mDisplayContent.setLastHasContent(); mDisplayContent.requestChangeTransitionIfNeeded(anyChanges, null /* displayChange */); transition.setKnownConfigChanges(mDisplayContent, anyChanges); final FadeRotationAnimationController fadeController = Loading @@ -550,9 +552,11 @@ public class TransitionTests extends WindowTestsBase { assertTrue(app.getTask().inTransition()); final SurfaceControl.Transaction startTransaction = mock(SurfaceControl.Transaction.class); final SurfaceControl leash = statusBar.mToken.getAnimationLeash(); doReturn(true).when(leash).isValid(); player.onTransactionReady(startTransaction); // The leash should be unrotated. verify(startTransaction).setMatrix(eq(statusBar.mToken.getAnimationLeash()), any(), any()); verify(startTransaction).setMatrix(eq(leash), any(), any()); // The redrawn window will be faded in when the transition finishes. And because this test // only use one non-activity window, the fade rotation controller should also be cleared. Loading