From ad08db1bf88a5695f06dc334861cc6cd3dbf5b96 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Mon, 13 Sep 2021 12:49:34 +0800 Subject: [PATCH] Fix invisible status bar icons when no appearance region reported After CL[1], it checks all overlapping windows with the status bar before reporting appearance regions to SysUI. If there's no overlapping window, it'll report empty appearance region. This prevents setting the foreground color of the status bar to dark unexpectedly by checking if there's any light appearance regions reported first. [1]: Id69a8dadcf9044fb2cde1b50108479a4375332be Bug: 198972446 Test: launch immersive apps with layoutInDisplayCutoutMode=never, observed the foregound color of status bar is light while the background color is dark. Change-Id: I7c1d2fb72f38f0a67d982d5e8509cf5a9f3b98d2 --- .../statusbar/phone/LightBarController.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java index 24c902151d7c1..37cb89e8a1ef3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LightBarController.java @@ -218,19 +218,19 @@ public class LightBarController implements BatteryController.BatteryStateChangeC } } + // If no one is light, all icons become white. + if (numLightStacks == 0) { + mStatusBarIconController.getTransitionsController().setIconsDark( + false, animateChange()); + } + // If all stacks are light, all icons get dark. - if (numLightStacks == numStacks) { + else if (numLightStacks == numStacks) { mStatusBarIconController.setIconsDarkArea(null); mStatusBarIconController.getTransitionsController().setIconsDark(true, animateChange()); } - // If no one is light, all icons become white. - else if (numLightStacks == 0) { - mStatusBarIconController.getTransitionsController().setIconsDark( - false, animateChange()); - } - // Not the same for every stack, magic! else { mStatusBarIconController.setIconsDarkArea(