How can I locate a device which has been enrolled as a fully managed device?

无人久伴 提交于 2021-02-10 19:58:26

问题


I'm trying to find out how to locate an Android 9.0 device which has been enrolled using a Service Account and the Android Management API. The documentation does not seem to have any hints for my case.

Since there is apparently no way of logging in with a Service Account, I believe I cannot use https://www.google.com/android/find either.


回答1:


You can use the Android Management API to turn on "high accuracy" location mode but you will need to use another app to get the location of the device.

To enable "high accuracy" location mode you can use "locationMode": "HIGH_ACCURACY" and use "permissionGrants" to grant your app the permission to access the location.

policy_json = '''
{
  "applications": [
  {
    "packageName": "{your.app.packageId}",
    "installType": "FORCE_INSTALLED",
    "permissionGrants": [
    {
      "permission": "android.permission.ACCESS_FINE_LOCATION",
      "policy": "GRANT"
    }
  }
],
  "locationMode": "HIGH_ACCURACY"
}
'''


来源:https://stackoverflow.com/questions/59845161/how-can-i-locate-a-device-which-has-been-enrolled-as-a-fully-managed-device

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