Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 706bb3e9 authored by Tony Huang's avatar Tony Huang
Browse files

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
parent e5c6355a
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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;
            }
        }