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

Commit d438bc2a authored by Toshiki Kikuchi's avatar Toshiki Kikuchi
Browse files

Use task instead of sourceTask to detect the fullscreen launch

This CL fixes the usage of `task` vs `sourceTask` to detect the
fullscreen launch case.
In Ib48752887e7dfd685135c1e0b0e96cd6186708b2, the line unintentionally
uses `sourceTask` although it looks at the launch windowing mode of the
launching task itself (i.e., `task`).

Flag: EXEMPT - bug fix
Bug: 419348338
Bug: 416953378
Bug: 422035204
Bug: 419110280
Test: DesktopModeLaunchParamsModifierTests
Test: manual - Install a new app and launch it in desktop-first mode
Test: manual - Circle-to-search issue (b/410554758)
Change-Id: I2281ef0ec222219d891830d29959efe41a0160b8
parent 1b1a3622
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ class DesktopModeLaunchParamsModifier implements LaunchParamsModifier {
            final Task sourceTask = source.getTask();
            // Don't explicitly set to freeform if task is launching in full-screen in desktop-first
            // container, as it should already inherit freeform by default if undefined.
            requestFullscreen |= sourceTask.getWindowingMode() == WINDOWING_MODE_FULLSCREEN;
            requestFullscreen |= task.getWindowingMode() == WINDOWING_MODE_FULLSCREEN;
            isFullscreenInDeskTask = inDesktopFirstContainer && requestFullscreen;
            if (DesktopModeFlags.DISABLE_DESKTOP_LAUNCH_PARAMS_OUTSIDE_DESKTOP_BUG_FIX.isTrue()
                    && isEnteringDesktopMode(sourceTask, options, currentParams)
+7 −4
Original line number Diff line number Diff line
@@ -1620,13 +1620,16 @@ public class DesktopModeLaunchParamsModifierTests extends
    public void testInMultiDesk_requestFullscreen_returnDone() {
        setupDesktopModeLaunchParamsModifier();

        final Task task = new TaskBuilder(mSupervisor).setActivityType(
                ACTIVITY_TYPE_STANDARD).setCreatedByOrganizer(true).build();
        final Task deskRoot = new TaskBuilder(mSupervisor).setActivityType(
                ACTIVITY_TYPE_STANDARD).setWindowingMode(WINDOWING_MODE_FREEFORM)
                .setCreatedByOrganizer(true).build();
        final Task sourceTask = new TaskBuilder(mSupervisor).setActivityType(
                ACTIVITY_TYPE_STANDARD).setWindowingMode(WINDOWING_MODE_FULLSCREEN).build();
        // Creating a fullscreen task under the desk root.
        final Task task = new TaskBuilder(mSupervisor).setActivityType(
                ACTIVITY_TYPE_STANDARD).setWindowingMode(WINDOWING_MODE_FULLSCREEN)
                .setParentTask(deskRoot).build();

        assertNotNull(task.getCreatedByOrganizerTask());
        task.getCreatedByOrganizerTask().setWindowingMode(WINDOWING_MODE_FREEFORM);
        final ActivityRecord sourceActivity = new ActivityBuilder(task.mAtmService)
                .setTask(sourceTask).build();