summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Emily Bernier <ember@google.com> 2013-04-12 20:21:35 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2013-04-12 20:21:36 +0000
commitce70311b67c3dba6ed4fbda41617f4e24c82dfc7 (patch)
tree3c574c1d31d3038077bc57973226438679651a95
parente527d256dcf1df96da4cb8a2c144a02748bbf96d (diff)
parentb223f73a69f76f5e32a0bca267f945f464776f9d (diff)
Merge "Add user restrictions (credentials, user removal)" into jb-mr2-dev
-rw-r--r--api/current.txt3
-rw-r--r--core/java/android/os/UserManager.java21
-rw-r--r--services/java/com/android/server/pm/UserManagerService.java4
3 files changed, 27 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt
index ef6160f62735..3f04078d471e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -17089,6 +17089,9 @@ package android.os {
field public static final java.lang.String DISALLOW_SHARE_LOCATION = "no_share_location";
field public static final java.lang.String DISALLOW_UNINSTALL_APPS = "no_uninstall_apps";
field public static final java.lang.String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
+ field public static final java.lang.String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
+ field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
+
}
public abstract class Vibrator {
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index b9b8f083ba1a..e08c6ea7b403 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -110,7 +110,6 @@ public class UserManager {
*/
public static final String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
-
/**
* Key for user restrictions. Specifies if a user is disallowed from transferring files over
* USB. The default value is <code>false</code>.
@@ -121,6 +120,26 @@ public class UserManager {
*/
public static final String DISALLOW_USB_FILE_TRANSFER = "no_usb_file_transfer";
+ /**
+ * Key for user restrictions. Specifies if a user is disallowed from configuring user
+ * credentials. The default value is <code>false</code>.
+ * <p/>
+ * Type: Boolean
+ * @see #setUserRestrictions(Bundle)
+ * @see #getUserRestrictions()
+ */
+ public static final String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
+
+ /**
+ * Key for user restrictions. Specifies if a user is disallowed from removing users.
+ * The default value is <code>false</code>.
+ * <p/>
+ * Type: Boolean
+ * @see #setUserRestrictions(Bundle)
+ * @see #getUserRestrictions()
+ */
+ public static final String DISALLOW_REMOVE_USER = "no_remove_user";
+
private static UserManager sInstance = null;
public synchronized static UserManager get(Context context) {
diff --git a/services/java/com/android/server/pm/UserManagerService.java b/services/java/com/android/server/pm/UserManagerService.java
index 3ef93706dd72..df90a5664bc8 100644
--- a/services/java/com/android/server/pm/UserManagerService.java
+++ b/services/java/com/android/server/pm/UserManagerService.java
@@ -622,6 +622,8 @@ public class UserManagerService extends IUserManager.Stub {
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
writeBoolean(serializer, restrictions, UserManager.DISALLOW_CONFIG_BLUETOOTH);
writeBoolean(serializer, restrictions, UserManager.DISALLOW_USB_FILE_TRANSFER);
+ writeBoolean(serializer, restrictions, UserManager.DISALLOW_CONFIG_CREDENTIALS);
+ writeBoolean(serializer, restrictions, UserManager.DISALLOW_REMOVE_USER);
serializer.endTag(null, TAG_RESTRICTIONS);
}
serializer.endTag(null, TAG_USER);
@@ -742,6 +744,8 @@ public class UserManagerService extends IUserManager.Stub {
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_BLUETOOTH);
readBoolean(parser, restrictions, UserManager.DISALLOW_USB_FILE_TRANSFER);
+ readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_CREDENTIALS);
+ readBoolean(parser, restrictions, UserManager.DISALLOW_REMOVE_USER);
}
}
}