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

Commit c3c7fc35 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

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

Merge "Only remove bubbles with null shortcutinfo if they have a shortcut ID." into rvc-dev am: 7ca0ea68 am: 7fda6416 am: 15c33a10 am: c7d35ea3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11977430

Change-Id: I4ca0dc0549f9207c7237b81b7b83a2718c412a24
parents 4066e20e c7d35ea3
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);