From 340103ba4b9d3ec5a4c082e7f9e5bd9337ed1759 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Wed, 24 Jun 2020 16:15:48 -0700 Subject: [PATCH] Fix invalid bubble predicate once and for all Predicate to remove a bubble was returning true for pending intent based bubbles & removing them accidentally. Test: manual - 1) Use test app with pending intent based bubbles 2) Add a bubble from the app, leave the app 3) Open the app (causes shortcut change) => bubble sticks around 1) Use test app with shortcut based bubbles 2) Add a bubble from the app, leave the app 3) Open the app 4) removeLongLivedShortcuts => bubble removed Bug: 159719877 Change-Id: Id17423718669f5b829988c43204941f5535980cd --- .../SystemUI/src/com/android/systemui/bubbles/BubbleData.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java index acbde9fa3efa5..c170ee271e1db 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java @@ -368,6 +368,10 @@ public class BubbleData { final Predicate invalidBubblesFromPackage = bubble -> { final boolean bubbleIsFromPackage = packageName.equals(bubble.getPackageName()); + final boolean isShortcutBubble = bubble.hasMetadataShortcutId(); + if (!bubbleIsFromPackage || !isShortcutBubble) { + return false; + } final boolean hasShortcutIdAndValidShortcut = bubble.hasMetadataShortcutId() && bubble.getShortcutInfo() != null