问题
I have question. I have fully managed device and use Android Management API (https://developers.google.com/android/management)
I created policy with this definition:
{
"applications": [
{
"packageName": "com.example.myapp",
"installType": "KIOSK",
"defaultPermissionPolicy": "GRANT"
}
],
"cameraDisabled": false,
"defaultPermissionPolicy": "GRANT",
"debuggingFeaturesAllowed": true
}
but I want allow access to device settings or exit kiosk mode (kiosk app), when user write some password. It's possible to do it only with change policy above? Or I must write some specific code in my app com.example.myapp
?
回答1:
The Android Management API doesn't natively support enabling/disabling kiosk mode from the device itself, at least not yet.
You will need to implement it manually in your kiosk app. To do so:
- Expose some UI in your kiosk app where the user can choose to enable/disable kiosk mode (possibly protected by a password or PIN).
- On change, call your backend which then calls the Android Management API to change the policy for the device (with enterprises.devices.patch or enterprises.policies.patch). Never make the call directly from the device to the Android Management API, as this would mean keeping the service account key on the device, which is strongly discouraged.
The main caveat of this approach is that the device must be connected to the network.
来源:https://stackoverflow.com/questions/58373382/android-management-api-exit-kiosk-mode-with-password