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

Commit 30e11514 authored by Jaewan Kim's avatar Jaewan Kim Committed by android-build-merger
Browse files

Merge "Add multiuser support for enabling notification listener" into oc-mr1-dev am: e98975db

am: e9f85bdb

Change-Id: I46dbbcf06d7166959502e6849fd5be8ff900009a
parents 591cf59e e9f85bdb
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -5904,8 +5904,8 @@ public class NotificationManagerService extends SystemService {

    private class ShellCmd extends ShellCommand {
        public static final String USAGE = "help\n"
                + "allow_listener COMPONENT\n"
                + "disallow_listener COMPONENT\n"
                + "allow_listener COMPONENT [user_id]\n"
                + "disallow_listener COMPONENT [user_id]\n"
                + "set_assistant COMPONENT\n"
                + "remove_assistant COMPONENT\n"
                + "allow_dnd PACKAGE\n"
@@ -5936,7 +5936,13 @@ public class NotificationManagerService extends SystemService {
                            pw.println("Invalid listener - must be a ComponentName");
                            return -1;
                        }
                        String userId = getNextArg();
                        if (userId == null) {
                            getBinderService().setNotificationListenerAccessGranted(cn, true);
                        } else {
                            getBinderService().setNotificationListenerAccessGrantedForUser(
                                    cn, Integer.parseInt(userId), true);
                        }
                    }
                    break;
                    case "disallow_listener": {
@@ -5945,7 +5951,13 @@ public class NotificationManagerService extends SystemService {
                            pw.println("Invalid listener - must be a ComponentName");
                            return -1;
                        }
                        String userId = getNextArg();
                        if (userId == null) {
                            getBinderService().setNotificationListenerAccessGranted(cn, false);
                        } else {
                            getBinderService().setNotificationListenerAccessGrantedForUser(
                                    cn, Integer.parseInt(userId), false);
                        }
                    }
                    break;
                    case "allow_assistant": {