Merge "Add getAdjacentTaskFragment check for the split screen case" into tm-dev am: d60f5664be

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18356918

Change-Id: I04331012baa6a54304ecfd4f866a1b3e9291e5e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-05-13 15:02:05 +00:00
committed by Automerger Merge Worker

View File

@@ -654,12 +654,14 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
} }
// Apps and their containers are not allowed to specify an orientation of non floating // 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 = final Task nonFloatingTopTask =
getRootTask(t -> !t.getWindowConfiguration().tasksAreFloating()); getTask(t -> !t.getWindowConfiguration().tasksAreFloating());
if (nonFloatingTopTask != null && nonFloatingTopTask.mCreatedByOrganizer if (nonFloatingTopTask != null) {
&& nonFloatingTopTask.isVisible()) { final Task task = nonFloatingTopTask.getCreatedByOrganizerTask();
return SCREEN_ORIENTATION_UNSPECIFIED; if (task != null && task.getAdjacentTaskFragment() != null && task.isVisible()) {
return SCREEN_ORIENTATION_UNSPECIFIED;
}
} }
final int orientation = super.getOrientation(candidate); final int orientation = super.getOrientation(candidate);