From c34dc7cdeb5cae8ca4c731838aafe90ed4c9a2b8 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 18 Sep 2014 09:42:42 -0700 Subject: Allow primary user profile owner to set device restrictions In addition to device owners, profile owners on the primary user can also set user restrictions that are necessary to lock down the user. This is to enable the case of a profile owner registered after setup wizard is completed, on the primary user. Also make managed profile vs. profile wording consistent in the DevicePolicyManager docs. Bug: 17555025 Change-Id: Ib9d08b8af34a99b25e11757fa7dc83673a7deb32 --- core/java/android/os/UserManager.java | 37 ++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'core/java/android/os') diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 82016c3..2315c74 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -123,7 +123,8 @@ public class UserManager { /** * Specifies if a user is disallowed from transferring files over - * USB. This can only be set by device owners. The default value is false. + * USB. This can only be set by device owners and profile owners on the primary user. + * The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -178,8 +179,8 @@ public class UserManager { /** * Specifies if a user is disallowed from configuring Tethering - * & portable hotspots. This can only be set by device owners. The default value is - * false. + * & portable hotspots. This can only be set by device owners and profile owners on the + * primary user. The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -190,8 +191,8 @@ public class UserManager { /** * Specifies if a user is disallowed from factory resetting - * from Settings. This can only be set by device owners. The default value is - * false. + * from Settings. This can only be set by device owners and profile owners on the primary user. + * The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -202,7 +203,8 @@ public class UserManager { /** * Specifies if a user is disallowed from adding new users and - * profiles. This can only be set by device owners. The default value is false. + * profiles. This can only be set by device owners and profile owners on the primary user. + * The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -224,7 +226,8 @@ public class UserManager { /** * Specifies if a user is disallowed from configuring cell - * broadcasts. This can only be set by device owners. The default value is false. + * broadcasts. This can only be set by device owners and profile owners on the primary user. + * The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -235,7 +238,8 @@ public class UserManager { /** * Specifies if a user is disallowed from configuring mobile - * networks. This can only be set by device owners. The default value is false. + * networks. This can only be set by device owners and profile owners on the primary user. + * The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -266,8 +270,8 @@ public class UserManager { /** * Specifies if a user is disallowed from mounting - * physical external media. This can only be set by device owners. The default value is - * false. + * physical external media. This can only be set by device owners and profile owners on the + * primary user. The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -278,8 +282,8 @@ public class UserManager { /** * Specifies if a user is disallowed from adjusting microphone - * volume. If set, the microphone will be muted. This can only be set by device owners. - * The default value is false. + * volume. If set, the microphone will be muted. This can only be set by device owners + * and profile owners on the primary user. The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -290,8 +294,8 @@ public class UserManager { /** * Specifies if a user is disallowed from adjusting the master - * volume. If set, the master volume will be muted. This can only be set by device owners. - * The default value is false. + * volume. If set, the master volume will be muted. This can only be set by device owners + * and profile owners on the primary user. The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -314,7 +318,7 @@ public class UserManager { /** * Specifies that the user is not allowed to send or receive - * SMS messages. This can only be set by device owners. The default value is false. + * SMS messages. The default value is false. * *

Key for user restrictions. *

Type: Boolean @@ -333,7 +337,8 @@ public class UserManager { *

  • {@link LayoutParams#TYPE_SYSTEM_ERROR}
  • *
  • {@link LayoutParams#TYPE_SYSTEM_OVERLAY}
  • * - *

    This can only be set by device owners. The default value is false. + *

    This can only be set by device owners and profile owners on the primary user. + * The default value is false. * *

    Key for user restrictions. *

    Type: Boolean -- cgit v1.1