1 /* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.telephony; 18 19 import android.app.ActivityManagerNative; 20 import android.app.AlarmManager; 21 import android.app.IActivityManager; 22 import android.content.Context; 23 import android.content.res.Configuration; 24 import android.net.wifi.WifiManager; 25 import android.os.RemoteException; 26 import android.os.SystemProperties; 27 import android.telephony.TelephonyManager; 28 import android.text.TextUtils; 29 import android.telephony.Rlog; 30 31 import java.util.ArrayList; 32 import java.util.Collections; 33 import java.util.Locale; 34 import libcore.icu.TimeZoneNames; 35 36 /** 37 * Mobile Country Code 38 * 39 * {@hide} 40 */ 41 public final class MccTable 42 { 43 static final String LOG_TAG = "MccTable"; 44 45 static ArrayList<MccEntry> sTable; 46 47 static class MccEntry implements Comparable<MccEntry> 48 { 49 int mMcc; 50 String mIso; 51 int mSmallestDigitsMnc; 52 String mLanguage; 53 54 MccEntry(int mnc, String iso, int smallestDigitsMCC) { 55 this(mnc, iso, smallestDigitsMCC, null); 56 } 57 58 MccEntry(int mnc, String iso, int smallestDigitsMCC, String language) { 59 mMcc = mnc; 60 mIso = iso; 61 mSmallestDigitsMnc = smallestDigitsMCC; 62 mLanguage = language; 63 } 64 65 66 @Override 67 public int compareTo(MccEntry o) 68 { 69 return mMcc - o.mMcc; 70 } 71 } 72 73 private static MccEntry 74 entryForMcc(int mcc) 75 { 76 int index; 77 78 MccEntry m; 79 80 m = new MccEntry(mcc, null, 0); 81 82 index = Collections.binarySearch(sTable, m); 83 84 if (index < 0) { 85 return null; 86 } else { 87 return sTable.get(index); 88 } 89 } 90 91 /** 92 * Returns a default time zone ID for the given MCC. 93 * @param mcc Mobile Country Code 94 * @return default TimeZone ID, or null if not specified 95 */ 96 public static String defaultTimeZoneForMcc(int mcc) { 97 MccEntry entry; 98 99 entry = entryForMcc(mcc); 100 if (entry == null || entry.mIso == null) { 101 return null; 102 } else { 103 Locale locale; 104 if (entry.mLanguage == null) { 105 locale = new Locale(entry.mIso); 106 } else { 107 locale = new Locale(entry.mLanguage, entry.mIso); 108 } 109 String[] tz = TimeZoneNames.forLocale(locale); 110 if (tz.length == 0) return null; 111 return tz[0]; 112 } 113 } 114 115 /** 116 * Given a GSM Mobile Country Code, returns 117 * an ISO two-character country code if available. 118 * Returns "" if unavailable. 119 */ 120 public static String 121 countryCodeForMcc(int mcc) 122 { 123 MccEntry entry; 124 125 entry = entryForMcc(mcc); 126 127 if (entry == null) { 128 return ""; 129 } else { 130 return entry.mIso; 131 } 132 } 133 134 /** 135 * Given a GSM Mobile Country Code, returns 136 * an ISO 2-3 character language code if available. 137 * Returns null if unavailable. 138 */ 139 public static String defaultLanguageForMcc(int mcc) { 140 MccEntry entry; 141 142 entry = entryForMcc(mcc); 143 144 if (entry == null) { 145 return null; 146 } else { 147 return entry.mLanguage; 148 } 149 } 150 151 /** 152 * Given a GSM Mobile Country Code, returns 153 * the smallest number of digits that M if available. 154 * Returns 2 if unavailable. 155 */ 156 public static int 157 smallestDigitsMccForMnc(int mcc) 158 { 159 MccEntry entry; 160 161 entry = entryForMcc(mcc); 162 163 if (entry == null) { 164 return 2; 165 } else { 166 return entry.mSmallestDigitsMnc; 167 } 168 } 169 170 /** 171 * Updates MCC and MNC device configuration information for application retrieving 172 * correct version of resources. If either MCC or MNC is 0, they will be ignored (not set). 173 * @param context Context to act on. 174 * @param mccmnc truncated imsi with just the MCC and MNC - MNC assumed to be from 4th to end 175 */ 176 public static void updateMccMncConfiguration(Context context, String mccmnc) { 177 if (!TextUtils.isEmpty(mccmnc)) { 178 int mcc, mnc; 179 180 try { 181 mcc = Integer.parseInt(mccmnc.substring(0,3)); 182 mnc = Integer.parseInt(mccmnc.substring(3)); 183 } catch (NumberFormatException e) { 184 Rlog.e(LOG_TAG, "Error parsing IMSI"); 185 return; 186 } 187 188 Rlog.d(LOG_TAG, "updateMccMncConfiguration: mcc=" + mcc + ", mnc=" + mnc); 189 190 if (mcc != 0) { 191 setTimezoneFromMccIfNeeded(context, mcc); 192 setLocaleFromMccIfNeeded(context, mcc); 193 setWifiCountryCodeFromMcc(context, mcc); 194 } 195 try { 196 Configuration config = ActivityManagerNative.getDefault().getConfiguration(); 197 if (mcc != 0) { 198 config.mcc = mcc; 199 } 200 if (mnc != 0) { 201 config.mnc = mnc; 202 } 203 ActivityManagerNative.getDefault().updateConfiguration(config); 204 } catch (RemoteException e) { 205 Rlog.e(LOG_TAG, "Can't update configuration", e); 206 } 207 } 208 } 209 210 /** 211 * Utility code to set the system locale if it's not set already 212 * @param context Context to act on. 213 * @param language Two character language code desired 214 * @param country Two character country code desired 215 * 216 * {@hide} 217 */ 218 public static void setSystemLocale(Context context, String language, String country) { 219 String l = SystemProperties.get("persist.sys.language"); 220 String c = SystemProperties.get("persist.sys.country"); 221 222 if (null == language) { 223 return; // no match possible 224 } 225 language = language.toLowerCase(); 226 if (null == country) { 227 country = ""; 228 } 229 country = country.toUpperCase(); 230 231 if((null == l || 0 == l.length()) && (null == c || 0 == c.length())) { 232 try { 233 // try to find a good match 234 String[] locales = context.getAssets().getLocales(); 235 final int N = locales.length; 236 String bestMatch = null; 237 for(int i = 0; i < N; i++) { 238 // only match full (lang + country) locales 239 if (locales[i]!=null && locales[i].length() >= 5 && 240 locales[i].substring(0,2).equals(language)) { 241 if (locales[i].substring(3,5).equals(country)) { 242 bestMatch = locales[i]; 243 break; 244 } else if (null == bestMatch) { 245 bestMatch = locales[i]; 246 } 247 } 248 } 249 if (null != bestMatch) { 250 IActivityManager am = ActivityManagerNative.getDefault(); 251 Configuration config = am.getConfiguration(); 252 config.locale = new Locale(bestMatch.substring(0,2), 253 bestMatch.substring(3,5)); 254 config.userSetLocale = true; 255 am.updateConfiguration(config); 256 } 257 } catch (Exception e) { 258 // Intentionally left blank 259 } 260 } 261 } 262 263 /** 264 * If the timezone is not already set, set it based on the MCC of the SIM. 265 * @param context Context to act on. 266 * @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA) 267 */ 268 private static void setTimezoneFromMccIfNeeded(Context context, int mcc) { 269 String timezone = SystemProperties.get(ServiceStateTracker.TIMEZONE_PROPERTY); 270 if (timezone == null || timezone.length() == 0) { 271 String zoneId = defaultTimeZoneForMcc(mcc); 272 if (zoneId != null && zoneId.length() > 0) { 273 // Set time zone based on MCC 274 AlarmManager alarm = 275 (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); 276 alarm.setTimeZone(zoneId); 277 Rlog.d(LOG_TAG, "timezone set to "+zoneId); 278 } 279 } 280 } 281 282 /** 283 * If the locale is not already set, set it based on the MCC of the SIM. 284 * @param context Context to act on. 285 * @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA) 286 */ 287 private static void setLocaleFromMccIfNeeded(Context context, int mcc) { 288 if (TelephonyManager.getLteOnCdmaModeStatic() == PhoneConstants.LTE_ON_CDMA_TRUE) { 289 // Avoid system locale is set from MCC table if CDMALTEPhone is used. 290 // The locale will be picked up based on EFpl/EFli once CSIM records are loaded. 291 return; 292 } 293 String language = MccTable.defaultLanguageForMcc(mcc); 294 String country = MccTable.countryCodeForMcc(mcc); 295 296 Rlog.d(LOG_TAG, "locale set to "+language+"_"+country); 297 setSystemLocale(context, language, country); 298 } 299 300 /** 301 * If the number of allowed wifi channels has not been set, set it based on 302 * the MCC of the SIM. 303 * @param context Context to act on. 304 * @param mcc Mobile Country Code of the SIM or SIM-like entity (build prop on CDMA) 305 */ 306 private static void setWifiCountryCodeFromMcc(Context context, int mcc) { 307 String country = MccTable.countryCodeForMcc(mcc); 308 if (!country.isEmpty()) { 309 Rlog.d(LOG_TAG, "WIFI_COUNTRY_CODE set to " + country); 310 WifiManager wM = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); 311 //persist 312 wM.setCountryCode(country, true); 313 } 314 } 315 316 static { 317 sTable = new ArrayList<MccEntry>(240); 318 319 320 /* 321 * The table below is built from two resources: 322 * 323 * 1) ITU "Mobile Network Code (MNC) for the international 324 * identification plan for mobile terminals and mobile users" 325 * which is available as an annex to the ITU operational bulletin 326 * available here: http://www.itu.int/itu-t/bulletin/annex.html 327 * 328 * 2) The ISO 3166 country codes list, available here: 329 * http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html 330 * 331 * This table has not been verified. 332 * 333 */ 334 335 sTable.add(new MccEntry(202,"gr",2)); //Greece 336 sTable.add(new MccEntry(204,"nl",2,"nl")); //Netherlands (Kingdom of the) 337 sTable.add(new MccEntry(206,"be",2)); //Belgium 338 sTable.add(new MccEntry(208,"fr",2,"fr")); //France 339 sTable.add(new MccEntry(212,"mc",2)); //Monaco (Principality of) 340 sTable.add(new MccEntry(213,"ad",2)); //Andorra (Principality of) 341 sTable.add(new MccEntry(214,"es",2,"es")); //Spain 342 sTable.add(new MccEntry(216,"hu",2)); //Hungary (Republic of) 343 sTable.add(new MccEntry(218,"ba",2)); //Bosnia and Herzegovina 344 sTable.add(new MccEntry(219,"hr",2)); //Croatia (Republic of) 345 sTable.add(new MccEntry(220,"rs",2)); //Serbia and Montenegro 346 sTable.add(new MccEntry(222,"it",2,"it")); //Italy 347 sTable.add(new MccEntry(225,"va",2,"it")); //Vatican City State 348 sTable.add(new MccEntry(226,"ro",2)); //Romania 349 sTable.add(new MccEntry(228,"ch",2,"de")); //Switzerland (Confederation of) 350 sTable.add(new MccEntry(230,"cz",2,"cs")); //Czech Republic 351 sTable.add(new MccEntry(231,"sk",2)); //Slovak Republic 352 sTable.add(new MccEntry(232,"at",2,"de")); //Austria 353 sTable.add(new MccEntry(234,"gb",2,"en")); //United Kingdom of Great Britain and Northern Ireland 354 sTable.add(new MccEntry(235,"gb",2,"en")); //United Kingdom of Great Britain and Northern Ireland 355 sTable.add(new MccEntry(238,"dk",2)); //Denmark 356 sTable.add(new MccEntry(240,"se",2)); //Sweden 357 sTable.add(new MccEntry(242,"no",2)); //Norway 358 sTable.add(new MccEntry(244,"fi",2)); //Finland 359 sTable.add(new MccEntry(246,"lt",2)); //Lithuania (Republic of) 360 sTable.add(new MccEntry(247,"lv",2)); //Latvia (Republic of) 361 sTable.add(new MccEntry(248,"ee",2)); //Estonia (Republic of) 362 sTable.add(new MccEntry(250,"ru",2)); //Russian Federation 363 sTable.add(new MccEntry(255,"ua",2)); //Ukraine 364 sTable.add(new MccEntry(257,"by",2)); //Belarus (Republic of) 365 sTable.add(new MccEntry(259,"md",2)); //Moldova (Republic of) 366 sTable.add(new MccEntry(260,"pl",2)); //Poland (Republic of) 367 sTable.add(new MccEntry(262,"de",2,"de")); //Germany (Federal Republic of) 368 sTable.add(new MccEntry(266,"gi",2)); //Gibraltar 369 sTable.add(new MccEntry(268,"pt",2)); //Portugal 370 sTable.add(new MccEntry(270,"lu",2)); //Luxembourg 371 sTable.add(new MccEntry(272,"ie",2,"en")); //Ireland 372 sTable.add(new MccEntry(274,"is",2)); //Iceland 373 sTable.add(new MccEntry(276,"al",2)); //Albania (Republic of) 374 sTable.add(new MccEntry(278,"mt",2)); //Malta 375 sTable.add(new MccEntry(280,"cy",2)); //Cyprus (Republic of) 376 sTable.add(new MccEntry(282,"ge",2)); //Georgia 377 sTable.add(new MccEntry(283,"am",2)); //Armenia (Republic of) 378 sTable.add(new MccEntry(284,"bg",2)); //Bulgaria (Republic of) 379 sTable.add(new MccEntry(286,"tr",2)); //Turkey 380 sTable.add(new MccEntry(288,"fo",2)); //Faroe Islands 381 sTable.add(new MccEntry(289,"ge",2)); //Abkhazia (Georgia) 382 sTable.add(new MccEntry(290,"gl",2)); //Greenland (Denmark) 383 sTable.add(new MccEntry(292,"sm",2)); //San Marino (Republic of) 384 sTable.add(new MccEntry(293,"si",2)); //Slovenia (Republic of) 385 sTable.add(new MccEntry(294,"mk",2)); //The Former Yugoslav Republic of Macedonia 386 sTable.add(new MccEntry(295,"li",2)); //Liechtenstein (Principality of) 387 sTable.add(new MccEntry(297,"me",2)); //Montenegro (Republic of) 388 sTable.add(new MccEntry(302,"ca",3,"")); //Canada 389 sTable.add(new MccEntry(308,"pm",2)); //Saint Pierre and Miquelon (Collectivit territoriale de la Rpublique franaise) 390 sTable.add(new MccEntry(310,"us",3,"en")); //United States of America 391 sTable.add(new MccEntry(311,"us",3,"en")); //United States of America 392 sTable.add(new MccEntry(312,"us",3,"en")); //United States of America 393 sTable.add(new MccEntry(313,"us",3,"en")); //United States of America 394 sTable.add(new MccEntry(314,"us",3,"en")); //United States of America 395 sTable.add(new MccEntry(315,"us",3,"en")); //United States of America 396 sTable.add(new MccEntry(316,"us",3,"en")); //United States of America 397 sTable.add(new MccEntry(330,"pr",2)); //Puerto Rico 398 sTable.add(new MccEntry(332,"vi",2)); //United States Virgin Islands 399 sTable.add(new MccEntry(334,"mx",3)); //Mexico 400 sTable.add(new MccEntry(338,"jm",3)); //Jamaica 401 sTable.add(new MccEntry(340,"gp",2)); //Guadeloupe (French Department of) 402 sTable.add(new MccEntry(342,"bb",3)); //Barbados 403 sTable.add(new MccEntry(344,"ag",3)); //Antigua and Barbuda 404 sTable.add(new MccEntry(346,"ky",3)); //Cayman Islands 405 sTable.add(new MccEntry(348,"vg",3)); //British Virgin Islands 406 sTable.add(new MccEntry(350,"bm",2)); //Bermuda 407 sTable.add(new MccEntry(352,"gd",2)); //Grenada 408 sTable.add(new MccEntry(354,"ms",2)); //Montserrat 409 sTable.add(new MccEntry(356,"kn",2)); //Saint Kitts and Nevis 410 sTable.add(new MccEntry(358,"lc",2)); //Saint Lucia 411 sTable.add(new MccEntry(360,"vc",2)); //Saint Vincent and the Grenadines 412 sTable.add(new MccEntry(362,"ai",2)); //Netherlands Antilles 413 sTable.add(new MccEntry(363,"aw",2)); //Aruba 414 sTable.add(new MccEntry(364,"bs",2)); //Bahamas (Commonwealth of the) 415 sTable.add(new MccEntry(365,"ai",3)); //Anguilla 416 sTable.add(new MccEntry(366,"dm",2)); //Dominica (Commonwealth of) 417 sTable.add(new MccEntry(368,"cu",2)); //Cuba 418 sTable.add(new MccEntry(370,"do",2)); //Dominican Republic 419 sTable.add(new MccEntry(372,"ht",2)); //Haiti (Republic of) 420 sTable.add(new MccEntry(374,"tt",2)); //Trinidad and Tobago 421 sTable.add(new MccEntry(376,"tc",2)); //Turks and Caicos Islands 422 sTable.add(new MccEntry(400,"az",2)); //Azerbaijani Republic 423 sTable.add(new MccEntry(401,"kz",2)); //Kazakhstan (Republic of) 424 sTable.add(new MccEntry(402,"bt",2)); //Bhutan (Kingdom of) 425 sTable.add(new MccEntry(404,"in",2)); //India (Republic of) 426 sTable.add(new MccEntry(405,"in",2)); //India (Republic of) 427 sTable.add(new MccEntry(410,"pk",2)); //Pakistan (Islamic Republic of) 428 sTable.add(new MccEntry(412,"af",2)); //Afghanistan 429 sTable.add(new MccEntry(413,"lk",2)); //Sri Lanka (Democratic Socialist Republic of) 430 sTable.add(new MccEntry(414,"mm",2)); //Myanmar (Union of) 431 sTable.add(new MccEntry(415,"lb",2)); //Lebanon 432 sTable.add(new MccEntry(416,"jo",2)); //Jordan (Hashemite Kingdom of) 433 sTable.add(new MccEntry(417,"sy",2)); //Syrian Arab Republic 434 sTable.add(new MccEntry(418,"iq",2)); //Iraq (Republic of) 435 sTable.add(new MccEntry(419,"kw",2)); //Kuwait (State of) 436 sTable.add(new MccEntry(420,"sa",2)); //Saudi Arabia (Kingdom of) 437 sTable.add(new MccEntry(421,"ye",2)); //Yemen (Republic of) 438 sTable.add(new MccEntry(422,"om",2)); //Oman (Sultanate of) 439 sTable.add(new MccEntry(423,"ps",2)); //Palestine 440 sTable.add(new MccEntry(424,"ae",2)); //United Arab Emirates 441 sTable.add(new MccEntry(425,"il",2)); //Israel (State of) 442 sTable.add(new MccEntry(426,"bh",2)); //Bahrain (Kingdom of) 443 sTable.add(new MccEntry(427,"qa",2)); //Qatar (State of) 444 sTable.add(new MccEntry(428,"mn",2)); //Mongolia 445 sTable.add(new MccEntry(429,"np",2)); //Nepal 446 sTable.add(new MccEntry(430,"ae",2)); //United Arab Emirates 447 sTable.add(new MccEntry(431,"ae",2)); //United Arab Emirates 448 sTable.add(new MccEntry(432,"ir",2)); //Iran (Islamic Republic of) 449 sTable.add(new MccEntry(434,"uz",2)); //Uzbekistan (Republic of) 450 sTable.add(new MccEntry(436,"tj",2)); //Tajikistan (Republic of) 451 sTable.add(new MccEntry(437,"kg",2)); //Kyrgyz Republic 452 sTable.add(new MccEntry(438,"tm",2)); //Turkmenistan 453 sTable.add(new MccEntry(440,"jp",2,"ja")); //Japan 454 sTable.add(new MccEntry(441,"jp",2,"ja")); //Japan 455 sTable.add(new MccEntry(450,"kr",2,"ko")); //Korea (Republic of) 456 sTable.add(new MccEntry(452,"vn",2)); //Viet Nam (Socialist Republic of) 457 sTable.add(new MccEntry(454,"hk",2)); //"Hong Kong, China" 458 sTable.add(new MccEntry(455,"mo",2)); //"Macao, China" 459 sTable.add(new MccEntry(456,"kh",2)); //Cambodia (Kingdom of) 460 sTable.add(new MccEntry(457,"la",2)); //Lao People's Democratic Republic 461 sTable.add(new MccEntry(460,"cn",2,"zh")); //China (People's Republic of) 462 sTable.add(new MccEntry(461,"cn",2,"zh")); //China (People's Republic of) 463 sTable.add(new MccEntry(466,"tw",2)); //"Taiwan, China" 464 sTable.add(new MccEntry(467,"kp",2)); //Democratic People's Republic of Korea 465 sTable.add(new MccEntry(470,"bd",2)); //Bangladesh (People's Republic of) 466 sTable.add(new MccEntry(472,"mv",2)); //Maldives (Republic of) 467 sTable.add(new MccEntry(502,"my",2)); //Malaysia 468 sTable.add(new MccEntry(505,"au",2,"en")); //Australia 469 sTable.add(new MccEntry(510,"id",2)); //Indonesia (Republic of) 470 sTable.add(new MccEntry(514,"tl",2)); //Democratic Republic of Timor-Leste 471 sTable.add(new MccEntry(515,"ph",2)); //Philippines (Republic of the) 472 sTable.add(new MccEntry(520,"th",2)); //Thailand 473 sTable.add(new MccEntry(525,"sg",2,"en")); //Singapore (Republic of) 474 sTable.add(new MccEntry(528,"bn",2)); //Brunei Darussalam 475 sTable.add(new MccEntry(530,"nz",2, "en")); //New Zealand 476 sTable.add(new MccEntry(534,"mp",2)); //Northern Mariana Islands (Commonwealth of the) 477 sTable.add(new MccEntry(535,"gu",2)); //Guam 478 sTable.add(new MccEntry(536,"nr",2)); //Nauru (Republic of) 479 sTable.add(new MccEntry(537,"pg",2)); //Papua New Guinea 480 sTable.add(new MccEntry(539,"to",2)); //Tonga (Kingdom of) 481 sTable.add(new MccEntry(540,"sb",2)); //Solomon Islands 482 sTable.add(new MccEntry(541,"vu",2)); //Vanuatu (Republic of) 483 sTable.add(new MccEntry(542,"fj",2)); //Fiji (Republic of) 484 sTable.add(new MccEntry(543,"wf",2)); //Wallis and Futuna (Territoire franais d'outre-mer) 485 sTable.add(new MccEntry(544,"as",2)); //American Samoa 486 sTable.add(new MccEntry(545,"ki",2)); //Kiribati (Republic of) 487 sTable.add(new MccEntry(546,"nc",2)); //New Caledonia (Territoire franais d'outre-mer) 488 sTable.add(new MccEntry(547,"pf",2)); //French Polynesia (Territoire franais d'outre-mer) 489 sTable.add(new MccEntry(548,"ck",2)); //Cook Islands 490 sTable.add(new MccEntry(549,"ws",2)); //Samoa (Independent State of) 491 sTable.add(new MccEntry(550,"fm",2)); //Micronesia (Federated States of) 492 sTable.add(new MccEntry(551,"mh",2)); //Marshall Islands (Republic of the) 493 sTable.add(new MccEntry(552,"pw",2)); //Palau (Republic of) 494 sTable.add(new MccEntry(602,"eg",2)); //Egypt (Arab Republic of) 495 sTable.add(new MccEntry(603,"dz",2)); //Algeria (People's Democratic Republic of) 496 sTable.add(new MccEntry(604,"ma",2)); //Morocco (Kingdom of) 497 sTable.add(new MccEntry(605,"tn",2)); //Tunisia 498 sTable.add(new MccEntry(606,"ly",2)); //Libya (Socialist People's Libyan Arab Jamahiriya) 499 sTable.add(new MccEntry(607,"gm",2)); //Gambia (Republic of the) 500 sTable.add(new MccEntry(608,"sn",2)); //Senegal (Republic of) 501 sTable.add(new MccEntry(609,"mr",2)); //Mauritania (Islamic Republic of) 502 sTable.add(new MccEntry(610,"ml",2)); //Mali (Republic of) 503 sTable.add(new MccEntry(611,"gn",2)); //Guinea (Republic of) 504 sTable.add(new MccEntry(612,"ci",2)); //Cte d'Ivoire (Republic of) 505 sTable.add(new MccEntry(613,"bf",2)); //Burkina Faso 506 sTable.add(new MccEntry(614,"ne",2)); //Niger (Republic of the) 507 sTable.add(new MccEntry(615,"tg",2)); //Togolese Republic 508 sTable.add(new MccEntry(616,"bj",2)); //Benin (Republic of) 509 sTable.add(new MccEntry(617,"mu",2)); //Mauritius (Republic of) 510 sTable.add(new MccEntry(618,"lr",2)); //Liberia (Republic of) 511 sTable.add(new MccEntry(619,"sl",2)); //Sierra Leone 512 sTable.add(new MccEntry(620,"gh",2)); //Ghana 513 sTable.add(new MccEntry(621,"ng",2)); //Nigeria (Federal Republic of) 514 sTable.add(new MccEntry(622,"td",2)); //Chad (Republic of) 515 sTable.add(new MccEntry(623,"cf",2)); //Central African Republic 516 sTable.add(new MccEntry(624,"cm",2)); //Cameroon (Republic of) 517 sTable.add(new MccEntry(625,"cv",2)); //Cape Verde (Republic of) 518 sTable.add(new MccEntry(626,"st",2)); //Sao Tome and Principe (Democratic Republic of) 519 sTable.add(new MccEntry(627,"gq",2)); //Equatorial Guinea (Republic of) 520 sTable.add(new MccEntry(628,"ga",2)); //Gabonese Republic 521 sTable.add(new MccEntry(629,"cg",2)); //Congo (Republic of the) 522 sTable.add(new MccEntry(630,"cg",2)); //Democratic Republic of the Congo 523 sTable.add(new MccEntry(631,"ao",2)); //Angola (Republic of) 524 sTable.add(new MccEntry(632,"gw",2)); //Guinea-Bissau (Republic of) 525 sTable.add(new MccEntry(633,"sc",2)); //Seychelles (Republic of) 526 sTable.add(new MccEntry(634,"sd",2)); //Sudan (Republic of the) 527 sTable.add(new MccEntry(635,"rw",2)); //Rwanda (Republic of) 528 sTable.add(new MccEntry(636,"et",2)); //Ethiopia (Federal Democratic Republic of) 529 sTable.add(new MccEntry(637,"so",2)); //Somali Democratic Republic 530 sTable.add(new MccEntry(638,"dj",2)); //Djibouti (Republic of) 531 sTable.add(new MccEntry(639,"ke",2)); //Kenya (Republic of) 532 sTable.add(new MccEntry(640,"tz",2)); //Tanzania (United Republic of) 533 sTable.add(new MccEntry(641,"ug",2)); //Uganda (Republic of) 534 sTable.add(new MccEntry(642,"bi",2)); //Burundi (Republic of) 535 sTable.add(new MccEntry(643,"mz",2)); //Mozambique (Republic of) 536 sTable.add(new MccEntry(645,"zm",2)); //Zambia (Republic of) 537 sTable.add(new MccEntry(646,"mg",2)); //Madagascar (Republic of) 538 sTable.add(new MccEntry(647,"re",2)); //Reunion (French Department of) 539 sTable.add(new MccEntry(648,"zw",2)); //Zimbabwe (Republic of) 540 sTable.add(new MccEntry(649,"na",2)); //Namibia (Republic of) 541 sTable.add(new MccEntry(650,"mw",2)); //Malawi 542 sTable.add(new MccEntry(651,"ls",2)); //Lesotho (Kingdom of) 543 sTable.add(new MccEntry(652,"bw",2)); //Botswana (Republic of) 544 sTable.add(new MccEntry(653,"sz",2)); //Swaziland (Kingdom of) 545 sTable.add(new MccEntry(654,"km",2)); //Comoros (Union of the) 546 sTable.add(new MccEntry(655,"za",2,"en")); //South Africa (Republic of) 547 sTable.add(new MccEntry(657,"er",2)); //Eritrea 548 sTable.add(new MccEntry(702,"bz",2)); //Belize 549 sTable.add(new MccEntry(704,"gt",2)); //Guatemala (Republic of) 550 sTable.add(new MccEntry(706,"sv",2)); //El Salvador (Republic of) 551 sTable.add(new MccEntry(708,"hn",3)); //Honduras (Republic of) 552 sTable.add(new MccEntry(710,"ni",2)); //Nicaragua 553 sTable.add(new MccEntry(712,"cr",2)); //Costa Rica 554 sTable.add(new MccEntry(714,"pa",2)); //Panama (Republic of) 555 sTable.add(new MccEntry(716,"pe",2)); //Peru 556 sTable.add(new MccEntry(722,"ar",3)); //Argentine Republic 557 sTable.add(new MccEntry(724,"br",2)); //Brazil (Federative Republic of) 558 sTable.add(new MccEntry(730,"cl",2)); //Chile 559 sTable.add(new MccEntry(732,"co",3)); //Colombia (Republic of) 560 sTable.add(new MccEntry(734,"ve",2)); //Venezuela (Bolivarian Republic of) 561 sTable.add(new MccEntry(736,"bo",2)); //Bolivia (Republic of) 562 sTable.add(new MccEntry(738,"gy",2)); //Guyana 563 sTable.add(new MccEntry(740,"ec",2)); //Ecuador 564 sTable.add(new MccEntry(742,"gf",2)); //French Guiana (French Department of) 565 sTable.add(new MccEntry(744,"py",2)); //Paraguay (Republic of) 566 sTable.add(new MccEntry(746,"sr",2)); //Suriname (Republic of) 567 sTable.add(new MccEntry(748,"uy",2)); //Uruguay (Eastern Republic of) 568 sTable.add(new MccEntry(750,"fk",2)); //Falkland Islands (Malvinas) 569 //table.add(new MccEntry(901,"",2)); //"International Mobile, shared code" 570 571 Collections.sort(sTable); 572 } 573 } 574