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: Ib9aaa9f822f7d3404410c505a12155bb69cb054d
This commit is contained in:
Tony Huang
2021-07-20 10:50:53 +08:00
parent e5c6355a2e
commit 706bb3e9a3

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