commit | 623c48ccaf2729a2413c74a6daae4b5a12919c98 | [log] [tgz] |
---|---|---|
author | Julia Reynolds <juliacr@google.com> | Wed Jun 22 16:59:59 2016 +0000 |
committer | android-build-merger <android-build-merger@google.com> | Wed Jun 22 16:59:59 2016 +0000 |
tree | cd216e37884f1dca76ed063cf1f9ac47aa97c626 | |
parent | a831c0e366ebb7d3de98cf62c3c19a03f2decfc4 [diff] | |
parent | 2ea9c9280de3275b94897a2b956b5b66293e42a6 [diff] |
Don\\\'t iterate over a list items are removed from. am: 00d9d9f11e am: a45f1e74b0 am: 2ea9c9280d Change-Id: Ibc9e5d64a67db6c4953374c8a8e7bb7f4dc292e5
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); } }