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

Commit 26b6db36 authored by Christoph Studer's avatar Christoph Studer Committed by Android Git Automerger
Browse files

am afaf0c54: Prevent duplicate notifications

* commit 'afaf0c54731e126affcd3319a1d9a4f0da63411e':
  Prevent duplicate notifications
parents 7b1fda8c c5115556
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2268,15 +2268,14 @@ public class NotificationManagerService extends SystemService {

    // lock on mNotificationList
    int indexOfNotificationLocked(String key) {
        NotificationRecord r = mNotificationsByKey.get(key);
        if (r == null) {
            return -1;
        final int N = mNotificationList.size();
        for (int i = 0; i < N; i++) {
            if (key.equals(mNotificationList.get(i).getKey())) {
                return i;
            }
        int index = Collections.binarySearch(mNotificationList, r, mRankingComparator);
        // Guarantee to return -1 when not found.
        return (index >= 0) ? index : -1;
        }

        return -1;
    }

    private void updateNotificationPulse() {
        synchronized (mNotificationList) {