Fix navigation bar icon invisible with dimming window

Make sure all windows with its frame overlapping with navigation bar can
declare light navigation bar color no matter if it's dimming or not.

Fix: 205308712
Test: atest DisplayPolicyTests
Test: verified dimming window with its frame overlapping with navigation
      bar can declare light navigation bar color.
Change-Id: I6269547f0dfcd54568fd4f07b2642258f93a2822
This commit is contained in:
Jerry Chang
2021-12-21 12:35:02 +08:00
parent f811df0eb6
commit d569feb6be
2 changed files with 1 additions and 7 deletions

View File

@@ -2819,8 +2819,7 @@ public class DisplayPolicy {
@VisibleForTesting
int updateLightNavigationBarLw(int appearance, WindowState navColorWin) {
if (navColorWin == null || navColorWin.isDimming()
|| !isLightBarAllowed(navColorWin, Type.navigationBars())) {
if (navColorWin == null || !isLightBarAllowed(navColorWin, Type.navigationBars())) {
// Clear the light flag while not allowed.
appearance &= ~APPEARANCE_LIGHT_NAVIGATION_BARS;
return appearance;

View File

@@ -189,11 +189,6 @@ public class DisplayPolicyTests extends WindowTestsBase {
assertEquals(0,
displayPolicy.updateLightNavigationBarLw(APPEARANCE_LIGHT_NAVIGATION_BARS, null));
// Dimming window clears APPEARANCE_LIGHT_NAVIGATION_BARS.
assertEquals(0, displayPolicy.updateLightNavigationBarLw(0, dimming));
assertEquals(0, displayPolicy.updateLightNavigationBarLw(
APPEARANCE_LIGHT_NAVIGATION_BARS, dimming));
// Control window overrides APPEARANCE_LIGHT_NAVIGATION_BARS flag.
assertEquals(0, displayPolicy.updateLightNavigationBarLw(0, opaqueDarkNavBar));
assertEquals(0, displayPolicy.updateLightNavigationBarLw(