OSDN Git Service

Remove badge info from map when count is 0.
authorTony <twickham@google.com>
Mon, 13 Mar 2017 16:51:44 +0000 (12:51 -0400)
committerTony <twickham@google.com>
Mon, 13 Mar 2017 16:51:44 +0000 (12:51 -0400)
Bug: 35803112
Change-Id: I680b92aac24bf5d083d64e9a4cd35471637a3809

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

index ee2930f..f0ccb1b 100644 (file)
@@ -75,6 +75,9 @@ public class PopupDataProvider implements NotificationListener.NotificationsChan
             notificationWasAddedOrRemoved = shouldBeFilteredOut
                     ? badgeInfo.removeNotificationKey(notificationKey)
                     : badgeInfo.addNotificationKeyIfNotExists(notificationKey);
+            if (badgeInfo.getNotificationCount() == 0) {
+                mPackageUserToBadgeInfos.remove(postedPackageUserKey);
+            }
         }
         updateLauncherIconBadges(Utilities.singletonHashSet(postedPackageUserKey),
                 notificationWasAddedOrRemoved);