I've been playing around with FusedLocationProvider and I found that if your phone's Location Mode is set to "Device Only" (changed in Settings - it means only GPS is enabled for location. Wifi networks and cell towers aren't used to improve accuracy), then I couldn't find a way for FusedLocationProvider to get you a location without asking the user to change it to High Accuracy (onResolutionRequired is always called).
All four LocationRequest priorities did not work:
Is there no way to get location through FusedLocationProvider if the device is in this mode? I am pretty sure you can get it through the android.location.LocationManager. That seems like a huge design flaw if this is meant to be better abstraction on top of it..
You do need to use LocationManager to detect this, and I agree that it's really dumb. Use the following code:
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (locationManager != null && locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
requestLocationUpdates();
} else {
//Location request code
}
Here's a sample project I've made that incorporates this technique: