Merge "Fix letterbox flickering rounded corners." into tm-dev
diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java
index 8866343..0038c71 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 @@
             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) {