Update EXTRA_PROVISIONING_SUPPORTED_MODES values to flags
This addresses API council feedback. SUPPORTED_MODES_ORGANIZATION_OWNED is now FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED. SUPPORTED_MODES_PERSONALLY_OWNED is FLAG_SUPPORTED_MODES_PERSONALLY_OWNED. SUPPORTED_MODES_DEVICE_OWNER is FLAG_SUPPORTED_MODES_DEVICE_OWNER. SUPPORTED_MODES_ORGANIZATION_AND_PERSONALLY_OWNED is now FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED | FLAG_SUPPORTED_MODES_PERSONALLY_OWNED. Note that these new flags have the same exact values as the original values, so no changes are needed to be done for the provisioning trigger. Fixes: 179709752 Test: atest ManagedProvisioningTests Test: atest ManagedProvisioningRoboTests Change-Id: I1845837e752df5750083dc3bf31cbc356f4d24b7
This commit is contained in:
@@ -959,6 +959,9 @@ package android.app.admin {
|
||||
field public static final String EXTRA_PROVISIONING_SUPPORT_URL = "android.app.extra.PROVISIONING_SUPPORT_URL";
|
||||
field public static final String EXTRA_PROVISIONING_TRIGGER = "android.app.extra.PROVISIONING_TRIGGER";
|
||||
field public static final String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
|
||||
field public static final int FLAG_SUPPORTED_MODES_DEVICE_OWNER = 4; // 0x4
|
||||
field public static final int FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED = 1; // 0x1
|
||||
field public static final int FLAG_SUPPORTED_MODES_PERSONALLY_OWNED = 2; // 0x2
|
||||
field public static final int PROVISIONING_TRIGGER_CLOUD_ENROLLMENT = 1; // 0x1
|
||||
field public static final int PROVISIONING_TRIGGER_MANAGED_ACCOUNT = 4; // 0x4
|
||||
field @Deprecated public static final int PROVISIONING_TRIGGER_PERSISTENT_DEVICE_OWNER = 3; // 0x3
|
||||
@@ -973,10 +976,6 @@ package android.app.admin {
|
||||
field public static final int STATE_USER_SETUP_FINALIZED = 3; // 0x3
|
||||
field public static final int STATE_USER_SETUP_INCOMPLETE = 1; // 0x1
|
||||
field public static final int STATE_USER_UNMANAGED = 0; // 0x0
|
||||
field public static final int SUPPORTED_MODES_DEVICE_OWNER = 4; // 0x4
|
||||
field public static final int SUPPORTED_MODES_ORGANIZATION_AND_PERSONALLY_OWNED = 3; // 0x3
|
||||
field public static final int SUPPORTED_MODES_ORGANIZATION_OWNED = 1; // 0x1
|
||||
field public static final int SUPPORTED_MODES_PERSONALLY_OWNED = 2; // 0x2
|
||||
}
|
||||
|
||||
public final class SystemUpdatePolicy implements android.os.Parcelable {
|
||||
|
||||
@@ -1214,15 +1214,14 @@ public class DevicePolicyManager {
|
||||
public @interface ProvisioningTrigger {}
|
||||
|
||||
/**
|
||||
* Possible values for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES}.
|
||||
* Flags for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@IntDef(prefix = { "SUPPORTED_MODES_" }, value = {
|
||||
SUPPORTED_MODES_ORGANIZATION_OWNED,
|
||||
SUPPORTED_MODES_PERSONALLY_OWNED,
|
||||
SUPPORTED_MODES_ORGANIZATION_AND_PERSONALLY_OWNED,
|
||||
SUPPORTED_MODES_DEVICE_OWNER
|
||||
@IntDef(flag = true, prefix = { "FLAG_SUPPORTED_MODES_" }, value = {
|
||||
FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED,
|
||||
FLAG_SUPPORTED_MODES_PERSONALLY_OWNED,
|
||||
FLAG_SUPPORTED_MODES_DEVICE_OWNER
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface ProvisioningConfiguration {}
|
||||
@@ -1307,7 +1306,7 @@ public class DevicePolicyManager {
|
||||
public static final int PROVISIONING_TRIGGER_MANAGED_ACCOUNT = 4;
|
||||
|
||||
/**
|
||||
* A value for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that provisioning is
|
||||
* Flag for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that provisioning is
|
||||
* organization-owned.
|
||||
*
|
||||
* <p>Using this value indicates the admin app can only be provisioned in either a
|
||||
@@ -1316,55 +1315,48 @@ public class DevicePolicyManager {
|
||||
* #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array extra contain {@link
|
||||
* #PROVISIONING_MODE_MANAGED_PROFILE} and {@link #PROVISIONING_MODE_FULLY_MANAGED_DEVICE}.
|
||||
*
|
||||
* <p>Also, if this value is set, the admin app's {@link #ACTION_GET_PROVISIONING_MODE} activity
|
||||
* <p>Also, if this flag is set, the admin app's {@link #ACTION_GET_PROVISIONING_MODE} activity
|
||||
* will not receive the {@link #EXTRA_PROVISIONING_IMEI} and {@link
|
||||
* #EXTRA_PROVISIONING_SERIAL_NUMBER} extras.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int SUPPORTED_MODES_ORGANIZATION_OWNED = 1;
|
||||
|
||||
/**
|
||||
* A value for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that provisioning is
|
||||
* personally-owned.
|
||||
*
|
||||
* <p>Using this value will cause the admin app's {@link #ACTION_GET_PROVISIONING_MODE}
|
||||
* activity to have the {@link #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array extra
|
||||
* contain only {@link #PROVISIONING_MODE_MANAGED_PROFILE}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int SUPPORTED_MODES_PERSONALLY_OWNED = 2;
|
||||
|
||||
/**
|
||||
* A value for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that provisioning could
|
||||
* be organization-owned or personally-owned.
|
||||
*
|
||||
* <p>Using this value will cause the admin app's {@link #ACTION_GET_PROVISIONING_MODE}
|
||||
* activity to have the {@link #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array extra
|
||||
* contain {@link
|
||||
* <p>This flag can be combined with {@link #FLAG_SUPPORTED_MODES_PERSONALLY_OWNED}. In
|
||||
* that case, the admin app's {@link #ACTION_GET_PROVISIONING_MODE} activity will have
|
||||
* the {@link #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array extra contain {@link
|
||||
* #PROVISIONING_MODE_MANAGED_PROFILE}, {@link #PROVISIONING_MODE_FULLY_MANAGED_DEVICE} and
|
||||
* {@link #PROVISIONING_MODE_MANAGED_PROFILE_ON_PERSONAL_DEVICE}.
|
||||
*
|
||||
* <p>Also, if this value is set, the admin app's {@link #ACTION_GET_PROVISIONING_MODE} activity
|
||||
* will not receive the {@link #EXTRA_PROVISIONING_IMEI} and {@link
|
||||
* #EXTRA_PROVISIONING_SERIAL_NUMBER} extras.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int SUPPORTED_MODES_ORGANIZATION_AND_PERSONALLY_OWNED = 3;
|
||||
public static final int FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED = 1;
|
||||
|
||||
/**
|
||||
* A value for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that the only supported
|
||||
* provisioning mode is device owner.
|
||||
* Flag for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that provisioning
|
||||
* is personally-owned.
|
||||
*
|
||||
* <p>Using this flag will cause the admin app's {@link #ACTION_GET_PROVISIONING_MODE}
|
||||
* activity to have the {@link #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array extra
|
||||
* contain only {@link #PROVISIONING_MODE_MANAGED_PROFILE}.
|
||||
*
|
||||
* <p>This flag can be combined with {@link #FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED}. In
|
||||
* that case, the admin app's {@link #ACTION_GET_PROVISIONING_MODE} activity will have the
|
||||
* {@link #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array extra contain {@link
|
||||
* #PROVISIONING_MODE_MANAGED_PROFILE}, {@link #PROVISIONING_MODE_FULLY_MANAGED_DEVICE} and
|
||||
* {@link #PROVISIONING_MODE_MANAGED_PROFILE_ON_PERSONAL_DEVICE}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int SUPPORTED_MODES_DEVICE_OWNER = 4;
|
||||
public static final int FLAG_SUPPORTED_MODES_PERSONALLY_OWNED = 1 << 1;
|
||||
|
||||
/**
|
||||
* Flag for {@link #EXTRA_PROVISIONING_SUPPORTED_MODES} indicating that the only
|
||||
* supported provisioning mode is device owner.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public static final int FLAG_SUPPORTED_MODES_DEVICE_OWNER = 1 << 2;
|
||||
|
||||
/**
|
||||
* This MIME type is used for starting the device owner provisioning.
|
||||
@@ -2637,7 +2629,7 @@ public class DevicePolicyManager {
|
||||
* An integer extra indication what provisioning modes should be available for the admin app
|
||||
* to pick.
|
||||
*
|
||||
* <p>The default value is {@link #SUPPORTED_MODES_ORGANIZATION_OWNED}.
|
||||
* <p>The default value is {@link #FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED}.
|
||||
*
|
||||
* <p>The value of this extra will determine the contents of the {@link
|
||||
* #EXTRA_PROVISIONING_ALLOWED_PROVISIONING_MODES} array that is passed to the admin app as an
|
||||
@@ -2648,13 +2640,21 @@ public class DevicePolicyManager {
|
||||
* #ACTION_GET_PROVISIONING_MODE} activity via the {@link #EXTRA_PROVISIONING_IMEI} and {@link
|
||||
* #EXTRA_PROVISIONING_SERIAL_NUMBER} respectively.
|
||||
*
|
||||
* <p>The allowed flag combinations are:
|
||||
* <ul>
|
||||
* <li>{@link #FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED}</li>
|
||||
* <li>{@link #FLAG_SUPPORTED_MODES_PERSONALLY_OWNED}</li>
|
||||
* <li>{@link #FLAG_SUPPORTED_MODES_DEVICE_OWNER}</li>
|
||||
* <li>{@link #FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED}
|
||||
* | {@link #FLAG_SUPPORTED_MODES_PERSONALLY_OWNED}</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>This extra is only respected when provided alongside the {@link
|
||||
* #ACTION_PROVISION_MANAGED_DEVICE_FROM_TRUSTED_SOURCE} intent action.
|
||||
*
|
||||
* @see #SUPPORTED_MODES_ORGANIZATION_OWNED
|
||||
* @see #SUPPORTED_MODES_PERSONALLY_OWNED
|
||||
* @see #SUPPORTED_MODES_ORGANIZATION_AND_PERSONALLY_OWNED
|
||||
* @see #SUPPORTED_MODES_DEVICE_OWNER
|
||||
* @see #FLAG_SUPPORTED_MODES_ORGANIZATION_OWNED
|
||||
* @see #FLAG_SUPPORTED_MODES_PERSONALLY_OWNED
|
||||
* @see #FLAG_SUPPORTED_MODES_DEVICE_OWNER
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
|
||||
Reference in New Issue
Block a user