diff options
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 386402b83ed9..05aa2c7f5ef2 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2264,16 +2264,15 @@ 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) { updateLightsLocked(); |