commit | a45f1e74b03b85aa517ee021c8e1dd366fbdf7bb | [log] [tgz] |
---|---|---|
author | Julia Reynolds <juliacr@google.com> | Wed Jun 22 16:48:18 2016 +0000 |
committer | android-build-merger <android-build-merger@google.com> | Wed Jun 22 16:48:18 2016 +0000 |
tree | 18bfcfc64e83fafc51857bd175391a3874568763 | |
parent | be7b7690e54e56e1451e06bfb6bd0d5f1f1bfe1c [diff] | |
parent | 00d9d9f11e7645059b8dbce4d80e8fc7ca5312d0 [diff] |
Don\'t iterate over a list items are removed from. am: 00d9d9f11e Change-Id: I206627eafbfb274dcd27dfba41a4e9d06db9d2ac
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index dfdfc5f..c4af9ea 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3898,7 +3898,9 @@ @Override public void onUserSwitched(int user) { synchronized (mNotificationList) { - for (ManagedServiceInfo info : mServices) { + int i = mServices.size()-1; + while (i --> 0) { + final ManagedServiceInfo info = mServices.get(i); unregisterService(info.service, info.userid); } }