diff options
| author | 2022-05-13 14:55:46 +0000 | |
|---|---|---|
| committer | 2022-05-13 14:55:46 +0000 | |
| commit | d60f5664be8ca80a8a5cc1068531aac4ab75d905 (patch) | |
| tree | 0c646ef0573adc10392b21edafc8a0761b75e8d4 | |
| parent | 8ade0d824cf5ffd57ad89e5b6b3f40381e700149 (diff) | |
| parent | 84289d3985759260e19bcf2e95651bf814845cde (diff) | |
Merge "Add getAdjacentTaskFragment check for the split screen case" into tm-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskDisplayArea.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index ce406e4ecb20..dd1b50fc5e0b 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -654,12 +654,14 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> { } // Apps and their containers are not allowed to specify an orientation of non floating - // visible tasks created by organizer. The organizer handles the orientation instead. + // visible tasks created by organizer and that has an adjacent task. final Task nonFloatingTopTask = - getRootTask(t -> !t.getWindowConfiguration().tasksAreFloating()); - if (nonFloatingTopTask != null && nonFloatingTopTask.mCreatedByOrganizer - && nonFloatingTopTask.isVisible()) { - return SCREEN_ORIENTATION_UNSPECIFIED; + getTask(t -> !t.getWindowConfiguration().tasksAreFloating()); + if (nonFloatingTopTask != null) { + final Task task = nonFloatingTopTask.getCreatedByOrganizerTask(); + if (task != null && task.getAdjacentTaskFragment() != null && task.isVisible()) { + return SCREEN_ORIENTATION_UNSPECIFIED; + } } final int orientation = super.getOrientation(candidate); |