diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 08e4c3ae36834..3564589e35a40 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -290,10 +290,12 @@ public class UserManager { /** * Specifies if airplane mode is disallowed on the device. - * - *
This restriction can only be set by the device owner and the profile owner on the - * primary user and it applies globally - i.e. it disables airplane mode on the entire device. - *
The default value is false.
+ *
+ * This restriction can only be set by the device owner, the profile owner on the primary user + * or the profile owner of an organization-owned managed profile on the parent profile, and it + * applies globally - i.e. it disables airplane mode on the entire device. + *
+ * The default value is false.
*
*
Key for user restrictions. *
Type: Boolean
@@ -729,9 +731,12 @@ public class UserManager {
public static final String DISALLOW_APPS_CONTROL = "no_control_apps";
/**
- * Specifies if a user is disallowed from mounting
- * physical external media. This can only be set by device owners and profile owners on the
- * primary user. The default value is false.
+ * Specifies if a user is disallowed from mounting physical external media.
+ *
+ * This restriction can only be set by the device owner, the profile owner on the primary user + * or the profile owner of an organization-owned managed profile on the parent profile. + *
+ * The default value is false.
*
*
Key for user restrictions. *
Type: Boolean
@@ -743,10 +748,15 @@ public class UserManager {
/**
* Specifies if a user is disallowed from adjusting microphone volume. If set, the microphone
- * will be muted. This can be set by device owners and profile owners. The default value is
- * false.
+ * will be muted.
+ *
+ * The default value is false.
+ *
+ * Device owner and profile owner can set this restriction, although the restriction has no + * effect in a managed profile. When it is set by the profile owner of an organization-owned + * managed profile on the parent profile, it will disallow the personal user from adjusting the + * microphone volume. * - *
This restriction has no effect on managed profiles. *
Key for user restrictions. *
Type: Boolean * @see DevicePolicyManager#addUserRestriction(ComponentName, String) @@ -773,10 +783,15 @@ public class UserManager { public static final String DISALLOW_ADJUST_VOLUME = "no_adjust_volume"; /** - * Specifies that the user is not allowed to make outgoing - * phone calls. Emergency calls are still permitted. + * Specifies that the user is not allowed to make outgoing phone calls. Emergency calls are + * still permitted. + *
* The default value is false.
- *
This restriction has no effect on managed profiles. + *
+ * Device owner and profile owner can set this restriction, although the restriction has no + * effect in a managed profile. When it is set by the profile owner of an organization-owned + * managed profile on the parent profile, it will disallow the personal user from making + * outgoing phone calls. * *
Key for user restrictions. *
Type: Boolean diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java index 89030ed7c0758..91bd7aea067eb 100644 --- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java +++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java @@ -223,7 +223,11 @@ public class UserRestrictionsUtils { UserManager.DISALLOW_SAFE_BOOT, UserManager.DISALLOW_SHARE_LOCATION, UserManager.DISALLOW_SMS, - UserManager.DISALLOW_USB_FILE_TRANSFER + UserManager.DISALLOW_USB_FILE_TRANSFER, + UserManager.DISALLOW_AIRPLANE_MODE, + UserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA, + UserManager.DISALLOW_OUTGOING_CALLS, + UserManager.DISALLOW_UNMUTE_MICROPHONE ); /** diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java index def5b617becde..422c278a3af70 100644 --- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java +++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java @@ -1986,7 +1986,11 @@ public class DevicePolicyManagerTest extends DpmTestBase { UserManager.DISALLOW_SAFE_BOOT, UserManager.DISALLOW_SHARE_LOCATION, UserManager.DISALLOW_SMS, - UserManager.DISALLOW_USB_FILE_TRANSFER + UserManager.DISALLOW_USB_FILE_TRANSFER, + UserManager.DISALLOW_AIRPLANE_MODE, + UserManager.DISALLOW_MOUNT_PHYSICAL_MEDIA, + UserManager.DISALLOW_OUTGOING_CALLS, + UserManager.DISALLOW_UNMUTE_MICROPHONE ); public void testSetUserRestriction_asPoOfOrgOwnedDevice() throws Exception {