Merge "Remembers previous location mode when location off"

This commit is contained in:
Lifu Tang
2015-12-02 00:06:40 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -398,7 +398,7 @@ public class LocationSettings extends LocationSettingsBase
@Override @Override
public void onSwitchChanged(Switch switchView, boolean isChecked) { public void onSwitchChanged(Switch switchView, boolean isChecked) {
if (isChecked) { if (isChecked) {
setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_HIGH_ACCURACY); setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_PREVIOUS);
} else { } else {
setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_OFF); setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_OFF);
} }

View File

@@ -569,7 +569,7 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider {
mode = Settings.Secure.LOCATION_MODE_OFF; mode = Settings.Secure.LOCATION_MODE_OFF;
break; break;
case Settings.Secure.LOCATION_MODE_OFF: case Settings.Secure.LOCATION_MODE_OFF:
mode = Settings.Secure.LOCATION_MODE_HIGH_ACCURACY; mode = Settings.Secure.LOCATION_MODE_PREVIOUS;
break; break;
} }
Settings.Secure.putInt(resolver, Settings.Secure.LOCATION_MODE, mode); Settings.Secure.putInt(resolver, Settings.Secure.LOCATION_MODE, mode);