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

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

Merge "Use the result of config diff to check display change" into main

parents 90471152 a9cbae83
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1649,12 +1649,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()
@@ -1669,7 +1670,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
@@ -1687,6 +1688,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()) {