Merge "Autobundle all notifications; don't leave the most recent one free." into nyc-dev

This commit is contained in:
TreeHugger Robot
2016-05-09 18:04:21 +00:00
committed by Android (Google) Code Review

View File

@@ -73,14 +73,9 @@ public final class Ranker extends NotificationRankerService {
mUnbundledNotifications.put(sbn.getPackageName(), notificationsForPackage); mUnbundledNotifications.put(sbn.getPackageName(), notificationsForPackage);
if (notificationsForPackage.size() >= AUTOBUNDLE_AT_COUNT) { if (notificationsForPackage.size() >= AUTOBUNDLE_AT_COUNT) {
// Autobundle all but the most recently posted (not updated) notification.
int count = 0;
for (String key : notificationsForPackage) { for (String key : notificationsForPackage) {
if (count < notificationsForPackage.size() - 1) {
notificationsToBundle.add(key); notificationsToBundle.add(key);
} }
count++;
}
} }
} }
if (notificationsToBundle.size() > 0) { if (notificationsToBundle.size() > 0) {