diff options
author | Soonil Nagarkar <sooniln@google.com> | 2019-03-04 17:17:22 -0800 |
---|---|---|
committer | Jack He <siyuanh@google.com> | 2019-03-12 21:47:07 +0000 |
commit | 1841870f226e33fafab19d56322ebd0848cab6c7 (patch) | |
tree | f4a8b9e0a78e0a7aa30cc80a9e182d1e53cbc4c9 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | f96cc080668db4442b38e8e48d70db2e010ed354 (diff) |
DO NOT MERGE Let isLocationEnabledForUser() return true location setting
* In API 28, LocationManager#isLocationEnabled() and
LocationManager#isLocationEnabledForUser(UserHandle) always
return false when a device has neither LocationManager#GPS_PROVIDER
nor LocationManager#NETWORK_PROVIDER.
* Instead of letting setLocationEnabled() and isLocationEnabled()
depend on whether device has GPS or NETWORK location provider, this
CL changes these two APIs to directly use LOCATION_MODE setting to
store the location enable state
* Hence when LOCATION_PROVIDERS_ALLOWED contains a provider, the provider
may be used, but it is not guaranteed to exist
* Settings.java has two workarounds that actually convert:
- putInt(LOCATION_MODE, LOCATION_MODE_HIGH_ACCURACY)
=> putString(LOCATION_PROVIDERS_ALLOWED, "+gps");
=> putString(LOCATION_PROVIDERS_ALLOWED, "+network");
- getInt(LOCATION_MODE, LOCATION_MODE_HIGH_ACCURACY)
=> getString(LOCATION_PROVIDERS_ALLOWED):
- "gps,network" - LOCATION_MODE_HIGH_ACCURACY
- "gps" - LOCATION_MODE_SENSORS_ONLY
- "network" - LOCATION_MODE_BATTERY_SAVING
- others - LOCATION_MODE_OFF
* Hence this is NOT a new behavior
Bug: 121040693
Bug: 118242060
Bug: 127359153
Test: CTS tests,
android.bluetooth.cts.BluetoothLeScanTest#testBasicBleScan,
android.bluetooth.cts.BluetoothLeScanTest#testScanFilter,
android.location.cts.LocationManagerTest,
android.location2.cts.LocationManagerTest
Change-Id: I7972d8f97f4ca82c58c29641a081ef73fdcb106c
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions