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
This commit is contained in:
Jerry Chang
2022-07-06 12:02:16 +00:00
parent bfc1787139
commit 1c995fa719

View File

@@ -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;