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

Commit 6f47e2ae authored by Ben Lin's avatar Ben Lin
Browse files

Don't only change windowing mode of root task when requesting task for windowing mode

If a task doesn't have a root task and a windowing mode is requested, it should still be honored.
Call on the non-roottask version of setWindowingMode.

Bug: 416588577
Test: Manual. Intent launches with launchWindowingMode is now respected
Flag: EXEMPT bugfix
Change-Id: Id915c02ff3345d267a075897c67afbf56ff2a6e3
parent 37539413
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -822,10 +822,18 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
                }
            }
            // Update windowing mode if necessary, e.g. launch into a different windowing mode.
            if (windowingMode != WINDOWING_MODE_UNDEFINED && candidateTask.isRootTask()
            if (windowingMode != WINDOWING_MODE_UNDEFINED
                    && candidateTask.getWindowingMode() != windowingMode) {
                candidateTask.mTransitionController.collect(candidateTask);
                // We only explicitly change the windowing mode if it's a root task.
                // If it's not a root task, we don't do anything. But, if the desired windowing
                // mode is the same as its parent's, then we will set it undefined so it inherits.
                if (candidateTask.isRootTask()) {
                    candidateTask.setRootTaskWindowingMode(windowingMode);
                } else if (candidateTask.getParent() != null
                        && windowingMode == candidateTask.getParent().getWindowingMode()) {
                    candidateTask.setWindowingMode(WINDOWING_MODE_UNDEFINED);
                }
            }
            return candidateTask.getRootTask();
        }