Collect task in getOrCreateRootTask

Some CTS tests launch a freeform task and then replaces the activity
with a new one with fullscreen ActivityOptions. As the new windowing
mode is set in getOrCreateRootTask(), currently this task isn't
collected, and there's no way for Shell to transition this task
properly.

Bug: 242483894
Test: KeyboardVisibilityControlTest
Test: ImeInsetsControllerTest
Change-Id: Ibf0efddf3dea1cb9ed8b874348a4d4d75d609371
This commit is contained in:
Kazuki Takise
2022-11-16 21:14:23 +09:00
parent 5e77f8ce05
commit a59a0a7d57

View File

@@ -929,6 +929,7 @@ 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()
&& candidateTask.getWindowingMode() != windowingMode) {
candidateTask.mTransitionController.collect(candidateTask);
candidateTask.setWindowingMode(windowingMode);
}
return candidateTask.getRootTask();