Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06fd71ab authored by Esteban Talavera's avatar Esteban Talavera Committed by Android (Google) Code Review
Browse files

Merge "Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions"

parents e80dd223 6c9116a6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29714,6 +29714,7 @@ package android.os {
    method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
    method public static boolean supportsMultipleUsers();
    field public static final java.lang.String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking";
    field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user";
    field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume";
    field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
@@ -29738,6 +29739,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_NETWORK_RESET = "no_network_reset";
    field public static final java.lang.String DISALLOW_OUTGOING_BEAM = "no_outgoing_beam";
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_REMOVE_MANAGED_PROFILE = "no_remove_managed_profile";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
+2 −0
Original line number Diff line number Diff line
@@ -32370,6 +32370,7 @@ package android.os {
    method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
    method public static boolean supportsMultipleUsers();
    field public static final java.lang.String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking";
    field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user";
    field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume";
    field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
@@ -32395,6 +32396,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_OEM_UNLOCK = "no_oem_unlock";
    field public static final java.lang.String DISALLOW_OUTGOING_BEAM = "no_outgoing_beam";
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_REMOVE_MANAGED_PROFILE = "no_remove_managed_profile";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
+2 −0
Original line number Diff line number Diff line
@@ -29803,6 +29803,7 @@ package android.os {
    method public deprecated void setUserRestrictions(android.os.Bundle, android.os.UserHandle);
    method public static boolean supportsMultipleUsers();
    field public static final java.lang.String ALLOW_PARENT_PROFILE_APP_LINKING = "allow_parent_profile_app_linking";
    field public static final java.lang.String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";
    field public static final java.lang.String DISALLOW_ADD_USER = "no_add_user";
    field public static final java.lang.String DISALLOW_ADJUST_VOLUME = "no_adjust_volume";
    field public static final java.lang.String DISALLOW_APPS_CONTROL = "no_control_apps";
@@ -29827,6 +29828,7 @@ package android.os {
    field public static final java.lang.String DISALLOW_NETWORK_RESET = "no_network_reset";
    field public static final java.lang.String DISALLOW_OUTGOING_BEAM = "no_outgoing_beam";
    field public static final java.lang.String DISALLOW_OUTGOING_CALLS = "no_outgoing_calls";
    field public static final java.lang.String DISALLOW_REMOVE_MANAGED_PROFILE = "no_remove_managed_profile";
    field public static final java.lang.String DISALLOW_REMOVE_USER = "no_remove_user";
    field public static final java.lang.String DISALLOW_SAFE_BOOT = "no_safe_boot";
    field public static final java.lang.String DISALLOW_SET_USER_ICON = "no_set_user_icon";
+2 −2
Original line number Diff line number Diff line
@@ -1254,8 +1254,8 @@ public class DevicePolicyManager {
    /**
     * Result code for {@link checkProvisioningPreCondition}.
     *
     * <p>Returned for {@link #ACTION_PROVISION_MANAGED_PROFILE} when the device has a device owner
     * and the user is a system user on a split system user device.
     * <p>Returned for {@link #ACTION_PROVISION_MANAGED_PROFILE} when the device the user is a
     * system user on a split system user device.
     *
     * @hide
     */
+31 −3
Original line number Diff line number Diff line
@@ -252,6 +252,20 @@ public class UserManager {
     */
    public static final String DISALLOW_REMOVE_USER = "no_remove_user";

    /**
     * Specifies if managed profiles of this user can be removed, other than by its profile owner.
     * The default value is <code>false</code>.
     * <p>
     * This restriction can only be set by device owners.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_REMOVE_MANAGED_PROFILE = "no_remove_managed_profile";

    /**
     * Specifies if a user is disallowed from enabling or
     * accessing debugging features. The default value is <code>false</code>.
@@ -322,8 +336,8 @@ public class UserManager {
    public static final String DISALLOW_FACTORY_RESET = "no_factory_reset";

    /**
     * Specifies if a user is disallowed from adding new users and
     * profiles. This can only be set by device owners and profile owners on the primary user.
     * Specifies if a user is disallowed from adding new users. This can only be set by device
     * owners and profile owners on the primary user.
     * The default value is <code>false</code>.
     * <p>This restriction has no effect on secondary users and managed profiles since only the
     * primary user can add other users.
@@ -336,6 +350,20 @@ public class UserManager {
     */
    public static final String DISALLOW_ADD_USER = "no_add_user";

    /**
     * Specifies if a user is disallowed from adding managed profiles.
     * <p>The default value for an unmanaged user is <code>false</code>.
     * For users with a device owner set, the default is <code>true</code>
     * <p>This restriction can only be set by device owners.
     *
     * <p>Key for user restrictions.
     * <p>Type: Boolean
     * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
     * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
     * @see #getUserRestrictions()
     */
    public static final String DISALLOW_ADD_MANAGED_PROFILE = "no_add_managed_profile";

    /**
     * Specifies if a user is disallowed from disabling application
     * verification. The default value is <code>false</code>.
@@ -1406,7 +1434,7 @@ public class UserManager {

    /**
     * Similar to {@link #createProfileForUser(String, int, int, String[])}
     * except bypassing the checking of {@link UserManager#DISALLOW_ADD_USER}.
     * except bypassing the checking of {@link UserManager#DISALLOW_ADD_MANAGED_PROFILE}.
     * Requires {@link android.Manifest.permission#MANAGE_USERS} permission.
     *
     * @see #createProfileForUser(String, int, int, String[])
Loading