From 4047bae5dbc6fddad969186e3061587a11e96c24 Mon Sep 17 00:00:00 2001 From: Esteban Talavera Date: Wed, 28 Jun 2017 11:03:09 +0100 Subject: [PATCH] Fix ACTION_PROVISIONING_SUCCESSFUL documentation The current documentation implies that the intent is sent to the application that requested provisioning (which would be in the primary profile for managed profile provisioning). However it is sent to the new DO or PO only. Test: make docs Change-Id: I9d1f66ec6f3d6d7fbaa1617d13a7da12d4acb490 --- core/java/android/app/admin/DeviceAdminReceiver.java | 8 ++++++-- core/java/android/app/admin/DevicePolicyManager.java | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/java/android/app/admin/DeviceAdminReceiver.java b/core/java/android/app/admin/DeviceAdminReceiver.java index d9b6eed4fc4d7..5a356d9d4a6d8 100644 --- a/core/java/android/app/admin/DeviceAdminReceiver.java +++ b/core/java/android/app/admin/DeviceAdminReceiver.java @@ -238,8 +238,7 @@ public class DeviceAdminReceiver extends BroadcastReceiver { * {@link android.app.admin.DevicePolicyManager#isProfileOwnerApp}. You will generally handle * this in {@link DeviceAdminReceiver#onProfileProvisioningComplete}. * - *

Input: Nothing.

- *

Output: Nothing

+ * @see DevicePolicyManager#ACTION_PROVISIONING_SUCCESSFUL */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) @BroadcastBehavior(explicitOnly = true) @@ -669,6 +668,11 @@ public class DeviceAdminReceiver extends BroadcastReceiver { * profile owner needs to wait for data to be available if required (e.g. android device ids or * other data that is set as a result of server interactions). * + *

From version {@link android.os.Build.VERSION_CODES#O}, when managed provisioning has + * completed, along with this callback the activity intent + * {@link DevicePolicyManager#ACTION_PROVISIONING_SUCCESSFUL} will also be sent to the same + * application. + * * @param context The running context as per {@link #onReceive}. * @param intent The received intent as per {@link #onReceive}. */ diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 14162afdb25d2..f612eaa43578b 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -169,8 +169,7 @@ public class DevicePolicyManager { * *

From version {@link android.os.Build.VERSION_CODES#O}, when managed provisioning has * completed, along with the above broadcast, activity intent - * {@link #ACTION_PROVISIONING_SUCCESSFUL} will also be sent to the application specified in - * the provisioning intent. + * {@link #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. @@ -857,8 +856,7 @@ public class DevicePolicyManager { * {@link DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE} broadcast but this will be * delivered faster as it's an activity intent. * - *

The intent is only sent to the application on the profile that requested provisioning. In - * the device owner case the profile is the primary user. + *

The intent is only sent to the new device or profile owner. * * @see #ACTION_PROVISION_MANAGED_PROFILE * @see #ACTION_PROVISION_MANAGED_DEVICE