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

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

Merge "Ensure transition is ready after applying display change"

parents 288f1363 85afcfa5
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -2010,17 +2010,15 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        return mainWin.getAttrs().rotationAnimation;
    }

    /** Applies the new configuration and returns {@code true} if there is a display change. */
    boolean applyDisplayChangeIfNeeded() {
        boolean changed = false;
    /** Applies the new configuration for the changed displays. */
    void applyDisplayChangeIfNeeded() {
        for (int i = mParticipants.size() - 1; i >= 0; --i) {
            final WindowContainer<?> wc = mParticipants.valueAt(i);
            final DisplayContent dc = wc.asDisplayContent();
            if (dc == null || !mChanges.get(dc).hasChanged()) continue;
            dc.sendNewConfiguration();
            changed = true;
            setReady(dc, true);
        }
        return changed;
    }

    boolean getLegacyIsReady() {
+2 −2
Original line number Diff line number Diff line
@@ -494,8 +494,8 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
        mService.deferWindowLayout();
        mService.mTaskSupervisor.setDeferRootVisibilityUpdate(true /* deferUpdate */);
        try {
            if (transition != null && transition.applyDisplayChangeIfNeeded()) {
                effects |= TRANSACT_EFFECTS_LIFECYCLE;
            if (transition != null) {
                transition.applyDisplayChangeIfNeeded();
            }
            final List<WindowContainerTransaction.HierarchyOp> hops = t.getHierarchyOps();
            final int hopSize = hops.size();
+2 −2
Original line number Diff line number Diff line
@@ -2020,13 +2020,13 @@ public class DisplayContentTests extends WindowTestsBase {
        assertEquals(origRot, dc.getConfiguration().windowConfiguration.getRotation());

        // Once transition starts, rotation is applied and transition shows DC rotating.
        testPlayer.start();
        testPlayer.startTransition();
        assertNotEquals(origRot, dc.getConfiguration().windowConfiguration.getRotation());
        assertNotNull(testPlayer.mLastReady);
        assertTrue(testPlayer.mController.isPlaying());
        WindowContainerToken dcToken = dc.mRemoteToken.toWindowContainerToken();
        assertNotEquals(testPlayer.mLastReady.getChange(dcToken).getEndRotation(),
                testPlayer.mLastReady.getChange(dcToken).getStartRotation());
        assertTrue(testPlayer.mLastTransit.applyDisplayChangeIfNeeded());
        testPlayer.finish();
    }