Share via


DevicePolicyManager.ActionProvisionManagedDevice Field

Definition

Activity action: Starts the provisioning flow which sets up a managed device.

[Android.Runtime.Register("ACTION_PROVISION_MANAGED_DEVICE", ApiSince=23)]
public const string ActionProvisionManagedDevice;
[<Android.Runtime.Register("ACTION_PROVISION_MANAGED_DEVICE", ApiSince=23)>]
val mutable ActionProvisionManagedDevice : string

Field Value

Attributes

Remarks

Activity action: Starts the provisioning flow which sets up a managed device. Must be started with android.app.Activity#startActivityForResult(Intent, int).

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.

A typical use case would be a device that is owned by a company, but used by either an employee or client.

An intent with this action can be sent only on an unprovisioned device. It is possible to check if provisioning is allowed or not by querying the method #isProvisioningAllowed(String).

The intent contains the following extras: <ul> <li>#EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME</li> <li>#EXTRA_PROVISIONING_SKIP_ENCRYPTION, optional</li> <li>#EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED, optional</li> <li>#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE, optional</li> <li>#EXTRA_PROVISIONING_LOGO_URI, optional</li> <li>#EXTRA_PROVISIONING_DISCLAIMERS, optional</li> <li>#EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS, optional</li> </ul>

When device owner provisioning has completed, an intent of the type DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE is broadcast to the device owner.

From version android.os.Build.VERSION_CODES#O, when device owner provisioning has completed, along with the above broadcast, activity intent #ACTION_PROVISIONING_SUCCESSFUL will also be sent to the device owner.

If provisioning fails, the device is factory reset.

A result code of android.app.Activity#RESULT_OK implies that the synchronous part of the provisioning flow was successful, although this doesn't guarantee the full flow will succeed. Conversely a result code of android.app.Activity#RESULT_CANCELED implies that the user backed-out of provisioning, or some precondition for provisioning wasn't met.

This member is deprecated. to support android.os.Build.VERSION_CODES#S and later, admin apps must implement activities with intent filters for the #ACTION_GET_PROVISIONING_MODE and #ACTION_ADMIN_POLICY_COMPLIANCE intent actions; using #ACTION_PROVISION_MANAGED_DEVICE to start provisioning will cause the provisioning to fail; to additionally support pre-android.os.Build.VERSION_CODES#S, admin apps must also continue to use this constant.

Java documentation for android.app.admin.DevicePolicyManager.ACTION_PROVISION_MANAGED_DEVICE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to