'Android 12 - PROVISIONING_SUCCESSFUL intent never received

We are migrating our Device policy app to Android 12 last API. during our test we notice that the intent PROVISIONING_SUCCESSFUL was never received so the related activity never started , instead of that ACTION_PROFILE_PROVISIONING_COMPLETE is well received in our admin receiver.

The documentation and comment in the aosp source says that :

PROVISIONING_SUCCESSFUL Action is sent to indicate that provisioning of a managed profile or managed device has completed successfully. It'll be sent at the same time as DeviceAdminReceiver#ACTION_PROFILE_PROVISIONING_COMPLETE broadcast but this will be delivered faster as it's an activity intent.

ProvisioningSuccessActivity entry in manifest :

    <activity
      android:exported="true"
      android:name=".ProvisioningSuccessActivity"
      android:permission="android.permission.BIND_DEVICE_ADMIN">
      <intent-filter>
        <action android:name="android.app.action.PROVISIONING_SUCCESSFUL"/>
        <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter>
    </activity>

I'm wondering if someone encountered the same issue ? thanks



Solution 1:[1]

From Android 12, you will need to include the new changes to support provisioning as DPC. https://developer.android.google.cn/work/versions/android-12#deprecations Follow the steps given here https://developers.google.com/android/work/play/emm-api/prov-devices#set_up_device_owner_mode_google_account

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Karthi Keyan