summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author dakinola <dakinola@google.com> 2024-04-24 20:01:23 +0000
committer dakinola <dakinola@google.com> 2024-04-25 13:25:10 +0000
commit3db963e6d67122e31819f55adbd325845014f71c (patch)
tree7eceb90fa698595f0915c633d03f86e46f1b5956
parentc0d9cb13268895fc8a1deee808f9ea5adb0f6a4a (diff)
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
-rw-r--r--services/core/java/com/android/server/wm/DesktopModeLaunchParamsModifier.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/DesktopModeLaunchParamsModifier.java b/services/core/java/com/android/server/wm/DesktopModeLaunchParamsModifier.java
index 61f5679cdfc4..f04b4af285be 100644
--- a/services/core/java/com/android/server/wm/DesktopModeLaunchParamsModifier.java
+++ b/services/core/java/com/android/server/wm/DesktopModeLaunchParamsModifier.java
@@ -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;