awrush
awrush

Reputation: 25

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

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.

Upvotes: 1

Views: 610

Answers (1)

Dave Paurillo
Dave Paurillo

Reputation: 231

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"
}
'''

Upvotes: 1

Related Questions