OSDN Git Service

Ensure getNotificationKeysForItem() returns empty on unsupported items.
authorTony Wickham <twickham@google.com>
Wed, 1 Feb 2017 17:58:40 +0000 (09:58 -0800)
committerTony Wickham <twickham@google.com>
Wed, 1 Feb 2017 17:58:40 +0000 (09:58 -0800)
We were bypassing the check in getBadgeInfoForItem(), which meant
we would return notifications based on package/user regardless of
the item type. In particular, deep shortcuts would show notifications
when long-pressed.

Bug: 34866646
Change-Id: I6575a28539313c0c5d0eea1cbf7b7726f747bcd5

src/com/android/launcher3/popup/PopupDataProvider.java

index c773079..bb9c520 100644 (file)
@@ -148,7 +148,7 @@ public class PopupDataProvider implements NotificationListener.NotificationsChan
     }
 
     public String[] getNotificationKeysForItem(ItemInfo info) {
-        BadgeInfo badgeInfo = mPackageUserToBadgeInfos.get(PackageUserKey.fromItemInfo(info));
+        BadgeInfo badgeInfo = getBadgeInfoForItem(info);
         if (badgeInfo == null) { return new String[0]; }
         List<String> notificationKeys = badgeInfo.getNotificationKeys();
         return notificationKeys.toArray(new String[notificationKeys.size()]);