summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ned Burns <pixel@google.com> 2019-09-25 17:45:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-09-25 17:45:44 +0000
commit0ac7555beb915a75f13e193feec8df0bf1244e03 (patch)
treeb35a29c4710e09c1d83290a7af9f8f49475d52c5
parent03b7db401a9f43f7ffeb6d93366b86c646e4ede7 (diff)
parente372f3297edc3d5bc8f9f69754217b63e74fb1df (diff)
Merge "Fix NPE when updating rankings for pending notifs"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
index b6b149dd049a..90301c59dc68 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
@@ -22,6 +22,7 @@ import android.annotation.Nullable;
import android.app.Notification;
import android.content.Context;
import android.service.notification.NotificationListenerService;
+import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.StatusBarNotification;
import android.util.ArrayMap;
import android.util.Log;
@@ -390,7 +391,7 @@ public class NotificationEntryManager implements
}
mNotificationData.updateRanking(rankingMap);
- NotificationListenerService.Ranking ranking = new NotificationListenerService.Ranking();
+ Ranking ranking = new Ranking();
rankingMap.getRanking(key, ranking);
NotificationEntry entry = new NotificationEntry(notification, ranking);
@@ -513,10 +514,11 @@ public class NotificationEntryManager implements
if (rankingMap == null) {
return;
}
- NotificationListenerService.Ranking ranking = new NotificationListenerService.Ranking();
for (NotificationEntry pendingNotification : mPendingNotifications.values()) {
- rankingMap.getRanking(pendingNotification.key, ranking);
- pendingNotification.setRanking(ranking);
+ Ranking ranking = new Ranking();
+ if (rankingMap.getRanking(pendingNotification.key(), ranking)) {
+ pendingNotification.setRanking(ranking);
+ }
}
}