Allow children task of created-by-organizer task to be organized

Allows to organize direct child of root task created by organizer and
extends TaskInfo to reveal the parent task id.

To organize child task properly for each features, passes all child
task organizer events to the listener listening to its parent task if
feasible.

Fix: 169267298
Fix: 169266482
Test: atest WindowOrganizerTests
Test: atest SplitScreenTests
Test: atest PinnedStackTests
Test: atest WindowInsetPolicyTests
Test: atest WMShellUnitTests
Test: split screen works
Change-Id: I8e66f810c86fcdac3287adfa208d8e34786fc9b5
This commit is contained in:
Jerry Chang
2020-10-15 11:41:50 +08:00
parent ec8173509a
commit e6fc6a3c2a
8 changed files with 125 additions and 5 deletions

View File

@@ -247,6 +247,20 @@ public class ShellTaskOrganizerTests {
assertTrue(gotException);
}
@Test
public void testGetParentTaskListener() {
RunningTaskInfo task1 = createTaskInfo(1, WINDOWING_MODE_MULTI_WINDOW);
TrackingTaskListener mwListener = new TrackingTaskListener();
mOrganizer.onTaskAppeared(task1, null);
mOrganizer.addListenerForTaskId(mwListener, task1.taskId);
RunningTaskInfo task2 = createTaskInfo(1, WINDOWING_MODE_MULTI_WINDOW);
task2.parentTaskId = task1.taskId;
mOrganizer.onTaskAppeared(task2, null);
assertTrue(mwListener.appeared.contains(task2));
}
@Test
public void testTaskInfoToTaskListenerType_whenLetterboxBoundsPassed_returnsLetterboxType() {
RunningTaskInfo taskInfo = createTaskInfo(