Ril parse iccInfo.mcc and iccInfo.mnc when reading EF_AD, but in CDMA mode, ril does not handle EF_AD. So the mcc/mnc of iccInfo are 'undefined'. We may need to find a way to get mcc/mnc of CDMA RUIM.
MCC/MNC is from IMSI's first 5 digits (C.S0005 2.3.1), we should able to get IMSI from EF_IMSI_M.
(In reply to Patrick Wang [:kk1fff] from comment #1) > MCC/MNC is from IMSI's first 5 digits (C.S0005 2.3.1), we should able to get > IMSI from EF_IMSI_M. Actually, MNC can be 2 digits or 3 digits . In gsm mode, we check the 4th byte of EF_AD to decide the mnc is 2 digits or 3 digits. It seems RUIM has EF_AD as well, but I didn't see mnc information mentioned in spec. (C.S0023-D session 3.4.33)  http://en.wikipedia.org/wiki/Mobile_Network_Code
AOSP has implemented a MCC table which contains all mcc and corresponding mnc length . If mnc length information isn't showed in EF_AD, AOSP will use this table to get mnc length .  https://android.googlesource.com/platform/frameworks/opt/telephony/+/master/src/java/com/android/internal/telephony/MccTable.java#319  https://android.googlesource.com/platform/frameworks/opt/telephony/+/master/src/java/com/android/internal/telephony/uicc/RuimRecords.java#215
In bug 880369, we add a MCC table for the case that AD dose not contain the length of MNC in some SIM card. I think we could re-use this table for CDMA. Thanks
Depends on: 880369
Created attachment 776152 [details] [diff] [review] Part 1: Get the mcc/mnc of CDMA RUIM, v1 1). Move the code of mcc/mnc parsing into a utility function, parseMccMncFromImsi. 2). For CDMA, there is no mncLength information in EF_AD, so we needn't to read EF_AD, we could parse mcc/mnc directly right after we got IMSI.
Created attachment 776153 [details] [diff] [review] Part 2: Xpcshell tests for the utility function of mcc/mnc parsing, v1
Created attachment 776156 [details] [diff] [review] Part 2: Xpcshell tests for the utility function of mcc/mnc parsing, v2
Attachment #776153 - Attachment is obsolete: true
Attachment #776152 - Flags: review?(allstars.chh)
Attachment #776156 - Flags: review?(allstars.chh)
Attachment #776152 - Flags: review?(allstars.chh) → review+
Attachment #776156 - Flags: review?(allstars.chh) → review+
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.