From ad92957ee31c756d3f2b3ada45357e4a180e82e3 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 26 May 2016 13:49:17 -0400 Subject: [PATCH] Unlocked access of mServices is bad. Change-Id: I626d2daffb3669c7bea4856f8ee66dbd13951163 Fixes: 28979051 --- .../server/notification/NotificationManagerService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 946e4f7e70671..cf4669d777894 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -3813,8 +3813,10 @@ public class NotificationManagerService extends SystemService { @Override public void onUserSwitched(int user) { - for (ManagedServiceInfo info : mServices) { - unregisterService(info.service, info.userid); + synchronized (mNotificationList) { + for (ManagedServiceInfo info : mServices) { + unregisterService(info.service, info.userid); + } } registerRanker(); }