Loading services/core/java/com/android/server/notification/ManagedServices.java +17 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,10 @@ abstract public class ManagedServices { // Just the packages from mEnabledServicesForCurrentProfiles private ArraySet<String> mEnabledServicesPackageNames = new ArraySet<String>(); // Kept to de-dupe user change events (experienced after boot, when we receive a settings and a // user change). private int[] mLastSeenProfileIds; public ManagedServices(Context context, Handler handler, Object mutex, UserProfiles userProfiles) { mContext = context; Loading Loading @@ -159,6 +163,15 @@ abstract public class ManagedServices { } } public void onUserSwitched() { if (DEBUG) Slog.d(TAG, "onUserSwitched"); if (Arrays.equals(mLastSeenProfileIds, mUserProfiles.getCurrentProfileIds())) { if (DEBUG) Slog.d(TAG, "Current profile IDs didn't change, skipping rebindServices()."); return; } rebindServices(); } public ManagedServiceInfo checkServiceTokenLocked(IInterface service) { checkNotNull(service); final IBinder token = service.asBinder(); Loading Loading @@ -321,6 +334,8 @@ abstract public class ManagedServices { registerService(component, userIds[i]); } } mLastSeenProfileIds = mUserProfiles.getCurrentProfileIds(); } /** Loading Loading @@ -523,6 +538,8 @@ abstract public class ManagedServices { private void update(Uri uri) { if (uri == null || mSecureSettingsUri.equals(uri)) { if (DEBUG) Slog.d(TAG, "Setting changed: mSecureSettingsUri=" + mSecureSettingsUri + " / uri=" + uri); rebindServices(); } } Loading services/core/java/com/android/server/notification/NotificationManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -718,6 +718,9 @@ public class NotificationManagerService extends SystemService { // reload per-user settings mSettingsObserver.update(null); mUserProfiles.updateCache(context); // Refresh managed services mConditionProviders.onUserSwitched(); mListeners.onUserSwitched(); } else if (action.equals(Intent.ACTION_USER_ADDED)) { mUserProfiles.updateCache(context); } Loading Loading
services/core/java/com/android/server/notification/ManagedServices.java +17 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,10 @@ abstract public class ManagedServices { // Just the packages from mEnabledServicesForCurrentProfiles private ArraySet<String> mEnabledServicesPackageNames = new ArraySet<String>(); // Kept to de-dupe user change events (experienced after boot, when we receive a settings and a // user change). private int[] mLastSeenProfileIds; public ManagedServices(Context context, Handler handler, Object mutex, UserProfiles userProfiles) { mContext = context; Loading Loading @@ -159,6 +163,15 @@ abstract public class ManagedServices { } } public void onUserSwitched() { if (DEBUG) Slog.d(TAG, "onUserSwitched"); if (Arrays.equals(mLastSeenProfileIds, mUserProfiles.getCurrentProfileIds())) { if (DEBUG) Slog.d(TAG, "Current profile IDs didn't change, skipping rebindServices()."); return; } rebindServices(); } public ManagedServiceInfo checkServiceTokenLocked(IInterface service) { checkNotNull(service); final IBinder token = service.asBinder(); Loading Loading @@ -321,6 +334,8 @@ abstract public class ManagedServices { registerService(component, userIds[i]); } } mLastSeenProfileIds = mUserProfiles.getCurrentProfileIds(); } /** Loading Loading @@ -523,6 +538,8 @@ abstract public class ManagedServices { private void update(Uri uri) { if (uri == null || mSecureSettingsUri.equals(uri)) { if (DEBUG) Slog.d(TAG, "Setting changed: mSecureSettingsUri=" + mSecureSettingsUri + " / uri=" + uri); rebindServices(); } } Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -718,6 +718,9 @@ public class NotificationManagerService extends SystemService { // reload per-user settings mSettingsObserver.update(null); mUserProfiles.updateCache(context); // Refresh managed services mConditionProviders.onUserSwitched(); mListeners.onUserSwitched(); } else if (action.equals(Intent.ACTION_USER_ADDED)) { mUserProfiles.updateCache(context); } Loading