From 75dd944a6b8bbea3f1e6f30d602179a8c55f0bf0 Mon Sep 17 00:00:00 2001 From: Tiger Date: Fri, 5 May 2023 17:35:44 +0800 Subject: [PATCH] Let non-fill-screen app window control nav bar appearance If the frame of a non-fill-screen app window contains the content frame of navigation bar, it should be able to decide the icon color of the bar. Note the content frame here is the navigation bar area subtract the display cutout area. Fix: 234602646 Test: Open an app which shifts its main window down by 200px, and see if the icon color of navigation bar can be controlled by the app. Change-Id: I4dfeefe0f438922153cf26d217f9beddf88ad4c0 --- services/core/java/com/android/server/wm/DisplayPolicy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index be52e5a4566b5..84c6efb7ec940 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -1525,6 +1525,11 @@ public class DisplayPolicy { if (isOverlappingWithNavBar(win) && mNavBarColorWindowCandidate == null) { mNavBarColorWindowCandidate = win; } + } else if (appWindow && attached == null && mNavBarColorWindowCandidate == null + && win.getFrame().contains( + getBarContentFrameForWindow(win, Type.navigationBars()))) { + mNavBarColorWindowCandidate = win; + addSystemBarColorApp(win); } }