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

Commit c54de25c authored by Mady Mellor's avatar Mady Mellor
Browse files

Use the type not the null check to identify a shortcut bubble

The check here was looking for a shortcut bubble from bubble
anything. It did this by checking the flag + the presence of
a shortcut on the bubble. However, this would be true for
chat bubbles as well -- even if the chat isn't based on a
shortcut (apps could be using the pending intent API).

This led to a bug where we'd use the wrong content to
populate the bubble & the app would misbehave. This would
only occur when bubble anything is enabled.

Flag: com.android.wm.shell.enable_bubble_anything
Bug: 385361517
Test: manual - enable bubble anything and expand a
               signal bubble
             => observe that it expands correctly
Test: WIP -- extracting TaskView.Listener to make make it
      more testable
Change-Id: Id3e95dd9e12ad4a19aacf5e6691b145ac0046680
parent c0d7e900
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ public class BubbleExpandedView extends LinearLayout {
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);

                    final boolean isShortcutBubble = (mBubble.hasMetadataShortcutId()
                            || (mBubble.getShortcutInfo() != null
                            || (mBubble.isShortcut()
                            && BubbleAnythingFlagHelper.enableCreateAnyBubble()));

                    // TODO - currently based on type, really it's what the "launch item" is.
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public class BubbleTaskViewHelper {
                    options.setPendingIntentBackgroundActivityStartMode(
                            MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
                    final boolean isShortcutBubble = (mBubble.hasMetadataShortcutId()
                            || (mBubble.getShortcutInfo() != null
                            || (mBubble.isShortcut()
                            && BubbleAnythingFlagHelper.enableCreateAnyBubble()));
                    if (mBubble.getPreparingTransition() != null) {
                        mBubble.getPreparingTransition().surfaceCreated();