diff options
author | Vladimir Marko <vmarko@google.com> | 2015-06-22 08:53:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-22 08:53:52 +0000 |
commit | c28695079e3511e02845bad9d730753daefba8a3 (patch) | |
tree | 127c889c33514a0ff88c01369e76aa2dc2062546 /services | |
parent | 37099a082f7e0b106e22cc59fa92ba6a3656ebb2 (diff) | |
parent | 2526f33df0c387faead0350a5cdb09ba144dea99 (diff) | |
download | frameworks_base-c28695079e3511e02845bad9d730753daefba8a3.zip frameworks_base-c28695079e3511e02845bad9d730753daefba8a3.tar.gz frameworks_base-c28695079e3511e02845bad9d730753daefba8a3.tar.bz2 |
Merge "Don't prevent notification updates in DOS protection." into mnc-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 9c288be..0dcad82 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1969,6 +1969,9 @@ public class NotificationManagerService extends SystemService { for (int i=0; i<N; i++) { final NotificationRecord r = mNotificationList.get(i); if (r.sbn.getPackageName().equals(pkg) && r.sbn.getUserId() == userId) { + if (r.sbn.getId() == id && TextUtils.equals(r.sbn.getTag(), tag)) { + break; // Allow updating existing notification + } count++; if (count >= MAX_PACKAGE_NOTIFICATIONS) { Slog.e(TAG, "Package has already posted " + count @@ -2999,19 +3002,8 @@ public class NotificationManagerService extends SystemService { final int len = list.size(); for (int i=0; i<len; i++) { NotificationRecord r = list.get(i); - if (!notificationMatchesUserId(r, userId) || r.sbn.getId() != id) { - continue; - } - if (tag == null) { - if (r.sbn.getTag() != null) { - continue; - } - } else { - if (!tag.equals(r.sbn.getTag())) { - continue; - } - } - if (r.sbn.getPackageName().equals(pkg)) { + if (notificationMatchesUserId(r, userId) && r.sbn.getId() == id && + TextUtils.equals(r.sbn.getTag(), tag) && r.sbn.getPackageName().equals(pkg)) { return i; } } |