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

Commit 7ba9aebc authored by Massimo Carli's avatar Massimo Carli
Browse files

[1/n] Skip letterboxing for unrelated startingWindow

Added to prevent letterbox surface updates from being applied
to the activity's main window prematurely, while a different starting window
is still active. This ensures letterboxing is correctly managed
for the currently displayed (or soon-to-be displayed) target window.

Flag: com.android.window.flags.app_compat_refactoring_skip_starting_window_letterbox
Bug: 432347028
Test: atest WmTests:AppCompatLetterboxPolicyTest

Change-Id: I910ef122036734fab9a95c68f073f6b3ee47a2dd
parent 81f4c051
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -180,6 +180,12 @@ class AppCompatLetterboxPolicy {
    }

    void updateLetterboxSurfaceIfNeeded(@NonNull WindowState winHint) {
        // If a starting window is active, only apply updates to that specific window.
        if (Flags.appCompatRefactoringSkipStartingWindowLetterbox()
                && mActivityRecord.mStartingWindow != null
                && mActivityRecord.mStartingWindow != winHint) {
            return;
        }
        mLetterboxPolicyState.updateLetterboxSurfaceIfNeeded(winHint,
                mActivityRecord.getSyncTransaction(), mActivityRecord.getPendingTransaction());
    }