Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5de9b6e authored by Louis Chang's avatar Louis Chang
Browse files

Avoid launching bubble task in multiple task

This allows the system to reuse the existing task if any.

Bug: 395020814
Test: manually launch app normally and into bubble.
Flag: com.android.wm.shell.enable_bubble_anything
Change-Id: Ia9a716771ca6e3bb5eff4d592b10c6422d2daea4
parent afbdde0d
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -266,8 +266,6 @@ class BubbleTaskViewListenerTest {
            optionsCaptor.capture(),
            any())

        assertThat((intentCaptor.lastValue.flags
                and Intent.FLAG_ACTIVITY_MULTIPLE_TASK) != 0).isTrue()
        assertThat(optionsCaptor.lastValue.launchedFromBubble).isFalse() // chat only
        assertThat(optionsCaptor.lastValue.isApplyActivityFlagsForBubbles).isFalse() // chat only
        assertThat(optionsCaptor.lastValue.taskAlwaysOnTop).isTrue()
@@ -295,8 +293,6 @@ class BubbleTaskViewListenerTest {
            optionsCaptor.capture(),
            any())

        assertThat((intentCaptor.lastValue.flags
                and Intent.FLAG_ACTIVITY_MULTIPLE_TASK) != 0).isTrue()
        assertThat(optionsCaptor.lastValue.launchedFromBubble).isFalse() // chat only
        assertThat(optionsCaptor.lastValue.isApplyActivityFlagsForBubbles).isFalse() // chat only
        assertThat(optionsCaptor.lastValue.taskAlwaysOnTop).isTrue()
@@ -324,8 +320,6 @@ class BubbleTaskViewListenerTest {
            optionsCaptor.capture(),
            any())

        assertThat((intentCaptor.lastValue.flags
                and Intent.FLAG_ACTIVITY_MULTIPLE_TASK) != 0).isTrue()
        assertThat(optionsCaptor.lastValue.launchedFromBubble).isFalse() // chat only
        assertThat(optionsCaptor.lastValue.isApplyActivityFlagsForBubbles).isFalse() // chat only
        assertThat(optionsCaptor.lastValue.taskAlwaysOnTop).isTrue()
+0 −1
Original line number Diff line number Diff line
@@ -238,7 +238,6 @@ public class BubbleExpandedView extends LinearLayout {
                                mContext.createContextAsUser(
                                        mBubble.getUser(), Context.CONTEXT_RESTRICTED);
                        Intent fillInIntent = new Intent();
                        fillInIntent.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                        PendingIntent pi = PendingIntent.getActivity(
                                context,
                                /* requestCode= */ 0,
+0 −1
Original line number Diff line number Diff line
@@ -130,7 +130,6 @@ public class BubbleTaskViewListener implements TaskView.Listener {
                            mContext.createContextAsUser(
                                    mBubble.getUser(), Context.CONTEXT_RESTRICTED);
                    Intent fillInIntent = new Intent();
                    fillInIntent.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                    // First try get pending intent from the bubble
                    PendingIntent pi = mBubble.getPendingIntent();
                    if (pi == null) {