From 1c995fa719b8a782902fe5c618321894ea035d88 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Wed, 6 Jul 2022 12:02:16 +0000 Subject: [PATCH] Make sure system bars have visible background while force-showing Client insets controller can request to hide system bars to enter immersive mode. However, there're cases force-show system bars like in split screen or freeform mode. This makes sure the background view of system bars are always visible while force-showing. Fix: 234196894 Test: put an immersive app in split, verified system bars background won't be invisible Change-Id: Ia167bce9e64cd81a2ade499f8c6528384d957209 --- core/java/com/android/internal/policy/DecorView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java index 13bf64334f61a..a352063aa6ee6 100644 --- a/core/java/com/android/internal/policy/DecorView.java +++ b/core/java/com/android/internal/policy/DecorView.java @@ -1440,8 +1440,9 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind int size, boolean verticalBar, boolean seascape, int sideMargin, boolean animate, boolean force, WindowInsetsController controller) { state.present = state.attributes.isPresent( - controller.isRequestedVisible(state.attributes.insetsType), - mWindow.getAttributes().flags, force); + (controller.isRequestedVisible(state.attributes.insetsType) + || mLastShouldAlwaysConsumeSystemBars), + mWindow.getAttributes().flags, force); boolean show = state.attributes.isVisible(state.present, color, mWindow.getAttributes().flags, force); boolean showView = show && !isResizing() && !mHasCaption && size > 0;