Loading src/java/com/android/internal/telephony/MccTable.java +17 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,7 @@ public final class MccTable if (mcc != 0) { setTimezoneFromMccIfNeeded(context, mcc); setLocaleFromMccIfNeeded(context, mcc); setWifiCountryCodeFromMcc(context, mcc); } try { Configuration config = ActivityManagerNative.getDefault().getConfiguration(); Loading Loading @@ -294,6 +295,22 @@ public final class MccTable setSystemLocale(context, language, country); } /** * If the number of allowed wifi channels has not been set, set it based on * the MCC of the SIM. * @param context Context to act on. * @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA) */ private static void setWifiCountryCodeFromMcc(Context context, int mcc) { String country = MccTable.countryCodeForMcc(mcc); if (!country.isEmpty()) { Rlog.d(LOG_TAG, "WIFI_COUNTRY_CODE set to " + country); WifiManager wM = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); //persist wM.setCountryCode(country, true); } } static { sTable = new ArrayList<MccEntry>(240); Loading src/java/com/android/internal/telephony/PhoneBase.java +12 −0 Original line number Diff line number Diff line Loading @@ -709,6 +709,18 @@ public abstract class PhoneBase extends Handler implements Phone { country = l.substring(3, 5); } MccTable.setSystemLocale(mContext, language, country); if (!country.isEmpty()) { try { Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.WIFI_COUNTRY_CODE); } catch (Settings.SettingNotFoundException e) { // note this is not persisting WifiManager wM = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); wM.setCountryCode(country, false); } } return; } } Loading Loading
src/java/com/android/internal/telephony/MccTable.java +17 −0 Original line number Diff line number Diff line Loading @@ -190,6 +190,7 @@ public final class MccTable if (mcc != 0) { setTimezoneFromMccIfNeeded(context, mcc); setLocaleFromMccIfNeeded(context, mcc); setWifiCountryCodeFromMcc(context, mcc); } try { Configuration config = ActivityManagerNative.getDefault().getConfiguration(); Loading Loading @@ -294,6 +295,22 @@ public final class MccTable setSystemLocale(context, language, country); } /** * If the number of allowed wifi channels has not been set, set it based on * the MCC of the SIM. * @param context Context to act on. * @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA) */ private static void setWifiCountryCodeFromMcc(Context context, int mcc) { String country = MccTable.countryCodeForMcc(mcc); if (!country.isEmpty()) { Rlog.d(LOG_TAG, "WIFI_COUNTRY_CODE set to " + country); WifiManager wM = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); //persist wM.setCountryCode(country, true); } } static { sTable = new ArrayList<MccEntry>(240); Loading
src/java/com/android/internal/telephony/PhoneBase.java +12 −0 Original line number Diff line number Diff line Loading @@ -709,6 +709,18 @@ public abstract class PhoneBase extends Handler implements Phone { country = l.substring(3, 5); } MccTable.setSystemLocale(mContext, language, country); if (!country.isEmpty()) { try { Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.WIFI_COUNTRY_CODE); } catch (Settings.SettingNotFoundException e) { // note this is not persisting WifiManager wM = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); wM.setCountryCode(country, false); } } return; } } Loading