From 0d1b6fa33be8313490ef1fdfe502f5217c0e8b62 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Fri, 1 Apr 2022 22:08:40 +0200 Subject: [PATCH] Ignore notifications without shortcutId for notification badge number calculation --- .../launcher2/badges/providers/NotificationBadgeProvider.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt b/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt index 75b5aceb..79762755 100644 --- a/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt +++ b/badges/src/main/java/de/mm20/launcher2/badges/providers/NotificationBadgeProvider.kt @@ -27,7 +27,8 @@ class NotificationBadgeProvider : BadgeProvider, KoinComponent { } else { val badge = Badge( number = it.sumOf { - it.notification.number + if(it.notification.shortcutId == null) 0 + else it.notification.number }, progress = it.mapNotNull { if (!it.notification.extras.containsKey(Notification.EXTRA_PROGRESS)) return@mapNotNull null