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

This commit is contained in:
TreeHugger Robot
2022-05-13 14:55:46 +00:00
committed by Android (Google) Code Review

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);