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

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

Replace freeform activity check with freeform task check in DMLPM

Flag: com.android.window.flags.disable_desktop_launch_params_outside_desktop_bug_fix
Bug: 419537636
Test: atest WmTests:DesktopModeLaunchParamsModifierTests
Change-Id: Ia5b7c20d988417fb4c10222b6e52bdae6b4e41bf
parent 0e6d7abc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -257,7 +257,9 @@ class DesktopModeLaunchParamsModifier implements LaunchParamsModifier {
        //  activity will also enter desktop mode. On this same relationship, we can also assume
        //  if there are not visible freeform tasks but a freeform activity is now launching, it
        //  will force the device into desktop mode.
        return (task.getDisplayContent().getTopMostFreeformActivity() != null
        final Task visibleFreeformTask = task.getDisplayContent().getTask(
                t -> t.inFreeformWindowingMode() && t.isVisibleRequested());
        return (visibleFreeformTask != null
                    && checkSourceWindowModesCompatible(task, options, currentParams))
                || isRequestingFreeformWindowMode(task, options, currentParams);
    }
+1 −2
Original line number Diff line number Diff line
@@ -188,8 +188,7 @@ public class DesktopModeLaunchParamsModifierTests extends
        final DisplayContent dc = spy(createNewDisplay());
        final Task existingFreeformTask = new TaskBuilder(mSupervisor).setCreateActivity(true)
                .setWindowingMode(WINDOWING_MODE_FREEFORM).build();
        doReturn(existingFreeformTask.getRootActivity()).when(dc)
                .getTopMostFreeformActivity();
        doReturn(existingFreeformTask).when(dc).getTask(any());
        final Task launchingTask = new TaskBuilder(mSupervisor).build();
        launchingTask.onDisplayChanged(dc);