DevicePolicyManager.ActionProvisionManagedProfile Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Activity action: Starts the provisioning flow which sets up a managed profile.
[Android.Runtime.Register("ACTION_PROVISION_MANAGED_PROFILE")]
public const string ActionProvisionManagedProfile;
[<Android.Runtime.Register("ACTION_PROVISION_MANAGED_PROFILE")>]
val mutable ActionProvisionManagedProfile : string
Field Value
- Attributes
Remarks
Activity action: Starts the provisioning flow which sets up a managed profile.
A managed profile allows data separation for example for the usage of a device as a personal and corporate device. The user which provisioning is started from and the managed profile share a launcher.
This intent will typically be sent by a mobile device management application (MDM). Provisioning adds a managed profile and sets the MDM as the profile owner who has full control over the profile.
It is possible to check if provisioning is allowed or not by querying the method #isProvisioningAllowed(String)
.
In version android.os.Build.VERSION_CODES#LOLLIPOP
, this intent must contain the extra #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
. As of android.os.Build.VERSION_CODES#M
, it should contain the extra #EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME
instead, although specifying only #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
is still supported.
The intent may also contain the following extras: <ul> <li>#EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE
, optional </li> <li>#EXTRA_PROVISIONING_SKIP_ENCRYPTION
, optional, supported from android.os.Build.VERSION_CODES#N
</li> <li>#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE
, optional</li> <li>#EXTRA_PROVISIONING_LOGO_URI
, optional</li> <li>#EXTRA_PROVISIONING_SKIP_USER_CONSENT
, optional</li> <li>#EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION
, optional</li> <li>#EXTRA_PROVISIONING_DISCLAIMERS
, optional</li> </ul>
When managed provisioning has completed, broadcasts are sent to the application specified in the provisioning intent. The DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE
broadcast is sent in the managed profile and the #ACTION_MANAGED_PROFILE_PROVISIONED
broadcast is sent in the primary profile.
From version android.os.Build.VERSION_CODES#O
, when managed provisioning has completed, along with the above broadcast, activity intent #ACTION_PROVISIONING_SUCCESSFUL
will also be sent to the profile owner.
If provisioning fails, the managedProfile is removed so the device returns to its previous state.
If launched with android.app.Activity#startActivityForResult(Intent, int)
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.
If a device policy management role holder (DPMRH) updater is present on the device, an internet connection attempt must be made prior to launching this intent. If internet connection could not be established, provisioning will fail unless #EXTRA_PROVISIONING_ALLOW_OFFLINE
is explicitly set to true
, in which case provisioning will continue without using the DPMRH. If an internet connection has been established, the DPMRH updater will be launched, which will update the DPMRH if it's not present on the device, or if it's present and not valid.
If a DPMRH is present on the device and valid, the provisioning flow will be deferred to it.
Java documentation for android.app.admin.DevicePolicyManager.ACTION_PROVISION_MANAGED_PROFILE
.
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.