Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23de7c7c authored by Vladimir Marko's avatar Vladimir Marko Committed by Android Git Automerger
Browse files

am c2869507: Merge "Don\'t prevent notification updates in DOS protection." into mnc-dev

* commit 'c2869507':
  Don't prevent notification updates in DOS protection.
parents 84ace50d c2869507
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -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;
            }
        }