summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java13
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 06732caef530..825dc84dd876 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -2268,16 +2268,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();