From 3ec4e7050aabf9a9e42a9c7aec7d61caa2c33ae5 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Thu, 16 May 2013 13:42:38 -0400 Subject: [PATCH] Rebind notification listeners for current user. Use ForUser overload when reading setting inside system server. Bug: 9000206 Change-Id: Ie87aed578d29425d8f32b23aeb8aa7118922c889 --- .../com/android/server/NotificationManagerService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index fac1fe83ed1c2..f9b6eba68b60a 100644 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -537,13 +537,14 @@ public class NotificationManagerService extends INotificationManager.Stub * is altered. (For example in response to USER_SWITCHED in our broadcast receiver) */ void rebindListenerServices() { - String flat = Settings.Secure.getString( + final int currentUser = ActivityManager.getCurrentUser(); + String flat = Settings.Secure.getStringForUser( mContext.getContentResolver(), - Settings.Secure.ENABLED_NOTIFICATION_LISTENERS); + Settings.Secure.ENABLED_NOTIFICATION_LISTENERS, + currentUser); NotificationListenerInfo[] toRemove = new NotificationListenerInfo[mListeners.size()]; final ArrayList toAdd; - final int currentUser = ActivityManager.getCurrentUser(); synchronized (mNotificationList) { // unbind and remove all existing listeners