问题
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