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

Commit 9f19dfb2 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Finish fixed rotation of transient launch with corner cases" into udc-qpr-dev

parents ad868488 dc6ca23b
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
@@ -1703,14 +1703,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);