diff options
| author | 2017-07-04 17:33:52 +0800 | |
|---|---|---|
| committer | 2017-07-04 17:33:52 +0800 | |
| commit | 8cd6dad0052a57b16412087581a40b0df80dd15d (patch) | |
| tree | abb8c26d71749117f6fe416eda3ab428c2f5b9c1 | |
| parent | b975c88178775cfacd2b9685f6286605c009cec7 (diff) | |
The method of parseEfSpdi does not match TS24008.
Accordding to TS51101 and TS31102, Each PLMN is coded as follows:
Mobile Country Code (MCC) followed by the Mobile Network Code (MNC) according to 3GPP TS 24.008
Test: Boot phone and check log, wether parseEfSpdi works fine.
Change-Id: Iada3f25287e586ddb518a2916009f535011a8ab5
| -rw-r--r-- | telephony/java/com/android/internal/telephony/uicc/IccUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/telephony/java/com/android/internal/telephony/uicc/IccUtils.java b/telephony/java/com/android/internal/telephony/uicc/IccUtils.java index 67de87f2bf85..62d570c80043 100644 --- a/telephony/java/com/android/internal/telephony/uicc/IccUtils.java +++ b/telephony/java/com/android/internal/telephony/uicc/IccUtils.java @@ -64,7 +64,7 @@ public class IccUtils { /** * PLMN (MCC/MNC) is encoded as per 24.008 10.5.1.3 * Returns a concatenated string of MCC+MNC, stripping - * a trailing character for a 2-digit MNC + * all invalid character 'f' */ public static String bcdPlmnToString(byte[] data, int offset) { if (offset + 3 > data.length) { @@ -76,9 +76,9 @@ public class IccUtils { trans[2] = (byte) ((data[2 + offset] & 0xF0) | ((data[1 + offset] >> 4) & 0xF)); String ret = bytesToHexString(trans); - // For a 2-digit MNC we trim the trailing 'f' - if (ret.endsWith("f")) { - ret = ret.substring(0, ret.length() - 1); + // For a valid plmn we trim all character 'f' + if (ret.contains("f")) { + ret = ret.replaceAll("f", ""); } return ret; } |