diff options
| author | 2015-06-02 22:11:10 +0000 | |
|---|---|---|
| committer | 2015-06-02 22:11:11 +0000 | |
| commit | db6ac0e912ee935f848b4d5bede02f1f6df9e3e2 (patch) | |
| tree | c0a4893842236c529363fcda8cd3957adabeae0d | |
| parent | 3aa3f5f892017f8a3799278c0cee8773dd4c5a0f (diff) | |
| parent | 64bf7b2870b4fd38c859080441927f5a63196f5a (diff) | |
Merge "Make ACTION_PROVISION_MANAGED_DEVICE public." into mnc-dev
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 52 |
3 files changed, 45 insertions, 9 deletions
diff --git a/api/current.txt b/api/current.txt index 0f6d662034e2..f110d0b6305c 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5804,6 +5804,7 @@ package android.app.admin { method public void wipeData(int); field public static final java.lang.String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN"; field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED"; + field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE"; field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE"; field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; field public static final java.lang.String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION"; diff --git a/api/system-current.txt b/api/system-current.txt index 716a08b49fad..84c0f83431a5 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5914,6 +5914,7 @@ package android.app.admin { method public void wipeData(int); field public static final java.lang.String ACTION_ADD_DEVICE_ADMIN = "android.app.action.ADD_DEVICE_ADMIN"; field public static final java.lang.String ACTION_MANAGED_PROFILE_PROVISIONED = "android.app.action.MANAGED_PROFILE_PROVISIONED"; + field public static final java.lang.String ACTION_PROVISION_MANAGED_DEVICE = "android.app.action.PROVISION_MANAGED_DEVICE"; field public static final java.lang.String ACTION_PROVISION_MANAGED_PROFILE = "android.app.action.PROVISION_MANAGED_PROFILE"; field public static final java.lang.String ACTION_SEND_DEVICE_INITIALIZER_STATUS = "android.app.action.SEND_DEVICE_INITIALIZER_STATUS"; field public static final java.lang.String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index a0b95b6a53c4..55eaf272ba77 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -130,6 +130,39 @@ public class DevicePolicyManager { = "android.app.action.PROVISION_MANAGED_PROFILE"; /** + * Activity action: Starts the provisioning flow which sets up a managed device. + * Must be started with {@link android.app.Activity#startActivityForResult(Intent, int)}. + * + * <p> During device owner provisioning a device admin app is set as the owner of the device. + * A device owner has full control over the device. The device owner can not be modified by the + * user. + * + * <p> A typical use case would be a device that is owned by a company, but used by either an + * employee or client. + * + * <p> An intent with this action can be sent only on an unprovisioned device. + * It is possible to check if the device is provisioned or not by looking at + * {@link android.provider.Settings.Global#DEVICE_PROVISIONED} + * + * The intent contains the following extras: + * <ul> + * <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME}</li> + * <li>{@link #EXTRA_PROVISIONING_SKIP_ENCRYPTION}, optional</li> + * <li>{@link #EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED}, optional</li> + * </ul> + * + * <p> When device owner provisioning has completed, an intent of the type + * {@link DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE} is broadcast to the + * device owner. + * + * <p> If provisioning fails, the device is factory reset. + * + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_PROVISION_MANAGED_DEVICE + = "android.app.action.PROVISION_MANAGED_DEVICE"; + + /** * A {@link android.os.Parcelable} extra of type {@link android.os.PersistableBundle} that allows * a mobile device management application that starts managed profile provisioning to pass data * to itself on the managed profile when provisioning completes. The mobile device management @@ -169,11 +202,13 @@ public class DevicePolicyManager { * application that will be set as the profile owner or device owner and active admin. * * <p>If an application starts provisioning directly via an intent with action - * {@link #ACTION_PROVISION_MANAGED_PROFILE} the package name of this component has to match the - * package name of the application that started provisioning. + * {@link #ACTION_PROVISION_MANAGED_PROFILE} or + * {@link #ACTION_PROVISION_MANAGED_DEVICE} the package name of this + * component has to match the package name of the application that started provisioning. * * <p>This component is set as device owner and active admin when device owner provisioning is - * started by an NFC message containing an NFC record with MIME type + * started by an intent with action {@link #ACTION_PROVISION_MANAGED_DEVICE} or by an NFC + * message containing an NFC record with MIME type * {@link #MIME_TYPE_PROVISIONING_NFC_V2}. For the NFC record, the component name should be * flattened to a string, via {@link ComponentName#flattenToShortString()}. * @@ -213,8 +248,8 @@ public class DevicePolicyManager { * A Boolean extra that can be used by the mobile device management application to skip the * disabling of system apps during provisioning when set to {@code true}. * - * <p>Use in an NFC record with {@link #MIME_TYPE_PROVISIONING_NFC} that starts device owner - * provisioning via an NFC bump. + * <p>Use in an NFC record with {@link #MIME_TYPE_PROVISIONING_NFC} or an intent with action + * {@link #ACTION_PROVISION_MANAGED_DEVICE} that starts device owner provisioning. */ public static final String EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED = "android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED"; @@ -414,8 +449,8 @@ public class DevicePolicyManager { * A boolean extra indicating whether device encryption can be skipped as part of Device Owner * provisioning. * - * <p>Use in an NFC record with {@link #MIME_TYPE_PROVISIONING_NFC_V2} that starts device owner - * provisioning via an NFC bump. + * <p>Use in an NFC record with {@link #MIME_TYPE_PROVISIONING_NFC_V2} or an intent with action + * {@link #ACTION_PROVISION_MANAGED_DEVICE} that starts device owner provisioning. */ public static final String EXTRA_PROVISIONING_SKIP_ENCRYPTION = "android.app.extra.PROVISIONING_SKIP_ENCRYPTION"; @@ -609,8 +644,7 @@ public class DevicePolicyManager { * * <p>During device owner provisioning a device admin app is set as the owner of the device. * A device owner has full control over the device. The device owner can not be modified by the - * user and the only way of resetting the device is if the device owner app calls a factory - * reset. + * user. * * <p> A typical use case would be a device that is owned by a company, but used by either an * employee or client. |