Remove some obsolete notification badging code

Now that we only show dots instead of badges, we can simplify some logic
and remove a couple unused methods.

Change-Id: I72056eeb12e8968ec67b4c5b3a450d2ed5d4ee84
diff --git a/src/com/android/launcher3/dot/DotInfo.java b/src/com/android/launcher3/dot/DotInfo.java
index 9d0e5d3..15b2a3b 100644
--- a/src/com/android/launcher3/dot/DotInfo.java
+++ b/src/com/android/launcher3/dot/DotInfo.java
@@ -92,18 +92,4 @@
     public int getNotificationCount() {
         return Math.min(mTotalCount, MAX_COUNT);
     }
-
-    /**
-     * TODO: this is outdated now that we only show dots instead of icons/numbers. can remove?
-     * Whether newDot represents the same PackageUserKey as this badge, and icons with
-     * this badge should be invalidated. So, for instance, if a badge has 3 notifications
-     * and one of those notifications is updated, this method should return false because
-     * the badge still says "3" and the contents of those notifications are only retrieved
-     * upon long-click. This method always returns true when adding or removing notifications,
-     * or if the badge has a notification icon to show.
-     */
-    public boolean shouldBeInvalidated(DotInfo newDot) {
-        return mPackageUserKey.equals(newDot.mPackageUserKey)
-                && (getNotificationCount() != newDot.getNotificationCount());
-    }
 }
diff --git a/src/com/android/launcher3/notification/NotificationInfo.java b/src/com/android/launcher3/notification/NotificationInfo.java
index 92f2265..e5525b2 100644
--- a/src/com/android/launcher3/notification/NotificationInfo.java
+++ b/src/com/android/launcher3/notification/NotificationInfo.java
@@ -51,7 +51,6 @@
     public final boolean autoCancel;
     public final boolean dismissable;
 
-    private int mBadgeIcon;
     private Drawable mIconDrawable;
     private int mIconColor;
     private boolean mIsIconLarge;
@@ -66,10 +65,10 @@
         title = notification.extras.getCharSequence(Notification.EXTRA_TITLE);
         text = notification.extras.getCharSequence(Notification.EXTRA_TEXT);
 
-        mBadgeIcon = notification.getBadgeIconType();
+        int iconType = notification.getBadgeIconType();
         // Load the icon. Since it is backed by ashmem, we won't copy the entire bitmap
         // into our process as long as we don't touch it and it exists in systemui.
-        Icon icon = mBadgeIcon == Notification.BADGE_ICON_SMALL ? null : notification.getLargeIcon();
+        Icon icon = iconType == Notification.BADGE_ICON_SMALL ? null : notification.getLargeIcon();
         if (icon == null) {
             // Use the small icon.
             icon = notification.getSmallIcon();
@@ -85,7 +84,6 @@
             mIconDrawable = new BitmapDrawable(context.getResources(), LauncherAppState
                     .getInstance(context).getIconCache()
                     .getDefaultIcon(statusBarNotification.getUser()).icon);
-            mBadgeIcon = Notification.BADGE_ICON_NONE;
         }
         intent = notification.contentIntent;
         autoCancel = (notification.flags & Notification.FLAG_AUTO_CANCEL) != 0;
@@ -126,15 +124,4 @@
         icon.setTint(mIconColor);
         return icon;
     }
-
-    public boolean isIconLarge() {
-        return mIsIconLarge;
-    }
-
-    public boolean shouldShowIconInBadge() {
-        // If the icon we're using for this notification matches what the Notification
-        // specified should show in the badge, then return true.
-        return mIsIconLarge && mBadgeIcon == Notification.BADGE_ICON_LARGE
-                || !mIsIconLarge && mBadgeIcon == Notification.BADGE_ICON_SMALL;
-    }
 }
diff --git a/src/com/android/launcher3/popup/PopupDataProvider.java b/src/com/android/launcher3/popup/PopupDataProvider.java
index a718494..984a03d 100644
--- a/src/com/android/launcher3/popup/PopupDataProvider.java
+++ b/src/com/android/launcher3/popup/PopupDataProvider.java
@@ -115,8 +115,7 @@
                 dotInfo = new DotInfo(packageUserKey);
                 mPackageUserToDotInfos.put(packageUserKey, dotInfo);
             }
-            dotInfo.addOrUpdateNotificationKey(NotificationKeyData
-                    .fromNotification(notification));
+            dotInfo.addOrUpdateNotificationKey(NotificationKeyData.fromNotification(notification));
         }
 
         // Add and remove from updatedDots so it contains the PackageUserKeys of updated dots.
@@ -126,9 +125,10 @@
             if (prevDot == null) {
                 updatedDots.put(packageUserKey, newDot);
             } else {
-                if (!prevDot.shouldBeInvalidated(newDot)) {
-                    updatedDots.remove(packageUserKey);
-                }
+                // No need to update the dot if it already existed (no visual change).
+                // Note that if the dot was removed entirely, we wouldn't reach this point because
+                // this loop only includes active notifications added above.
+                updatedDots.remove(packageUserKey);
             }
         }