From 5d423844f253951a1d79dabe638aba81a21207bc Mon Sep 17 00:00:00 2001 From: Christoph Studer Date: Fri, 23 May 2014 13:15:54 +0200 Subject: NoMan: Don't unbind system listeners Listeners registered via INotificationMananger.registerListener() must not be unbound by NoMan because it won't be able to re-bind them later. Bug: 15131411 Change-Id: Ic5088252c86e7c32c522ba1606f123cefde3720d --- .../java/com/android/server/notification/ManagedServices.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java index b94ea62..1b1fc8b 100644 --- a/services/core/java/com/android/server/notification/ManagedServices.java +++ b/services/core/java/com/android/server/notification/ManagedServices.java @@ -259,13 +259,17 @@ abstract public class ManagedServices { userIds[i])); } - ManagedServiceInfo[] toRemove = new ManagedServiceInfo[mServices.size()]; + ArrayList toRemove = new ArrayList(); final SparseArray> toAdd = new SparseArray>(); synchronized (mMutex) { - // unbind and remove all existing services - toRemove = mServices.toArray(toRemove); + // Unbind automatically bound services, retain system services. + for (ManagedServiceInfo service : mServices) { + if (!service.isSystem) { + toRemove.add(service); + } + } final ArraySet newEnabled = new ArraySet(); final ArraySet newPackages = new ArraySet(); -- cgit v1.1