Fix location settings bug on non-GPS devices
The old location_mode API hardcoded gps and network location provider when it enables/disables location, without checking whether the providers exist on device. It causes bugs when used together with the new LocationManager.setLocationEnabled() APIs. This fix modified LocationManager.setLocationEnabled() API when user tries to disable location on device. Besides turning off the providers from LocationManager.getAllProviders(), it also turns off GPS and network provider explicitly. To reduce times of binding to the service and chance of race condition, we also modified SettingsProvider.updateLocationProvidersAllowedLocked() to accept a string param with multiple location providers to be enabled or disalbed at the same time. Bug: 73261572 Test: Manual on chromebook Change-Id: I2e59e0d4cf395b98cd481af5d7f3c762274d7826
Loading
Please register or sign in to comment