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

Commit 6ff19a6b authored by Kenneth Ford's avatar Kenneth Ford Committed by Android (Google) Code Review
Browse files

Merge "Do not force desktop mode on a rear positioned display" into main

parents 99c67dd3 7a0aa26c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -180,3 +180,14 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
    name: "rear_display_disable_force_desktop_system_decorations"
    description: "Block system decorations from being added to a rear display when desktop mode is forced"
    bug: "346103150"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+10 −4
Original line number Diff line number Diff line
@@ -5719,15 +5719,21 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
     * @see Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
     */
    boolean supportsSystemDecorations() {
        boolean forceDesktopModeOnDisplay = forceDesktopMode();

        if (com.android.window.flags.Flags.rearDisplayDisableForceDesktopSystemDecorations()) {
            // System decorations should not be forced on a rear display due to security policies.
            forceDesktopModeOnDisplay =
                    forceDesktopModeOnDisplay && ((mDisplay.getFlags() & Display.FLAG_REAR) == 0);
        }

        return (mWmService.mDisplayWindowSettings.shouldShowSystemDecorsLocked(this)
                || (mDisplay.getFlags() & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0
                || forceDesktopMode())
                || forceDesktopModeOnDisplay)
                // VR virtual display will be used to run and render 2D app within a VR experience.
                && mDisplayId != mWmService.mVr2dDisplayId
                // Do not show system decorations on untrusted virtual display.
                && isTrusted()
                // No system decoration on rear display.
                && (mDisplay.getFlags() & Display.FLAG_REAR) == 0;
                && isTrusted();
    }

    /**