Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -604,7 +604,6 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { }); }); } } mTaskViewBase.onTaskVanished(taskInfo); mTaskViewBase.onTaskVanished(taskInfo); mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskInfo.token, false); } } } } Loading Loading @@ -718,6 +717,9 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { mTaskViewBase.setResizeBgColor(startTransaction, backgroundColor); mTaskViewBase.setResizeBgColor(startTransaction, backgroundColor); } } // After the embedded task has appeared, set it to non-trimmable. This is important // to prevent recents from trimming and removing the embedded task. wct.setTaskTrimmableFromRecents(taskInfo.token, false /* isTrimmableFromRecents */); mTaskViewBase.onTaskAppeared(mTaskInfo, mTaskLeash); mTaskViewBase.onTaskAppeared(mTaskInfo, mTaskLeash); if (mListener != null) { if (mListener != null) { final int taskId = mTaskInfo.taskId; final int taskId = mTaskInfo.taskId; Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java +10 −23 Original line number Original line Diff line number Diff line Loading @@ -293,16 +293,6 @@ public class TaskViewTest extends ShellTestCase { verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); } } @Test public void testUnsetOnBackPressedOnTaskRoot_legacyTransitions() { assumeFalse(Transitions.ENABLE_SHELL_TRANSITIONS); mTaskViewTaskController.onTaskAppeared(mTaskInfo, mLeash); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); mTaskViewTaskController.onTaskVanished(mTaskInfo); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(false)); } @Test @Test public void testOnNewTask_noSurface() { public void testOnNewTask_noSurface() { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); Loading Loading @@ -442,19 +432,6 @@ public class TaskViewTest extends ShellTestCase { verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); } } @Test public void testUnsetOnBackPressedOnTaskRoot() { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); WindowContainerTransaction wct = new WindowContainerTransaction(); mTaskViewTaskController.prepareOpenAnimation(true /* newTask */, new SurfaceControl.Transaction(), new SurfaceControl.Transaction(), mTaskInfo, mLeash, wct); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); mTaskViewTaskController.prepareCloseAnimation(); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(false)); } @Test @Test public void testSetObscuredTouchRect() { public void testSetObscuredTouchRect() { mTaskView.setObscuredTouchRect( mTaskView.setObscuredTouchRect( Loading Loading @@ -714,6 +691,16 @@ public class TaskViewTest extends ShellTestCase { verify(mTaskView).setResizeBackgroundColor(eq(Color.BLUE)); verify(mTaskView).setResizeBackgroundColor(eq(Color.BLUE)); } } @Test public void testOnAppeared_setsTrimmableTask() { WindowContainerTransaction wct = new WindowContainerTransaction(); mTaskViewTaskController.prepareOpenAnimation(true /* newTask */, new SurfaceControl.Transaction(), new SurfaceControl.Transaction(), mTaskInfo, mLeash, wct); assertThat(wct.getHierarchyOps().get(0).isTrimmableFromRecents()).isFalse(); } @Test @Test public void testMoveToFullscreen_callsTaskRemovalStarted() { public void testMoveToFullscreen_callsTaskRemovalStarted() { WindowContainerTransaction wct = new WindowContainerTransaction(); WindowContainerTransaction wct = new WindowContainerTransaction(); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java +3 −1 Original line number Original line Diff line number Diff line Loading @@ -604,7 +604,6 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { }); }); } } mTaskViewBase.onTaskVanished(taskInfo); mTaskViewBase.onTaskVanished(taskInfo); mTaskOrganizer.setInterceptBackPressedOnTaskRoot(taskInfo.token, false); } } } } Loading Loading @@ -718,6 +717,9 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener { mTaskViewBase.setResizeBgColor(startTransaction, backgroundColor); mTaskViewBase.setResizeBgColor(startTransaction, backgroundColor); } } // After the embedded task has appeared, set it to non-trimmable. This is important // to prevent recents from trimming and removing the embedded task. wct.setTaskTrimmableFromRecents(taskInfo.token, false /* isTrimmableFromRecents */); mTaskViewBase.onTaskAppeared(mTaskInfo, mTaskLeash); mTaskViewBase.onTaskAppeared(mTaskInfo, mTaskLeash); if (mListener != null) { if (mListener != null) { final int taskId = mTaskInfo.taskId; final int taskId = mTaskInfo.taskId; Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTest.java +10 −23 Original line number Original line Diff line number Diff line Loading @@ -293,16 +293,6 @@ public class TaskViewTest extends ShellTestCase { verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); } } @Test public void testUnsetOnBackPressedOnTaskRoot_legacyTransitions() { assumeFalse(Transitions.ENABLE_SHELL_TRANSITIONS); mTaskViewTaskController.onTaskAppeared(mTaskInfo, mLeash); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); mTaskViewTaskController.onTaskVanished(mTaskInfo); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(false)); } @Test @Test public void testOnNewTask_noSurface() { public void testOnNewTask_noSurface() { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); Loading Loading @@ -442,19 +432,6 @@ public class TaskViewTest extends ShellTestCase { verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); } } @Test public void testUnsetOnBackPressedOnTaskRoot() { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); WindowContainerTransaction wct = new WindowContainerTransaction(); mTaskViewTaskController.prepareOpenAnimation(true /* newTask */, new SurfaceControl.Transaction(), new SurfaceControl.Transaction(), mTaskInfo, mLeash, wct); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); mTaskViewTaskController.prepareCloseAnimation(); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(false)); } @Test @Test public void testSetObscuredTouchRect() { public void testSetObscuredTouchRect() { mTaskView.setObscuredTouchRect( mTaskView.setObscuredTouchRect( Loading Loading @@ -714,6 +691,16 @@ public class TaskViewTest extends ShellTestCase { verify(mTaskView).setResizeBackgroundColor(eq(Color.BLUE)); verify(mTaskView).setResizeBackgroundColor(eq(Color.BLUE)); } } @Test public void testOnAppeared_setsTrimmableTask() { WindowContainerTransaction wct = new WindowContainerTransaction(); mTaskViewTaskController.prepareOpenAnimation(true /* newTask */, new SurfaceControl.Transaction(), new SurfaceControl.Transaction(), mTaskInfo, mLeash, wct); assertThat(wct.getHierarchyOps().get(0).isTrimmableFromRecents()).isFalse(); } @Test @Test public void testMoveToFullscreen_callsTaskRemovalStarted() { public void testMoveToFullscreen_callsTaskRemovalStarted() { WindowContainerTransaction wct = new WindowContainerTransaction(); WindowContainerTransaction wct = new WindowContainerTransaction(); Loading