Loading libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java +2 −1 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, // so go ahead and hide the task entirely updateTaskVisibility(); } mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, true); // TODO: Synchronize show with the resize onLocationChanged(); setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor()); Loading @@ -257,6 +257,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, if (mListener != null) { mListener.onTaskRemovalStarted(taskInfo.taskId); } mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, false); // Unparent the task when this surface is destroyed mTransaction.reparent(mTaskLeash, null).apply(); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -215,4 +215,19 @@ public class TaskViewTest extends ShellTestCase { verify(mViewListener).onBackPressedOnTaskRoot(eq(mTaskInfo.taskId)); } @Test public void testSetOnBackPressedOnTaskRoot() { mTaskView.onTaskAppeared(mTaskInfo, mLeash); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); } @Test public void testUnsetOnBackPressedOnTaskRoot() { mTaskView.onTaskAppeared(mTaskInfo, mLeash); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); mTaskView.onTaskVanished(mTaskInfo); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(false)); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java +2 −1 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, // so go ahead and hide the task entirely updateTaskVisibility(); } mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, true); // TODO: Synchronize show with the resize onLocationChanged(); setResizeBackgroundColor(taskInfo.taskDescription.getBackgroundColor()); Loading @@ -257,6 +257,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback, if (mListener != null) { mListener.onTaskRemovalStarted(taskInfo.taskId); } mTaskOrganizer.setInterceptBackPressedOnTaskRoot(mTaskToken, false); // Unparent the task when this surface is destroyed mTransaction.reparent(mTaskLeash, null).apply(); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -215,4 +215,19 @@ public class TaskViewTest extends ShellTestCase { verify(mViewListener).onBackPressedOnTaskRoot(eq(mTaskInfo.taskId)); } @Test public void testSetOnBackPressedOnTaskRoot() { mTaskView.onTaskAppeared(mTaskInfo, mLeash); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); } @Test public void testUnsetOnBackPressedOnTaskRoot() { mTaskView.onTaskAppeared(mTaskInfo, mLeash); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(true)); mTaskView.onTaskVanished(mTaskInfo); verify(mOrganizer).setInterceptBackPressedOnTaskRoot(eq(mTaskInfo.token), eq(false)); } }