Merge "Use MCC value to always override channel count setting" into eclair
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcc14d6a26
@@ -587,7 +587,7 @@ public final class MccTable
|
|||||||
if (mcc != 0) {
|
if (mcc != 0) {
|
||||||
setTimezoneFromMccIfNeeded(phone, mcc);
|
setTimezoneFromMccIfNeeded(phone, mcc);
|
||||||
setLocaleFromMccIfNeeded(phone, mcc);
|
setLocaleFromMccIfNeeded(phone, mcc);
|
||||||
setWifiChannelsFromMccIfNeeded(phone, mcc);
|
setWifiChannelsFromMcc(phone, mcc);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Configuration config = ActivityManagerNative.getDefault().getConfiguration();
|
Configuration config = ActivityManagerNative.getDefault().getConfiguration();
|
||||||
@@ -642,20 +642,14 @@ public final class MccTable
|
|||||||
* @param phone PhoneBase to act on (get context from).
|
* @param phone PhoneBase to act on (get context from).
|
||||||
* @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA)
|
* @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA)
|
||||||
*/
|
*/
|
||||||
private static void setWifiChannelsFromMccIfNeeded(PhoneBase phone, int mcc) {
|
private static void setWifiChannelsFromMcc(PhoneBase phone, int mcc) {
|
||||||
int wifiChannels = MccTable.wifiChannelsForMcc(mcc);
|
int wifiChannels = MccTable.wifiChannelsForMcc(mcc);
|
||||||
if (wifiChannels != 0) {
|
if (wifiChannels != 0) {
|
||||||
Context context = phone.getContext();
|
Context context = phone.getContext();
|
||||||
// only set to this default if the user hasn't manually set it
|
Log.d(LOG_TAG, "WIFI_NUM_ALLOWED_CHANNELS set to " + wifiChannels);
|
||||||
try {
|
WifiManager wM = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||||
Settings.Secure.getInt(context.getContentResolver(),
|
//persist
|
||||||
Settings.Secure.WIFI_NUM_ALLOWED_CHANNELS);
|
wM.setNumAllowedChannels(wifiChannels, true);
|
||||||
} catch (Settings.SettingNotFoundException e) {
|
|
||||||
Log.d(LOG_TAG, "WIFI_NUM_ALLOWED_CHANNESL set to " + wifiChannels);
|
|
||||||
WifiManager wM = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
|
||||||
// don't persist
|
|
||||||
wM.setNumAllowedChannels(wifiChannels, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user