From d569feb6be0391aea1895b78094ceaf7da5862e2 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Tue, 21 Dec 2021 12:35:02 +0800 Subject: [PATCH] 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 --- services/core/java/com/android/server/wm/DisplayPolicy.java | 3 +-- .../src/com/android/server/wm/DisplayPolicyTests.java | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index b2657e82eb6c9..2bfb0537df3b7 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -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; diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java index 8da8596f47f99..69700052ce74e 100644 --- a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyTests.java @@ -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(