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

Commit 3db963e6 authored by dakinola's avatar dakinola
Browse files

Set DisplayArea in DesktopModeLaunchParamsModifier

When desktop windowing is enabled, DesktopModeLaunchParamsModifier is applied to any new launching activity, and for any non-null task it superceeds TaskLaunchParamsModifier. Usually TaskLaunchParamsModifier sets the preferredDisplayArea, but since it doesn't, the launchParams for tasks have null display areas. This was leading to an issue where taskbar tests were failing because they were launching an app in split screen unexpectedly. Usually, if there is display area in the launch params, the task is reparented to the display area and inherits the windowing mode of the display area.

Flag: None
Bug: 335856622
Bug: 333446588
Test: atest NexusLauncherTests:com.android.quickstep
Change-Id: Ifb347a6c93b94f7c197fbe722db06200884442df
parent c0d9cb13
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -114,6 +114,18 @@ public class DesktopModeLaunchParamsModifier implements LaunchParamsModifier {
            return RESULT_DONE;
        }

        // TODO(b/336998072) - Find a better solution to this that makes use of the logic from
        //  TaskLaunchParamsModifier. Put logic in common utils, return RESULT_CONTINUE, inherit
        //  from parent class, etc.
        if (outParams.mPreferredTaskDisplayArea == null && task.getRootTask() != null) {
            appendLog("display-from-task=" + task.getRootTask().getDisplayId());
            outParams.mPreferredTaskDisplayArea = task.getRootTask().getDisplayArea();
        }

        if (phase == PHASE_DISPLAY_AREA) {
            return RESULT_DONE;
        }

        if (!currentParams.mBounds.isEmpty()) {
            appendLog("currentParams has bounds set, not overriding");
            return RESULT_SKIP;