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

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

Merge "Run surface placement at the end of display change" into main

parents 2b870922 5dd47d95
Loading
Loading
Loading
Loading
+19 −12
Original line number Diff line number Diff line
@@ -173,6 +173,8 @@ public class DeferredDisplayUpdater implements DisplayUpdater {
                    mDisplayContent.mInitialDisplayHeight);
            final int fromRotation = mDisplayContent.getRotation();

            mDisplayContent.mAtmService.deferWindowLayout();
            try {
                onStartCollect.run();

                ProtoLog.d(WM_DEBUG_WINDOW_TRANSITIONS,
@@ -186,6 +188,11 @@ public class DeferredDisplayUpdater implements DisplayUpdater {
                    mDisplayContent.mTransitionController.requestStartTransition(transition,
                            /* startTask= */ null, /* remoteTransition= */ null, displayChange);
                }
            } finally {
                // Run surface placement after requestStartTransition, so shell side can receive
                // the transition request before handling task info changes.
                mDisplayContent.mAtmService.continueWindowLayout();
            }
        });
    }

+6 −1
Original line number Diff line number Diff line
@@ -6210,7 +6210,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     * @param onDisplayChangeApplied callback that is called when the changes are applied
     */
    void requestDisplayUpdate(@NonNull Runnable onDisplayChangeApplied) {
        mAtmService.deferWindowLayout();
        try {
            mDisplayUpdater.updateDisplayInfo(onDisplayChangeApplied);
        } finally {
            mAtmService.continueWindowLayout();
        }
    }

    void onDisplayInfoUpdated(@NonNull DisplayInfo newDisplayInfo) {