Loading libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleControllerTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ class BubbleControllerTest(flags: FlagsParameterization) { taskView, true, /* visible */ true, /* reorder */ false, /* toggleHiddenOnReorder */ false, /* syncHiddenWithVisibilityOnReorder */ ) } else { verify(baseTransitions).setTaskViewVisible(taskView, true /* visible */) Loading libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +11 −5 Original line number Diff line number Diff line Loading @@ -473,7 +473,8 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV /** See {@link #setTaskViewVisible(TaskViewTaskController, boolean, boolean, boolean)}. */ public void setTaskViewVisible(TaskViewTaskController taskView, boolean visible, boolean reorder) { setTaskViewVisible(taskView, visible, reorder, true /* toggleHiddenOnReorder */); setTaskViewVisible(taskView, visible, reorder, true /* syncHiddenWithVisibilityOnReorder */); } /** Loading @@ -484,13 +485,15 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV * be reordered as per the given {@code visible}. For {@code visible = true}, * task will be reordered to top. For {@code visible = false}, task will be * reordered to the bottom * @param toggleHiddenOnReorder Whether to also toggle the hidden state of the task. This only * takes effect if {@code reorder} is {@code true}. * @param syncHiddenWithVisibilityOnReorder Whether to also synchronize the hidden state of * the task with the target visibility when * reordering. This only takes effect if {@code * reorder} is {@code true}. * @throws IllegalStateException If the flag {@link FLAG_ENABLE_CREATE_ANY_BUBBLE} and * {@link FLAG_EXCLUDE_TASK_FROM_RECENTS} are not enabled. */ public void setTaskViewVisible(TaskViewTaskController taskView, boolean visible, boolean reorder, boolean toggleHiddenOnReorder) { boolean reorder, boolean syncHiddenWithVisibilityOnReorder) { final TaskViewRepository.TaskViewState state = useRepo() ? mTaskViewRepo.byTaskView(taskView) : mTaskViews.get(taskView); Loading @@ -504,12 +507,15 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setBounds(taskView.getTaskInfo().token, state.mBounds); if (reorder && !toggleHiddenOnReorder) { if (reorder && !syncHiddenWithVisibilityOnReorder) { if (!BubbleAnythingFlagHelper.enableCreateAnyBubbleWithForceExcludedFromRecents()) { throw new IllegalStateException( "Flag " + FLAG_ENABLE_CREATE_ANY_BUBBLE + " and " + FLAG_EXCLUDE_TASK_FROM_RECENTS + " are not enabled"); } // Reset hidden state to fix corner case where surface was destroyed before task // appeared in #prepareOpenAnimation. wct.setHidden(taskView.getTaskInfo().token, false /* hidden */); // Order of setAlwaysOnTop() and reorder() matters; hierarchy ops apply sequentially. wct.setAlwaysOnTop(taskView.getTaskInfo().token, visible /* alwaysOnTop */); } else { Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTransitionsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { } @Test public void testSetTaskVisibility_reorderNoToggleHidden_resetsAlwaysOnTopAndReorder() { public void testSetTaskVisibility_reorderNoHiddenVisibilitySync_resetsAlwaysOnTopAndReorder() { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); assumeTrue(TaskViewTransitions.useRepo()); assumeTrue(BubbleAnythingFlagHelper.enableCreateAnyBubbleWithForceExcludedFromRecents()); Loading @@ -297,7 +297,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { when(mToken.asBinder()).thenReturn(mockBinder); mTaskViewTransitions.setTaskViewVisible(mTaskViewTaskController, false /* visible */, true /* reorder */, false /* toggleHiddenOnReorder */); true /* reorder */, false /* syncHiddenWithVisibilityOnReorder */); final TaskViewTransitions.PendingTransition pending = mTaskViewTransitions.findPending(mTaskViewTaskController, TRANSIT_TO_BACK); Loading @@ -306,6 +306,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { assertThat(chgs.keySet()).containsExactly(mockBinder); assertThat(chgs.get(mockBinder).getConfiguration().windowConfiguration.getBounds()) .isEqualTo(bounds); assertThat(chgs.get(mockBinder).getHidden()).isFalse(); final List<WindowContainerTransaction.HierarchyOp> ops = pending.mWct.getHierarchyOps(); assertThat(ops).hasSize(2); assertThat(ops.get(0).isAlwaysOnTop()).isFalse(); Loading Loading
libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleControllerTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ class BubbleControllerTest(flags: FlagsParameterization) { taskView, true, /* visible */ true, /* reorder */ false, /* toggleHiddenOnReorder */ false, /* syncHiddenWithVisibilityOnReorder */ ) } else { verify(baseTransitions).setTaskViewVisible(taskView, true /* visible */) Loading
libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java +11 −5 Original line number Diff line number Diff line Loading @@ -473,7 +473,8 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV /** See {@link #setTaskViewVisible(TaskViewTaskController, boolean, boolean, boolean)}. */ public void setTaskViewVisible(TaskViewTaskController taskView, boolean visible, boolean reorder) { setTaskViewVisible(taskView, visible, reorder, true /* toggleHiddenOnReorder */); setTaskViewVisible(taskView, visible, reorder, true /* syncHiddenWithVisibilityOnReorder */); } /** Loading @@ -484,13 +485,15 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV * be reordered as per the given {@code visible}. For {@code visible = true}, * task will be reordered to top. For {@code visible = false}, task will be * reordered to the bottom * @param toggleHiddenOnReorder Whether to also toggle the hidden state of the task. This only * takes effect if {@code reorder} is {@code true}. * @param syncHiddenWithVisibilityOnReorder Whether to also synchronize the hidden state of * the task with the target visibility when * reordering. This only takes effect if {@code * reorder} is {@code true}. * @throws IllegalStateException If the flag {@link FLAG_ENABLE_CREATE_ANY_BUBBLE} and * {@link FLAG_EXCLUDE_TASK_FROM_RECENTS} are not enabled. */ public void setTaskViewVisible(TaskViewTaskController taskView, boolean visible, boolean reorder, boolean toggleHiddenOnReorder) { boolean reorder, boolean syncHiddenWithVisibilityOnReorder) { final TaskViewRepository.TaskViewState state = useRepo() ? mTaskViewRepo.byTaskView(taskView) : mTaskViews.get(taskView); Loading @@ -504,12 +507,15 @@ public class TaskViewTransitions implements Transitions.TransitionHandler, TaskV final WindowContainerTransaction wct = new WindowContainerTransaction(); wct.setBounds(taskView.getTaskInfo().token, state.mBounds); if (reorder && !toggleHiddenOnReorder) { if (reorder && !syncHiddenWithVisibilityOnReorder) { if (!BubbleAnythingFlagHelper.enableCreateAnyBubbleWithForceExcludedFromRecents()) { throw new IllegalStateException( "Flag " + FLAG_ENABLE_CREATE_ANY_BUBBLE + " and " + FLAG_EXCLUDE_TASK_FROM_RECENTS + " are not enabled"); } // Reset hidden state to fix corner case where surface was destroyed before task // appeared in #prepareOpenAnimation. wct.setHidden(taskView.getTaskInfo().token, false /* hidden */); // Order of setAlwaysOnTop() and reorder() matters; hierarchy ops apply sequentially. wct.setAlwaysOnTop(taskView.getTaskInfo().token, visible /* alwaysOnTop */); } else { Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/taskview/TaskViewTransitionsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { } @Test public void testSetTaskVisibility_reorderNoToggleHidden_resetsAlwaysOnTopAndReorder() { public void testSetTaskVisibility_reorderNoHiddenVisibilitySync_resetsAlwaysOnTopAndReorder() { assumeTrue(Transitions.ENABLE_SHELL_TRANSITIONS); assumeTrue(TaskViewTransitions.useRepo()); assumeTrue(BubbleAnythingFlagHelper.enableCreateAnyBubbleWithForceExcludedFromRecents()); Loading @@ -297,7 +297,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { when(mToken.asBinder()).thenReturn(mockBinder); mTaskViewTransitions.setTaskViewVisible(mTaskViewTaskController, false /* visible */, true /* reorder */, false /* toggleHiddenOnReorder */); true /* reorder */, false /* syncHiddenWithVisibilityOnReorder */); final TaskViewTransitions.PendingTransition pending = mTaskViewTransitions.findPending(mTaskViewTaskController, TRANSIT_TO_BACK); Loading @@ -306,6 +306,7 @@ public class TaskViewTransitionsTest extends ShellTestCase { assertThat(chgs.keySet()).containsExactly(mockBinder); assertThat(chgs.get(mockBinder).getConfiguration().windowConfiguration.getBounds()) .isEqualTo(bounds); assertThat(chgs.get(mockBinder).getHidden()).isFalse(); final List<WindowContainerTransaction.HierarchyOp> ops = pending.mWct.getHierarchyOps(); assertThat(ops).hasSize(2); assertThat(ops.get(0).isAlwaysOnTop()).isFalse(); Loading