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

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

Merge "Fix flickering of screen resolution change with deferred updater" into main

parents a7cbeee8 cac4879c
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -183,9 +183,6 @@ public class DeferredDisplayUpdater implements DisplayUpdater {
                        getCurrentDisplayChange(fromRotation, startBounds);
                mDisplayContent.mTransitionController.requestStartTransition(transition,
                        /* startTask= */ null, /* remoteTransition= */ null, displayChange);
                mDisplayContent.mTransitionController.setDisplaySyncMethod(displayChange,
                        mDisplayContent);
                transition.setAllReady();
            }
        });
    }
+11 −4
Original line number Diff line number Diff line
@@ -1634,12 +1634,19 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        if (configChanged) {
            mWaitingForConfig = true;
            if (mTransitionController.isShellTransitionsEnabled()) {
                final TransitionRequestInfo.DisplayChange change =
                        mTransitionController.isCollecting()
                final Rect startBounds = currentDisplayConfig.windowConfiguration.getBounds();
                final Rect endBounds = mTmpConfiguration.windowConfiguration.getBounds();
                final Transition transition = mTransitionController.getCollectingTransition();
                final TransitionRequestInfo.DisplayChange change = transition != null
                                ? null : new TransitionRequestInfo.DisplayChange(mDisplayId);
                if (change != null) {
                    change.setStartAbsBounds(currentDisplayConfig.windowConfiguration.getBounds());
                    change.setEndAbsBounds(mTmpConfiguration.windowConfiguration.getBounds());
                    change.setStartAbsBounds(startBounds);
                    change.setEndAbsBounds(endBounds);
                } else {
                    transition.setKnownConfigChanges(this, changes);
                    // A collecting transition is existed. The sync method must be set before
                    // collecting this display, so WindowState#prepareSync can use the sync method.
                    mTransitionController.setDisplaySyncMethod(startBounds, endBounds, this);
                }
                requestChangeTransitionIfNeeded(changes, change);
            } else if (mLastHasContent) {
+6 −1
Original line number Diff line number Diff line
@@ -640,11 +640,16 @@ class TransitionController {
    }

    /** Sets the sync method for the display change. */
    void setDisplaySyncMethod(@NonNull TransitionRequestInfo.DisplayChange displayChange,
    private void setDisplaySyncMethod(@NonNull TransitionRequestInfo.DisplayChange displayChange,
            @NonNull DisplayContent displayContent) {
        final Rect startBounds = displayChange.getStartAbsBounds();
        final Rect endBounds = displayChange.getEndAbsBounds();
        if (startBounds == null || endBounds == null) return;
        setDisplaySyncMethod(startBounds, endBounds, displayContent);
    }

    void setDisplaySyncMethod(@NonNull Rect startBounds, @NonNull Rect endBounds,
            @NonNull DisplayContent displayContent) {
        final int startWidth = startBounds.width();
        final int startHeight = startBounds.height();
        final int endWidth = endBounds.width();