Merge "Fix DisplayPolicy#isOverlappingWithNavBar" into tm-qpr-dev am: 4fd0994ae5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21571100

Change-Id: I3ad87c49dce858c0bc34707fa1db1a0912f93d0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Tiger Huang
2023-02-28 12:28:56 +00:00
committed by Automerger Merge Worker

View File

@@ -1577,9 +1577,8 @@ public class DisplayPolicy {
applyKeyguardPolicy(win, imeTarget); applyKeyguardPolicy(win, imeTarget);
// Check if the freeform window overlaps with the navigation bar area. // Check if the freeform window overlaps with the navigation bar area.
final boolean isOverlappingWithNavBar = isOverlappingWithNavBar(win); if (!mIsFreeformWindowOverlappingWithNavBar && win.inFreeformWindowingMode()
if (isOverlappingWithNavBar && !mIsFreeformWindowOverlappingWithNavBar && win.mActivityRecord != null && isOverlappingWithNavBar(win)) {
&& win.inFreeformWindowingMode()) {
mIsFreeformWindowOverlappingWithNavBar = true; mIsFreeformWindowOverlappingWithNavBar = true;
} }
@@ -1637,7 +1636,7 @@ public class DisplayPolicy {
// mode; if it's in gesture navigation mode, the navigation bar will be // mode; if it's in gesture navigation mode, the navigation bar will be
// NAV_BAR_FORCE_TRANSPARENT and its appearance won't be decided by overlapping // NAV_BAR_FORCE_TRANSPARENT and its appearance won't be decided by overlapping
// windows. // windows.
if (isOverlappingWithNavBar) { if (isOverlappingWithNavBar(win)) {
if (mNavBarColorWindowCandidate == null) { if (mNavBarColorWindowCandidate == null) {
mNavBarColorWindowCandidate = win; mNavBarColorWindowCandidate = win;
addSystemBarColorApp(win); addSystemBarColorApp(win);
@@ -1665,7 +1664,7 @@ public class DisplayPolicy {
addSystemBarColorApp(win); addSystemBarColorApp(win);
} }
} }
if (isOverlappingWithNavBar && mNavBarColorWindowCandidate == null) { if (isOverlappingWithNavBar(win) && mNavBarColorWindowCandidate == null) {
mNavBarColorWindowCandidate = win; mNavBarColorWindowCandidate = win;
} }
} }
@@ -2858,7 +2857,7 @@ public class DisplayPolicy {
@VisibleForTesting @VisibleForTesting
static boolean isOverlappingWithNavBar(@NonNull WindowState win) { static boolean isOverlappingWithNavBar(@NonNull WindowState win) {
if (win.mActivityRecord == null || !win.isVisible()) { if (!win.isVisible()) {
return false; return false;
} }