Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49c3ef9e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Letterbox: Ignore light status bar flags for letterboxed windows"

parents 68b17a7e 865c70f5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;
+7 −0
Original line number Diff line number Diff line
@@ -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();

+8 −4
Original line number Diff line number Diff line
@@ -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. */
@@ -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;