Stop using the sim mnc/mcc to set wifi country.
Robert Greenwalt [Fri, 27 Sep 2013 22:10:40 +0000 (15:10 -0700)]
bug:10513734
Change-Id: Idac32892db8ff9b5ca4c5bde4f3f3b12f0df1196

src/java/com/android/internal/telephony/MccTable.java
src/java/com/android/internal/telephony/PhoneBase.java

index c4dd08d..d14f10d 100644 (file)
@@ -190,7 +190,6 @@ public final class MccTable
             if (mcc != 0) {
                 setTimezoneFromMccIfNeeded(context, mcc);
                 setLocaleFromMccIfNeeded(context, mcc);
-                setWifiCountryCodeFromMcc(context, mcc);
             }
             try {
                 Configuration config = ActivityManagerNative.getDefault().getConfiguration();
@@ -295,22 +294,6 @@ 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);
 
index 2a047c2..3aa23ce 100644 (file)
@@ -709,18 +709,6 @@ 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;
             }
         }