1

This SO thread seems to indicate that it does but the links to documentation in the same thread says:

Unless otherwise noted, all Location API methods require the Manifest.permission.ACCESS_COARSE_LOCATION or Manifest.permission.ACCESS_FINE_LOCATION permissions. If your application only has the coarse permission then providers will still return location results, but the exact location will be obfuscated to a coarse level of accuracy.

Which makes me think that Google added coarse location support for the GPS provider. However, I am getting this error:

Caused by: java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission.

Of course the best way forward would be to use the fused location provider API but until then I think the documentation should be clearer about this? Mostly looking for an updated answer.

imashnake_
  • 171
  • 9

2 Answers2

1

ACCESS_COARSE_LOCATION includes permission only for NETWORK_PROVIDER Not GPS.

Got to know more on this from the comments on this StackOverflow Thread

There seems to be a switch from the MarshmallowVersion. Pre Marshmallow the CoarseLocation let you use the Gps but obfuscate the location for privacy

Narendra_Nath
  • 4,578
  • 3
  • 13
  • 31
  • "In the case of LocationManager, you can only use the `NETWORK_PROVIDER`". Does this mean the documentation is wrong in saying that "**providers** will still return location results, but the exact location will be obfuscated to a coarse level of accuracy"? – imashnake_ Mar 04 '22 at 18:09
  • That works pre marshmallow. I think that part of the documentation is not mentioned, You can check the StackOverflow like for more reality. – Narendra_Nath Mar 04 '22 at 18:11
1

The short answer is Yes.

To be complete, starting from API31 the use of the GPS provider requires both ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions.
On lower APIs the GPS provider requires only the ACCESS_FINE_LOCATION permission.

Graziano
  • 313
  • 1
  • 4
  • 11