diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2011-02-02 09:45:19 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2011-02-02 09:45:32 -0800 |
commit | 155b0ee0498cf863091f3f83a752eaaedf1257f8 (patch) | |
tree | 724c74aa84bd96afda2a4c900ab8aaa6549d7e19 /telephony | |
parent | 3d4069a2e0c1c23244ead88a177ec06a2ef7a7d1 (diff) | |
parent | 049b172b48663266f8aed02595fcb92e20d192c2 (diff) | |
download | frameworks_base-155b0ee0498cf863091f3f83a752eaaedf1257f8.zip frameworks_base-155b0ee0498cf863091f3f83a752eaaedf1257f8.tar.gz frameworks_base-155b0ee0498cf863091f3f83a752eaaedf1257f8.tar.bz2 |
Merge from open-source gingerbread
Change-Id: Iec6167bec8423e39dde053f23969c1c76e10a461
Diffstat (limited to 'telephony')
-rwxr-xr-x[-rw-r--r--] | telephony/java/com/android/internal/telephony/gsm/SIMRecords.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java index b14896a..e214061 100644..100755 --- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java +++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java @@ -141,6 +141,25 @@ public final class SIMRecords extends IccRecords { private static final int EVENT_SIM_REFRESH = 31; private static final int EVENT_GET_CFIS_DONE = 32; + // Lookup table for carriers known to produce SIMs which incorrectly indicate MNC length. + + private static final String[] MCCMNC_CODES_HAVING_3DIGITS_MNC = { + "405025", "405026", "405027", "405028", "405029", "405030", "405031", "405032", + "405033", "405034", "405035", "405036", "405037", "405038", "405039", "405040", + "405041", "405042", "405043", "405044", "405045", "405046", "405047", "405750", + "405751", "405752", "405753", "405754", "405755", "405756", "405799", "405800", + "405801", "405802", "405803", "405804", "405805", "405806", "405807", "405808", + "405809", "405810", "405811", "405812", "405813", "405814", "405815", "405816", + "405817", "405818", "405819", "405820", "405821", "405822", "405823", "405824", + "405825", "405826", "405827", "405828", "405829", "405830", "405831", "405832", + "405833", "405834", "405835", "405836", "405837", "405838", "405839", "405840", + "405841", "405842", "405843", "405844", "405845", "405846", "405847", "405848", + "405849", "405850", "405851", "405852", "405853", "405875", "405876", "405877", + "405878", "405879", "405880", "405881", "405882", "405883", "405884", "405885", + "405886", "405908", "405909", "405910", "405911", "405925", "405926", "405927", + "405928", "405929", "405932" + }; + // ***** Constructor SIMRecords(GSMPhone p) { @@ -498,6 +517,17 @@ public final class SIMRecords extends IccRecords { Log.d(LOG_TAG, "IMSI: " + imsi.substring(0, 6) + "xxxxxxx"); + if (((mncLength == UNKNOWN) || (mncLength == 2)) && + ((imsi != null) && (imsi.length() >= 6))) { + String mccmncCode = imsi.substring(0, 6); + for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { + if (mccmnc.equals(mccmncCode)) { + mncLength = 3; + break; + } + } + } + if (mncLength == UNKNOWN) { // the SIM has told us all it knows, but it didn't know the mnc length. // guess using the mcc @@ -742,6 +772,17 @@ public final class SIMRecords extends IccRecords { mncLength = UNKNOWN; } } finally { + if (((mncLength == UNINITIALIZED) || (mncLength == UNKNOWN) || + (mncLength == 2)) && ((imsi != null) && (imsi.length() >= 6))) { + String mccmncCode = imsi.substring(0, 6); + for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { + if (mccmnc.equals(mccmncCode)) { + mncLength = 3; + break; + } + } + } + if (mncLength == UNKNOWN || mncLength == UNINITIALIZED) { if (imsi != null) { try { |