diff options
author | David Christie <dnchrist@google.com> | 2013-08-21 10:46:59 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-08-21 10:46:59 -0700 |
commit | f1a265a9e7b17707760051afa432495dd390c913 (patch) | |
tree | 68e2173b9e72a8d91d1dc04f7b63f33b4be0f652 /packages/SystemUI | |
parent | ed2515e853a0440555d76b2b935086211107dcef (diff) | |
parent | 95ea52f3f16ae3c57515ad2c5f4681b19dc56acb (diff) | |
download | frameworks_base-f1a265a9e7b17707760051afa432495dd390c913.zip frameworks_base-f1a265a9e7b17707760051afa432495dd390c913.tar.gz frameworks_base-f1a265a9e7b17707760051afa432495dd390c913.tar.bz2 |
am 95ea52f3: am 8b525e75: Merge "Switch QuickSettings to new LocationMode setting api." into klp-dev
* commit '95ea52f3f16ae3c57515ad2c5f4681b19dc56acb':
Switch QuickSettings to new LocationMode setting api.
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java index c2ffff8..7455628 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java @@ -123,15 +123,17 @@ public class LocationController extends BroadcastReceiver { final ContentResolver cr = mContext.getContentResolver(); // When enabling location, a user consent dialog will pop up, and the // setting won't be fully enabled until the user accepts the agreement. - Settings.Secure.setLocationMasterSwitchEnabled(cr, enabled); + int mode = enabled + ? Settings.Secure.LOCATION_MODE_HIGH_ACCURACY : Settings.Secure.LOCATION_MODE_OFF; + Settings.Secure.setLocationMode(cr, mode); } /** - * Returns true if either gps or network location are enabled in settings. + * Returns true if location isn't disabled in settings. */ public boolean isLocationEnabled() { - ContentResolver contentResolver = mContext.getContentResolver(); - return Settings.Secure.isLocationMasterSwitchEnabled(contentResolver); + ContentResolver resolver = mContext.getContentResolver(); + return Settings.Secure.getLocationMode(resolver) != Settings.Secure.LOCATION_MODE_OFF; } /** |