Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ec4e705 authored by John Spurlock's avatar John Spurlock
Browse files

Rebind notification listeners for current user.

Use ForUser overload when reading setting inside system server.

Bug: 9000206
Change-Id: Ie87aed578d29425d8f32b23aeb8aa7118922c889
parent 02ea97b5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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<ComponentName> toAdd;
        final int currentUser = ActivityManager.getCurrentUser();

        synchronized (mNotificationList) {
            // unbind and remove all existing listeners