diff options
author | Tom O'Neill <tomo@google.com> | 2013-08-27 15:48:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-27 15:48:34 +0000 |
commit | 9066b9140c376cb1b66a3eee830d9dfa177c6056 (patch) | |
tree | 2f211b8444a12e43bc2e114fee8ff9859c53a0c3 /src | |
parent | 5d821bedb1f065702b9920fe15a6f81bc19ba36b (diff) | |
parent | 93259c14f3aca4739e2cf7691cb0416ded509d8d (diff) | |
download | packages_apps_Settings-9066b9140c376cb1b66a3eee830d9dfa177c6056.zip packages_apps_Settings-9066b9140c376cb1b66a3eee830d9dfa177c6056.tar.gz packages_apps_Settings-9066b9140c376cb1b66a3eee830d9dfa177c6056.tar.bz2 |
Merge "Switch to new location mode API recommended by API council" into klp-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/location/LocationSettingsBase.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/widget/SettingsAppWidgetProvider.java | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/settings/location/LocationSettingsBase.java b/src/com/android/settings/location/LocationSettingsBase.java index 415e343..5637b25 100644 --- a/src/com/android/settings/location/LocationSettingsBase.java +++ b/src/com/android/settings/location/LocationSettingsBase.java @@ -17,7 +17,6 @@ package com.android.settings.location; import android.content.ContentQueryMap; -import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.os.UserManager; @@ -79,13 +78,13 @@ public abstract class LocationSettingsBase extends SettingsPreferenceFragment { if (um.hasUserRestriction(UserManager.DISALLOW_SHARE_LOCATION)) { return; } - Settings.Secure.setLocationMode(getContentResolver(), mode); + Settings.Secure.putInt(getContentResolver(), Settings.Secure.LOCATION_MODE, mode); refreshLocationMode(); } public void refreshLocationMode() { - ContentResolver res = getContentResolver(); - int mode = Settings.Secure.getLocationMode(getContentResolver()); + int mode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE, + Settings.Secure.LOCATION_MODE_OFF); onModeChanged(mode); } } diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java index 71994a9..da085f7 100644 --- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java +++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java @@ -521,7 +521,8 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { @Override public int getActualState(Context context) { ContentResolver resolver = context.getContentResolver(); - int currentLocationMode = Settings.Secure.getLocationMode(resolver); + int currentLocationMode = Settings.Secure.getInt(resolver, + Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF); switch (currentLocationMode) { case Settings.Secure.LOCATION_MODE_BATTERY_SAVING: case Settings.Secure.LOCATION_MODE_OFF: @@ -550,7 +551,7 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { int mode = desiredState ? Settings.Secure.LOCATION_MODE_HIGH_ACCURACY : Settings.Secure.LOCATION_MODE_BATTERY_SAVING; - Settings.Secure.setLocationMode(resolver, mode); + Settings.Secure.putInt(resolver, Settings.Secure.LOCATION_MODE, mode); return desiredState; } |