Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +3 −3 Original line number Diff line number Diff line Loading @@ -304,7 +304,7 @@ public class BubbleTransitions { for (int i = 0; i < info.getChanges().size(); i++) { final TransitionInfo.Change chg = info.getChanges().get(i); final ActivityManager.RunningTaskInfo taskInfo = chg.getTaskInfo(); // Exclude activity transition scenarios. // Exclude non-standard activity transition scenarios. if (taskInfo == null || taskInfo.getActivityType() != ACTIVITY_TYPE_STANDARD) { continue; } Loading @@ -330,7 +330,7 @@ public class BubbleTransitions { for (int i = 0; i < info.getChanges().size(); i++) { final TransitionInfo.Change chg = info.getChanges().get(i); final ActivityManager.RunningTaskInfo taskInfo = chg.getTaskInfo(); // Exclude activity transition scenarios. // Exclude non-standard activity transition scenarios. if (taskInfo == null || taskInfo.getActivityType() != ACTIVITY_TYPE_STANDARD) { continue; } Loading @@ -351,7 +351,7 @@ public class BubbleTransitions { * Whether the transition contains any Task that is changed from expanded App Bubbled to * non-Bubbled. */ public boolean containsNonBubbledExpandedTaskInStack(@NonNull TransitionInfo info) { public boolean containsExpandedBubbledTaskNoLongerBubbled(@NonNull TransitionInfo info) { if (!mBubbleData.isExpanded() || mBubbleData.getSelectedBubble() == null) { // No expanded. return false; Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedTransition.java +1 −1 Original line number Diff line number Diff line Loading @@ -481,7 +481,7 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { // The trigger Task is no longer in Bubble (Case 1/2/4) ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " No bubbling task found"); if (bubbleTransitions.containsNonBubbledExpandedTaskInStack(info)) { if (bubbleTransitions.containsExpandedBubbledTaskNoLongerBubbled(info)) { // The expanded Bubbled Task is no longer Bubbled (Case 2) ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " An activity launch converted the expanded Bubbled Task to non-Bubbled"); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleTransitionsTest.java +23 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_CLOSE; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_BAR; Loading Loading @@ -1123,4 +1124,26 @@ public class BubbleTransitionsTest extends ShellTestCase { assertThat(mBubbleTransitions.getClosingBubbleTask(info)).isEqualTo(closingBubble); } @Test public void testGetClosingBubbleTask_excludeChangeAndToBack() { final SurfaceControl leash = new SurfaceControl.Builder().setName("testLeash").build(); final ActivityManager.RunningTaskInfo taskInfo0 = setupAppBubble(); final ActivityManager.RunningTaskInfo taskInfo1 = setupAppBubble(); final TransitionInfo info = new TransitionInfo(TRANSIT_OPEN, 0); final TransitionInfo.Change openingBubble = new TransitionInfo.Change( taskInfo0.token, leash); openingBubble.setTaskInfo(taskInfo0); openingBubble.setMode(TRANSIT_CHANGE); final TransitionInfo.Change closingBubble = new TransitionInfo.Change( taskInfo1.token, leash); closingBubble.setTaskInfo(taskInfo1); closingBubble.setMode(TRANSIT_TO_BACK); info.addChange(openingBubble); info.addChange(closingBubble); info.addRoot(new TransitionInfo.Root(0, mock(SurfaceControl.class), 0, 0)); assertThat(mBubbleTransitions.getClosingBubbleTask(info)).isNull(); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +3 −3 Original line number Diff line number Diff line Loading @@ -304,7 +304,7 @@ public class BubbleTransitions { for (int i = 0; i < info.getChanges().size(); i++) { final TransitionInfo.Change chg = info.getChanges().get(i); final ActivityManager.RunningTaskInfo taskInfo = chg.getTaskInfo(); // Exclude activity transition scenarios. // Exclude non-standard activity transition scenarios. if (taskInfo == null || taskInfo.getActivityType() != ACTIVITY_TYPE_STANDARD) { continue; } Loading @@ -330,7 +330,7 @@ public class BubbleTransitions { for (int i = 0; i < info.getChanges().size(); i++) { final TransitionInfo.Change chg = info.getChanges().get(i); final ActivityManager.RunningTaskInfo taskInfo = chg.getTaskInfo(); // Exclude activity transition scenarios. // Exclude non-standard activity transition scenarios. if (taskInfo == null || taskInfo.getActivityType() != ACTIVITY_TYPE_STANDARD) { continue; } Loading @@ -351,7 +351,7 @@ public class BubbleTransitions { * Whether the transition contains any Task that is changed from expanded App Bubbled to * non-Bubbled. */ public boolean containsNonBubbledExpandedTaskInStack(@NonNull TransitionInfo info) { public boolean containsExpandedBubbledTaskNoLongerBubbled(@NonNull TransitionInfo info) { if (!mBubbleData.isExpanded() || mBubbleData.getSelectedBubble() == null) { // No expanded. return false; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedTransition.java +1 −1 Original line number Diff line number Diff line Loading @@ -481,7 +481,7 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { // The trigger Task is no longer in Bubble (Case 1/2/4) ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " No bubbling task found"); if (bubbleTransitions.containsNonBubbledExpandedTaskInStack(info)) { if (bubbleTransitions.containsExpandedBubbledTaskNoLongerBubbled(info)) { // The expanded Bubbled Task is no longer Bubbled (Case 2) ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " An activity launch converted the expanded Bubbled Task to non-Bubbled"); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleTransitionsTest.java +23 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_CLOSE; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; import static com.android.wm.shell.Flags.FLAG_ENABLE_BUBBLE_BAR; Loading Loading @@ -1123,4 +1124,26 @@ public class BubbleTransitionsTest extends ShellTestCase { assertThat(mBubbleTransitions.getClosingBubbleTask(info)).isEqualTo(closingBubble); } @Test public void testGetClosingBubbleTask_excludeChangeAndToBack() { final SurfaceControl leash = new SurfaceControl.Builder().setName("testLeash").build(); final ActivityManager.RunningTaskInfo taskInfo0 = setupAppBubble(); final ActivityManager.RunningTaskInfo taskInfo1 = setupAppBubble(); final TransitionInfo info = new TransitionInfo(TRANSIT_OPEN, 0); final TransitionInfo.Change openingBubble = new TransitionInfo.Change( taskInfo0.token, leash); openingBubble.setTaskInfo(taskInfo0); openingBubble.setMode(TRANSIT_CHANGE); final TransitionInfo.Change closingBubble = new TransitionInfo.Change( taskInfo1.token, leash); closingBubble.setTaskInfo(taskInfo1); closingBubble.setMode(TRANSIT_TO_BACK); info.addChange(openingBubble); info.addChange(closingBubble); info.addRoot(new TransitionInfo.Root(0, mock(SurfaceControl.class), 0, 0)); assertThat(mBubbleTransitions.getClosingBubbleTask(info)).isNull(); } }