Update references to migrated global settings.

Fixed one setting that was migrated but not marked deprecated.

Removed a hidden setting that is no longer used by the new
power manager service.

Bug: 7231172
Change-Id: I332f020f876a18d519a1a20598a172f1c98036f7
This commit is contained in:
Jeff Brown
2012-09-25 15:03:20 -07:00
parent 32bed2cc47
commit c67cf56735

View File

@@ -701,7 +701,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mNetConfigs[preference].isDefault()) { mNetConfigs[preference].isDefault()) {
if (mNetworkPreference != preference) { if (mNetworkPreference != preference) {
final ContentResolver cr = mContext.getContentResolver(); final ContentResolver cr = mContext.getContentResolver();
Settings.Secure.putInt(cr, Settings.Secure.NETWORK_PREFERENCE, preference); Settings.Global.putInt(cr, Settings.Global.NETWORK_PREFERENCE, preference);
synchronized(this) { synchronized(this) {
mNetworkPreference = preference; mNetworkPreference = preference;
} }
@@ -724,8 +724,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private int getPersistedNetworkPreference() { private int getPersistedNetworkPreference() {
final ContentResolver cr = mContext.getContentResolver(); final ContentResolver cr = mContext.getContentResolver();
final int networkPrefSetting = Settings.Secure final int networkPrefSetting = Settings.Global
.getInt(cr, Settings.Secure.NETWORK_PREFERENCE, -1); .getInt(cr, Settings.Global.NETWORK_PREFERENCE, -1);
if (networkPrefSetting != -1) { if (networkPrefSetting != -1) {
return networkPrefSetting; return networkPrefSetting;
} }
@@ -2108,14 +2108,14 @@ public class ConnectivityService extends IConnectivityManager.Stub {
final int timeout; final int timeout;
if (ConnectivityManager.isNetworkTypeMobile(type)) { if (ConnectivityManager.isNetworkTypeMobile(type)) {
timeout = Settings.Secure.getInt(mContext.getContentResolver(), timeout = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Secure.DATA_ACTIVITY_TIMEOUT_MOBILE, Settings.Global.DATA_ACTIVITY_TIMEOUT_MOBILE,
0); 0);
// Canonicalize mobile network type // Canonicalize mobile network type
type = ConnectivityManager.TYPE_MOBILE; type = ConnectivityManager.TYPE_MOBILE;
} else if (ConnectivityManager.TYPE_WIFI == type) { } else if (ConnectivityManager.TYPE_WIFI == type) {
timeout = Settings.Secure.getInt(mContext.getContentResolver(), timeout = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Secure.DATA_ACTIVITY_TIMEOUT_WIFI, Settings.Global.DATA_ACTIVITY_TIMEOUT_WIFI,
0); 0);
} else { } else {
// do not track any other networks // do not track any other networks
@@ -2930,8 +2930,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
public boolean isTetheringSupported() { public boolean isTetheringSupported() {
enforceTetherAccessPermission(); enforceTetherAccessPermission();
int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1); int defaultVal = (SystemProperties.get("ro.tether.denied").equals("true") ? 0 : 1);
boolean tetherEnabledInSettings = (Settings.Secure.getInt(mContext.getContentResolver(), boolean tetherEnabledInSettings = (Settings.Global.getInt(mContext.getContentResolver(),
Settings.Secure.TETHER_SUPPORTED, defaultVal) != 0); Settings.Global.TETHER_SUPPORTED, defaultVal) != 0);
return tetherEnabledInSettings && mTetheringConfigValid; return tetherEnabledInSettings && mTetheringConfigValid;
} }