summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-08-02 11:09:55 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-08-02 11:37:43 -0700
commitcacdaa4aeedc6b0817eba92a83b8e5edfe27f637 (patch)
treef12313a55eeaa75f4faff3e1d134dc349420f094 /cmds
parent1ab48a3666118e40cf56142c886a7217b92d0d4a (diff)
parent4e4743a354e26467318b437892a9980eb9b8328a (diff)
downloadframeworks_base-cacdaa4aeedc6b0817eba92a83b8e5edfe27f637.zip
frameworks_base-cacdaa4aeedc6b0817eba92a83b8e5edfe27f637.tar.gz
frameworks_base-cacdaa4aeedc6b0817eba92a83b8e5edfe27f637.tar.bz2
Merge tag 'android-6.0.1_r61' into HEAD
Android 6.0.1 Release 61 (MOB30Z) Change-Id: Ib003ccb606e0d77209291b757ea36399d3b65814
Diffstat (limited to 'cmds')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 58c3a9c..4869adf 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -262,6 +262,10 @@ public final class Pm {
return runMovePrimaryStorage();
}
+ if ("set-user-restriction".equals(op)) {
+ return runSetUserRestriction();
+ }
+
try {
if (args.length == 1) {
if (args[0].equalsIgnoreCase("-l")) {
@@ -1518,6 +1522,38 @@ public final class Pm {
}
}
+ public int runSetUserRestriction() {
+ int userId = UserHandle.USER_OWNER;
+ String opt = nextOption();
+ if (opt != null && "--user".equals(opt)) {
+ String arg = nextArg();
+ if (arg == null || !isNumber(arg)) {
+ System.err.println("Error: valid userId not specified");
+ return 1;
+ }
+ userId = Integer.parseInt(arg);
+ }
+
+ String restriction = nextArg();
+ String arg = nextArg();
+ boolean value;
+ if ("1".equals(arg)) {
+ value = true;
+ } else if ("0".equals(arg)) {
+ value = false;
+ } else {
+ System.err.println("Error: valid value not specified");
+ return 1;
+ }
+ try {
+ mUm.setUserRestriction(restriction, value, userId);
+ return 0;
+ } catch (RemoteException e) {
+ System.err.println(e.toString());
+ return 1;
+ }
+ }
+
private int runUninstall() throws RemoteException {
int flags = 0;
int userId = UserHandle.USER_ALL;