Device-owner NFC provisioning targeting multiple OS versions; Lollipop 5.0+

187 Views Asked by At

I am provisioning devices using NFC. The target devices being provisioned (provisionees) are in the Google Wizard (receiver devices are in a out-of-the-box or factory reset state) and run Lollipop 5.0 or greater. The provisioner is an Android device that could also be running Lollipop 5.0 or greater, but lets say it is running Nougat 7.1.2. With each Android OS release, new provisioning "EXTRAS" are added to the DevicePolicyManager while others become depreciated.

Is there a "best practices" for how to target a device via NFC across multiple OS versions? Note: Using android.os.Build.VERSION.SDK_INT won't work because it's the provisioner's version, not the provisionee's version.

Main Question: Is there a way to cover all the OS versions with a single provisioning app and without needing to manually specify the OS on the target (provisionee) device?

Some examples:

  • EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED was added in API level 22 while I'm targeting API level 21.
  • EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME was added in API level 23. EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME was depreciated in API level 23.
0

There are 0 best solutions below