From 8ed36835c184aa5a3bc979c472be27b2f2e022b2 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Wed, 31 May 2023 16:06:49 -0700 Subject: [PATCH] Do not letterbox the activity in PiP mode There are chances that a Letterbox is added to the Task entering PiP mode, simply ignore such request. Video: http://recall/-/aaaaaabFQoRHlzixHdtY/dPygRdWjyGltlCmQU0TPZn Bug: 283008030 Test: Follow the reproduce steps in bug, see video Change-Id: I83c5d32ef7cff4b3b6c85a698d068935c83c9423 --- services/core/java/com/android/server/wm/WindowState.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 7cd7f6975bbdd..8f49384f6101c 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -3883,13 +3883,15 @@ class WindowState extends WindowContainer implements WindowManagerP } /** - * @return true if activity bounds are letterboxed or letterboxed for diplay cutout. + * @return {@code true} if activity bounds are letterboxed or letterboxed for display cutout. + * Note that it's always {@code false} if the activity is in pip mode. * *

Note that letterbox UI may not be shown even when this returns {@code true}. See {@link * LetterboxUiController#shouldShowLetterboxUi} for more context. */ boolean areAppWindowBoundsLetterboxed() { return mActivityRecord != null + && !mActivityRecord.inPinnedWindowingMode() && (mActivityRecord.areBoundsLetterboxed() || isLetterboxedForDisplayCutout()); }