Skip to content
Snippets Groups Projects
Commit de73e3dd authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

Merge "NotificationManagerService: add right lock for some methods." into main...

Merge "NotificationManagerService: add right lock for some methods." into main am: a64fca58 am: dbf21119

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3109837



Change-Id: I2859c94ba5e1abd8727c92b55cd457015aa6571a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ae8fb7fa dbf21119
No related branches found
No related tags found
No related merge requests found
......@@ -2311,7 +2311,7 @@ public class NotificationManagerService extends SystemService {
 
@VisibleForTesting
void clearNotifications() {
synchronized (mNotificationList) {
synchronized (mNotificationLock) {
mEnqueuedNotifications.clear();
mNotificationList.clear();
mNotificationsByKey.clear();
......@@ -2321,21 +2321,27 @@ public class NotificationManagerService extends SystemService {
 
@VisibleForTesting
void addNotification(NotificationRecord r) {
mNotificationList.add(r);
mNotificationsByKey.put(r.getSbn().getKey(), r);
if (r.getSbn().isGroup()) {
mSummaryByGroupKey.put(r.getGroupKey(), r);
synchronized (mNotificationLock) {
mNotificationList.add(r);
mNotificationsByKey.put(r.getSbn().getKey(), r);
if (r.getSbn().isGroup()) {
mSummaryByGroupKey.put(r.getGroupKey(), r);
}
}
}
 
@VisibleForTesting
void addEnqueuedNotification(NotificationRecord r) {
mEnqueuedNotifications.add(r);
synchronized (mNotificationLock) {
mEnqueuedNotifications.add(r);
}
}
 
@VisibleForTesting
NotificationRecord getNotificationRecord(String key) {
return mNotificationsByKey.get(key);
synchronized (mNotificationLock) {
return mNotificationsByKey.get(key);
}
}
 
@VisibleForTesting
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment