In application I'm using FusedLocationProviderClient
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
My location Request is
LocationRequest mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);
mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
When the devices location mode is in GPS only mode, this request seems not getting any location updates.
I can make a Location settings request and ask the user th change the location mode to HighAccuracy to support the location request.
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
builder.addLocationRequest(mLocationRequest);
mLocationSettingsRequest = builder.build();
It will show a dialog to the user and ask him to change the location mode, But this change is permenently change the Device Location mode to High Accuracy. Even after application closed, the change remain same and consume battary.
Is there any way to change the location mode only for the application? Some thing like, When the app running it can be in HighAccuracy mode and when application closed it will go back to whatever the mode the device was before.
