Switch to new location mode API recommended by API council

- Part of b/10461763 fix

Change-Id: I202ce4c817f24a1682796e92fed9cc3efcc31a81
This commit is contained in:
Tom O'Neill
2013-08-26 14:40:54 -07:00
parent cbf589e73c
commit 93259c14f3
2 changed files with 6 additions and 6 deletions

View File

@@ -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);
}
}