From 448baa08d09e4ae9159fa9318b8a2b05250a4c94 Mon Sep 17 00:00:00 2001 From: David Christie Date: Tue, 20 Aug 2013 15:22:33 -0700 Subject: [PATCH] Switch QuickSettings to new LocationMode setting api. Change-Id: Ie3981741ae422562e9c703b76d10278f285739c6 --- .../android/systemui/statusbar/policy/LocationController.java | 10 ++++++---- 1 file 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 c2ffff8f19c2..7455628b38b5 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; } /** -- 2.11.0