am 876f95ed: am b32e2216: Merge changes I332f020f,I632648ac into jb-mr1-dev
* commit '876f95ed7f914b4d86634db552277f835d288805': Update references to migrated global settings. Handle user switched for settings changes.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user