From 44f50d484de99b0801649ac052acd46c7be66192 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Fri, 13 Mar 2020 16:55:42 +0800 Subject: [PATCH] [RESTRICT AUTOMERGE] Allow bar to be transparent during animating. When top window request fullscreen and device contain a real cutout and the layoutInDisplayCutout is default or never, a letterbox will be created for this activity, which cause BarController#isTransparentAllowed return false so the status bar cannot be transparent, the bar will shows a black background during hidding animation. A simple workaround is to allow the bar can be transparent during hidding, since the surface of letterbox is not really overlapped with bar because it's also animating. Bug: 150048810 Test: No black background shows on status bar when opening fullscreen app. Test: atest DisplayPolicyTests Change-Id: I2dd5b1fbad8e79ec80f799d63bba8824acc6a639 --- services/core/java/com/android/server/wm/BarController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/BarController.java b/services/core/java/com/android/server/wm/BarController.java index 90bb494232c7c..338df39a1624c 100644 --- a/services/core/java/com/android/server/wm/BarController.java +++ b/services/core/java/com/android/server/wm/BarController.java @@ -164,7 +164,8 @@ public class BarController { } boolean isTransparentAllowed(WindowState win) { - return win == null || !win.isLetterboxedOverlappingWith(mContentFrame); + return win == null || mState == StatusBarManager.WINDOW_STATE_HIDING + || !win.isLetterboxedOverlappingWith(mContentFrame); } boolean setBarShowingLw(final boolean show) {