Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -7898,8 +7898,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If the top fullscreen-or-dimming window is also the top fullscreen, respect // its light flag. vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; if (!statusColorWin.isLetterboxedForDisplayCutoutLw()) { // Only allow white status bar if the window was not letterboxed. vis |= PolicyControl.getSystemUiVisibility(statusColorWin, null) & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; } } else if (statusColorWin != null && statusColorWin.isDimming()) { // Otherwise if it's dimming, clear the light flag. vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; Loading services/core/java/com/android/server/policy/WindowManagerPolicy.java +7 −0 Original line number Diff line number Diff line Loading @@ -446,6 +446,13 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { */ public boolean isDimming(); /** * Returns true if the window is letterboxed for the display cutout. */ default boolean isLetterboxedForDisplayCutoutLw() { return false; } /** @return the current windowing mode of this window. */ int getWindowingMode(); Loading services/core/java/com/android/server/wm/WindowState.java +8 −4 Original line number Diff line number Diff line Loading @@ -202,7 +202,6 @@ import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Comparator; import java.util.LinkedList; import java.util.function.Predicate; /** A window in the window manager. */ Loading Loading @@ -2981,11 +2980,16 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP /** @return true when the window is in fullscreen task, but has non-fullscreen bounds set. */ boolean isLetterboxedAppWindow() { return !isInMultiWindowMode() && mAppToken != null && (!mAppToken.matchParentBounds() || isLetterboxedForCutout()); return !isInMultiWindowMode() && mAppToken != null && !mAppToken.matchParentBounds() || isLetterboxedForDisplayCutoutLw(); } private boolean isLetterboxedForCutout() { @Override public boolean isLetterboxedForDisplayCutoutLw() { if (mAppToken == null) { // Only windows with an AppWindowToken are letterboxed. return false; } if (getDisplayContent().getDisplayInfo().displayCutout == null) { // No cutout, no letterbox. return false; Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -7898,8 +7898,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If the top fullscreen-or-dimming window is also the top fullscreen, respect // its light flag. vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; if (!statusColorWin.isLetterboxedForDisplayCutoutLw()) { // Only allow white status bar if the window was not letterboxed. vis |= PolicyControl.getSystemUiVisibility(statusColorWin, null) & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; } } else if (statusColorWin != null && statusColorWin.isDimming()) { // Otherwise if it's dimming, clear the light flag. vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; Loading
services/core/java/com/android/server/policy/WindowManagerPolicy.java +7 −0 Original line number Diff line number Diff line Loading @@ -446,6 +446,13 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { */ public boolean isDimming(); /** * Returns true if the window is letterboxed for the display cutout. */ default boolean isLetterboxedForDisplayCutoutLw() { return false; } /** @return the current windowing mode of this window. */ int getWindowingMode(); Loading
services/core/java/com/android/server/wm/WindowState.java +8 −4 Original line number Diff line number Diff line Loading @@ -202,7 +202,6 @@ import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Comparator; import java.util.LinkedList; import java.util.function.Predicate; /** A window in the window manager. */ Loading Loading @@ -2981,11 +2980,16 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP /** @return true when the window is in fullscreen task, but has non-fullscreen bounds set. */ boolean isLetterboxedAppWindow() { return !isInMultiWindowMode() && mAppToken != null && (!mAppToken.matchParentBounds() || isLetterboxedForCutout()); return !isInMultiWindowMode() && mAppToken != null && !mAppToken.matchParentBounds() || isLetterboxedForDisplayCutoutLw(); } private boolean isLetterboxedForCutout() { @Override public boolean isLetterboxedForDisplayCutoutLw() { if (mAppToken == null) { // Only windows with an AppWindowToken are letterboxed. return false; } if (getDisplayContent().getDisplayInfo().displayCutout == null) { // No cutout, no letterbox. return false; Loading