Android Management API - Exit kiosk mode with password

送分小仙女□ 提交于 2020-01-24 20:27:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!