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

Commit a5d19f6b authored by Josh Tsuji's avatar Josh Tsuji Committed by Joshua Tsuji
Browse files

Only remove bubbles with null shortcutinfo if they have a shortcut ID.

Test: manual
Bug: 159719877
Change-Id: Ia46240884b0c8824e03fbcc5c24e0aa8dbb94301
parent f9836b01
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -366,11 +366,15 @@ public class BubbleData {
            validShortcutIds.add(info.getId());
        }

        final Predicate<Bubble> invalidBubblesFromPackage = bubble ->
                packageName.equals(bubble.getPackageName())
                        && (bubble.getShortcutInfo() == null
                            || !bubble.getShortcutInfo().isEnabled()
                            || !validShortcutIds.contains(bubble.getShortcutInfo().getId()));
        final Predicate<Bubble> invalidBubblesFromPackage = bubble -> {
            final boolean bubbleIsFromPackage = packageName.equals(bubble.getPackageName());
            final boolean hasShortcutIdAndValidShortcut =
                    bubble.hasMetadataShortcutId()
                            && bubble.getShortcutInfo() != null
                            && bubble.getShortcutInfo().isEnabled()
                            && validShortcutIds.contains(bubble.getShortcutInfo().getId());
            return bubbleIsFromPackage && !hasShortcutIdAndValidShortcut;
        };

        final Consumer<Bubble> removeBubble = bubble ->
                dismissBubbleWithKey(bubble.getKey(), reason);