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

Commit 4d096298 authored by Tony Wickham's avatar Tony Wickham
Browse files

Ensure getNotificationKeysForItem() returns empty on unsupported items.

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
parent bdbfd5bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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()]);