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

Commit 3f046d13 authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas
Browse files

Apply fullscreen window mode if requested via activity options

If fullscreen is requested via activity options, apply fullscreen to
`outBounds` and return `RESULT_DONE` to prevent other modifiers from
changing mode.

Flag: com.android.window.flags.respect_fullscreen_activity_option_in_desktop_launch_params
Test: atest WmTests:DesktopModeLaunchParamsModifierTests
Fixes: 424336834
Change-Id: Id79d6f57907022e71636fee2f770ccded4a4683c
parent 61a25925
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -149,8 +149,9 @@ class DesktopModeLaunchParamsModifier implements LaunchParamsModifier {
                && options.getLaunchWindowingMode() == WINDOWING_MODE_FULLSCREEN;
        if (DesktopExperienceFlags.RESPECT_FULLSCREEN_ACTIVITY_OPTION_IN_DESKTOP_LAUNCH_PARAMS
                .isTrue() && requestFullscreen) {
            appendLog("respecting fullscreen activity option, skipping");
            return RESULT_SKIP;
            appendLog("respecting fullscreen activity option");
            outParams.mWindowingMode = WINDOWING_MODE_FULLSCREEN;
            return RESULT_DONE;
        }

        // If activity is null attempt to use task top activity if available.
+3 −2
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ public class DesktopModeLaunchParamsModifierTests extends
    @Test
    @EnableFlags({Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE,
            Flags.FLAG_RESPECT_FULLSCREEN_ACTIVITY_OPTION_IN_DESKTOP_LAUNCH_PARAMS})
    public void testReturnsSkipIfFullscreenRequestViaActivityOptions() {
    public void testAppliesFullscreenAndReturnDoneIfRequestViaActivityOptions() {
        setupDesktopModeLaunchParamsModifier();
        when(mTarget.isEnteringDesktopMode(any(), any(), any())).thenReturn(true);

@@ -192,8 +192,9 @@ public class DesktopModeLaunchParamsModifierTests extends
        final ActivityOptions options = ActivityOptions.makeBasic();
        options.setLaunchWindowingMode(WINDOWING_MODE_FULLSCREEN);

        assertEquals(RESULT_SKIP,
        assertEquals(RESULT_DONE,
                new CalculateRequestBuilder().setTask(task).setOptions(options).calculate());
        assertEquals(WINDOWING_MODE_FULLSCREEN, mResult.mWindowingMode);
    }

    @Test