I have a device running Android 7.1.1 and I am building sample DPC app in preparation for making a COSU kiosk app but I keep running into an error in the provisioning setup.
Steps I take:
I've put simple Toast
in DeviceAdminReceiver
subclass into onEnabled
and onProvisioningComplete
functions. The Toast in onEnabled
is displayed, the one in onProvisioningComplete
is unsuprisingly not.
The app is signed with proper release certificate, setting the device owner through adb works fine as well which also leads me to belief that component name and manifest is ok otherwise adb command would fail as well.
QR code text:
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "component name",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "the checksum",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "the link",
"android.app.extra.PROVISIONING_SKIP_ENCRYPTION" : "True",
"android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED" : "True"
}
Any ideas what might be wrong ? I've run out of mine. Thanks for any input !
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.my.app/com.my.app.MyDeviceAdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "the checksum",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "the link",
"android.app.extra.PROVISIONING_SKIP_ENCRYPTION" : true,
"android.app.extra.PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED" : true
}
values for PROVISIONING_SKIP_ENCRYPTION and PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED should be boolean, not strings. At least its boolean in my app and it works.
Also make sure you specified the component name of the device admin receiver in a proper way. the specified component must extend android.app.admin.DeviceAdminReceiver.