Fix stage split rotation

On current implementation, it will use DC.getLastOrientation in
TDA#getOrientation, it will got SCREEN_ORIENTATION_NOSENSOR so it
didn't rotate.

Fix this by adding checking if TDA non floating root task is visible
and creadted by organize, it should all use
SCREEN_ORIENTATION_UNSPECIFIED.

Fix: 194158966
Test: active stage split and rotate divice
Change-Id: Id78ebae24150e5d5f901b0f85c5a86cefe1d453f
This commit is contained in:
Tony Huang
2021-07-20 10:50:53 +08:00
parent 9119cb969f
commit 8dc8bdaae5

View File

@@ -780,10 +780,12 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
}
return SCREEN_ORIENTATION_UNSPECIFIED;
} else {
// Apps and their containers are not allowed to specify an orientation of full screen
// tasks created by organizer. The organizer handles the orientation instead.
final Task task = getTopRootTaskInWindowingMode(WINDOWING_MODE_FULLSCREEN);
if (task != null && task.isVisible() && task.mCreatedByOrganizer) {
// 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.
final Task nonFloatingTopTask =
getRootTask(t -> !t.getWindowConfiguration().tasksAreFloating());
if (nonFloatingTopTask != null && nonFloatingTopTask.mCreatedByOrganizer
&& nonFloatingTopTask.isVisible()) {
return SCREEN_ORIENTATION_UNSPECIFIED;
}
}