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