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
This commit is contained in:
Tiger
2023-05-05 17:35:44 +08:00
parent 706cc5848c
commit 75dd944a6b

View File

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