Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b16e39c1 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Finish fixed rotation of transient launch with corner cases" into...

Merge "Finish fixed rotation of transient launch with corner cases" into udc-qpr-dev am: 9f19dfb2 am: 3c8c3857

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24574507



Change-Id: I6234ed645819cbeb68d1c13fc588be810cf2bc3a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e43225d4 3c8c3857
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1127,6 +1127,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                        // though, notify the controller to prevent degenerate cases.
                        if (!r.isVisibleRequested()) {
                            mController.mValidateCommitVis.add(r);
                        } else {
                            // Make sure onAppTransitionFinished can be notified.
                            mParticipants.add(r);
                        }
                        return;
                    }
+2 −1
Original line number Diff line number Diff line
@@ -519,7 +519,8 @@ class WindowToken extends WindowContainer<WindowState> {
        for (int i = mFixedRotationTransformState.mAssociatedTokens.size() - 1; i >= 0; i--) {
            final ActivityRecord r =
                    mFixedRotationTransformState.mAssociatedTokens.get(i).asActivityRecord();
            if (r != null && r.isInTransition()) {
            // Only care about the transition at Activity/Task level.
            if (r != null && r.inTransitionSelfOrParent() && !r.mDisplayContent.inTransition()) {
                return true;
            }
        }
+5 −2
Original line number Diff line number Diff line
@@ -1698,14 +1698,17 @@ public class DisplayContentTests extends WindowTestsBase {
        final Task task = app.getTask();
        final ActivityRecord app2 = new ActivityBuilder(mWm.mAtmService).setTask(task).build();
        mDisplayContent.setFixedRotationLaunchingApp(app2, (mDisplayContent.getRotation() + 1) % 4);
        doReturn(true).when(app).isInTransition();
        doReturn(true).when(app).inTransitionSelfOrParent();
        // If the task contains a transition, this should be no-op.
        mDisplayContent.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(app.token);

        assertTrue(app2.hasFixedRotationTransform());
        assertTrue(mDisplayContent.hasTopFixedRotationLaunchingApp());

        doReturn(false).when(app).isInTransition();
        // The display should be unlikely to be in transition, but if it happens, the fixed
        // rotation should proceed to finish because the activity/task level transition is finished.
        doReturn(true).when(mDisplayContent).inTransition();
        doReturn(false).when(app).inTransitionSelfOrParent();
        // Although this notifies app instead of app2 that uses the fixed rotation, app2 should
        // still finish the transform because there is no more transition event.
        mDisplayContent.mFixedRotationTransitionListener.onAppTransitionFinishedLocked(app.token);