summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jaewan Kim <jaewan@google.com> 2017-09-29 04:07:26 +0000
committer android-build-merger <android-build-merger@google.com> 2017-09-29 04:07:26 +0000
commit30e11514960164328bf77d503548e52f28bcbaab (patch)
tree5aaaa5ba208117715ae26d69027812bc475013f4
parent591cf59e7319ab2b52a62c9d4ab035f3e728b353 (diff)
parente9f85bdb0e13bed49c60ca7c943b585e43ff1093 (diff)
Merge "Add multiuser support for enabling notification listener" into oc-mr1-dev am: e98975db32
am: e9f85bdb0e Change-Id: I46dbbcf06d7166959502e6849fd5be8ff900009a
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 610717431f80..6e84dd211692 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -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;
}
- getBinderService().setNotificationListenerAccessGranted(cn, true);
+ 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;
}
- getBinderService().setNotificationListenerAccessGranted(cn, false);
+ String userId = getNextArg();
+ if (userId == null) {
+ getBinderService().setNotificationListenerAccessGranted(cn, false);
+ } else {
+ getBinderService().setNotificationListenerAccessGrantedForUser(
+ cn, Integer.parseInt(userId), false);
+ }
}
break;
case "allow_assistant": {