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

Commit a9cbae83 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Use the result of config diff to check display change

Non-default display may not increase the seq even if it is changed.
While default display is no problem because it is global config.

Bug: 313910429
Test: atest DisplayContentTests#testShellTransitRotation

Change-Id: Ieb8278c165646cfcd871bd9c14be0009b444107a
parent bdd1caeb
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1636,12 +1636,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        mWmService.mWindowPlacerLocked.performSurfacePlacement();
    }

    void sendNewConfiguration() {
    /** Returns {@code true} if the display configuration is changed. */
    boolean sendNewConfiguration() {
        if (!isReady()) {
            return;
            return false;
        }
        if (mRemoteDisplayChangeController.isWaitingForRemoteDisplayChange()) {
            return;
            return false;
        }

        final Transition.ReadyCondition displayConfig = mTransitionController.isCollecting()
@@ -1656,7 +1657,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            displayConfig.meet();
        }
        if (configUpdated) {
            return;
            return true;
        }

        // The display configuration doesn't change. If there is a launching transformed app, that
@@ -1674,6 +1675,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            setLayoutNeeded();
            mWmService.mWindowPlacerLocked.performSurfacePlacement();
        }
        return false;
    }

    @Override
+2 −3
Original line number Diff line number Diff line
@@ -2868,8 +2868,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            final WindowContainer<?> wc = mParticipants.valueAt(i);
            final DisplayContent dc = wc.asDisplayContent();
            if (dc == null || !mChanges.get(dc).hasChanged()) continue;
            final int originalSeq = dc.getConfiguration().seq;
            dc.sendNewConfiguration();
            final boolean changed = dc.sendNewConfiguration();
            // Set to ready if no other change controls the ready state. But if there is, such as
            // if an activity is pausing, it will call setReady(ar, false) and wait for the next
            // resumed activity. Then do not set to ready because the transition only contains
@@ -2877,7 +2876,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            if (!mReadyTrackerOld.mUsed) {
                setReady(dc, true);
            }
            if (originalSeq == dc.getConfiguration().seq) continue;
            if (!changed) continue;
            // If the update is deferred, sendNewConfiguration won't deliver new configuration to
            // clients, then it is the caller's responsibility to deliver the changes.
            if (mController.mAtm.mTaskSupervisor.isRootVisibilityUpdateDeferred()) {