Merge "Only remove bubbles with null shortcutinfo if they have a shortcut ID." into rvc-dev am: 7ca0ea6869

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

Change-Id: I981905f477963c8001225fdaa21b8359d12fd304
This commit is contained in:
Josh Tsuji
2020-06-24 15:57:59 +00:00
committed by Automerger Merge Worker

View File

@@ -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);