From 747597a0881559501f6ebfe3be54a2dea747a38c Mon Sep 17 00:00:00 2001 From: tomnatan Date: Thu, 17 Mar 2022 13:08:16 +0000 Subject: [PATCH] Fix letterbox flickering rounded corners. This is done by also applying rounded corners for the main window that isn't application-starting, if there is one. Test: manually Fix: 218514243 Change-Id: If9239a80c24b767361971f35303381238826b5e2 --- .../java/com/android/server/wm/LetterboxUiController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java index 8866343afe030..0038c716fee76 100644 --- a/services/core/java/com/android/server/wm/LetterboxUiController.java +++ b/services/core/java/com/android/server/wm/LetterboxUiController.java @@ -145,6 +145,14 @@ final class LetterboxUiController { return; } updateRoundedCorners(w); + // If there is another main window that is not an application-starting window, we should + // update rounded corners for it as well, to avoid flickering rounded corners. + final WindowState nonStartingAppW = mActivityRecord.findMainWindow( + /* includeStartingApp= */ false); + if (nonStartingAppW != null && nonStartingAppW != w) { + updateRoundedCorners(nonStartingAppW); + } + updateWallpaperForLetterbox(w); if (shouldShowLetterboxUi(w)) { if (mLetterbox == null) {