summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/badge
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-03-24 11:31:12 -0700
committerTony Wickham <twickham@google.com>2017-03-24 14:18:53 -0700
commit2f5bb169154d25bc8c164f057117fb056ad2de96 (patch)
tree04bd51eef88d60dadf5913306ac0c5aa120267a0 /src/com/android/launcher3/badge
parented68728b1f22bc849e0567f2be3aeaf6798440ca (diff)
downloadandroid_packages_apps_Trebuchet-2f5bb169154d25bc8c164f057117fb056ad2de96.tar.gz
android_packages_apps_Trebuchet-2f5bb169154d25bc8c164f057117fb056ad2de96.tar.bz2
android_packages_apps_Trebuchet-2f5bb169154d25bc8c164f057117fb056ad2de96.zip
De-dupe shortcuts with the same id as the main notification.
- Pass NotificationKeyData, which includes the shortcut id, instead of just the notification key from NotificationListener - Remove the shortcut with the same shortcut id as the first notification, if it has one, in PopupPopulator#sortAndFilterShorcuts() - Add some unit tests Bug: 36571718 Change-Id: I308941b34c525b34686583476e3f82ccb8b7e2d8
Diffstat (limited to 'src/com/android/launcher3/badge')
-rw-r--r--src/com/android/launcher3/badge/BadgeInfo.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/launcher3/badge/BadgeInfo.java b/src/com/android/launcher3/badge/BadgeInfo.java
index 532396cdd..d7aa4e8b3 100644
--- a/src/com/android/launcher3/badge/BadgeInfo.java
+++ b/src/com/android/launcher3/badge/BadgeInfo.java
@@ -25,6 +25,7 @@ import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import com.android.launcher3.notification.NotificationInfo;
+import com.android.launcher3.notification.NotificationKeyData;
import com.android.launcher3.util.PackageUserKey;
import java.util.ArrayList;
@@ -42,7 +43,7 @@ public class BadgeInfo {
* The keys of the notifications that this badge represents. These keys can later be
* used to retrieve {@link NotificationInfo}'s.
*/
- private List<String> mNotificationKeys;
+ private List<NotificationKeyData> mNotificationKeys;
/** This will only be initialized if the badge should display the notification icon. */
private NotificationInfo mNotificationInfo;
@@ -61,7 +62,7 @@ public class BadgeInfo {
/**
* Returns whether the notification was added (false if it already existed).
*/
- public boolean addNotificationKeyIfNotExists(String notificationKey) {
+ public boolean addNotificationKeyIfNotExists(NotificationKeyData notificationKey) {
if (mNotificationKeys.contains(notificationKey)) {
return false;
}
@@ -71,11 +72,11 @@ public class BadgeInfo {
/**
* Returns whether the notification was removed (false if it didn't exist).
*/
- public boolean removeNotificationKey(String notificationKey) {
+ public boolean removeNotificationKey(NotificationKeyData notificationKey) {
return mNotificationKeys.remove(notificationKey);
}
- public List<String> getNotificationKeys() {
+ public List<NotificationKeyData> getNotificationKeys() {
return mNotificationKeys;
}