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.
It is possible to check if provisioning is allowed or not by querying the method #isProvisioningAllowed(String)
.
The intent may contain the following extras:
<table> <thead> <tr> <th>Extra</th> <th></th> <th>Supported Versions</th> </tr> </thead> <tbody> <tr> <td>#EXTRA_PROVISIONING_ACCOUNT_TO_MIGRATE
</td> <td colspan="2"></td> </tr> <tr> <td>#EXTRA_PROVISIONING_SKIP_ENCRYPTION
</td> <td></td> <td>android.os.Build.VERSION_CODES#N
+</td> </tr> <tr> <td>#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE
</td> <td colspan="2"></td> </tr> <tr> <td>#EXTRA_PROVISIONING_LOGO_URI
</td> <td colspan="2"></td> </tr> <tr> <td>#EXTRA_PROVISIONING_SKIP_USER_CONSENT
</td> <td colspan="2"><b>Can only be used by an existing device owner trying to create a managed profile</b></td> </tr> <tr> <td>#EXTRA_PROVISIONING_KEEP_ACCOUNT_ON_MIGRATION
</td> <td colspan="2"></td> </tr> <tr> <td>#EXTRA_PROVISIONING_DISCLAIMERS
</td> <td colspan="2"></td> </tr> <tr> <td>#EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
</td> <td> <b>Required if #EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME
is not specified. Must match the package name of the calling application.</b> </td> <td>android.os.Build.VERSION_CODES#LOLLIPOP
+</td> </tr> <tr> <td>#EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME
</td> <td> <b>Required if #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
is not specified. Package name must match the package name of the calling application.</b> </td> <td>android.os.Build.VERSION_CODES#M
+</td> </tr> <tr> <td>#EXTRA_PROVISIONING_ALLOW_OFFLINE
</td> <td colspan="2">On android.os.Build.VERSION_CODES#TIRAMISU
+, when set to true this will <b>force</b> offline provisioning instead of allowing it</td> </tr> </tbody> </table>
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 managed profile 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
indicates 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
indicates that the user backed-out of provisioning or some precondition for provisioning wasn't met.
If a device policy management role holder updater is present on the device, an internet connection attempt must be made prior to launching this intent. If an internet connection can 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 device policy management role holder. If an internet connection has been established, the device policy management role holder updater will be launched, which may update the device policy management role holder before continuing provisioning.
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.