зеркало из https://github.com/mozilla/gecko-dev.git
Bug 880369 - Part 1: Check mcc table if EFad dose not contain the length of mnc. r=allstars.chh
This commit is contained in:
Родитель
6a64da200b
Коммит
71c472cf88
|
@ -2554,5 +2554,42 @@ this.PDU_CDMA_MSG_CODING_IS_91_TYPE_SMS_FULL = 0x83;
|
|||
this.PDU_CDMA_MSG_CODING_IS_91_TYPE_CLI = 0x84;
|
||||
this.PDU_CDMA_MSG_CODING_IS_91_TYPE_SMS = 0x85;
|
||||
|
||||
/**
|
||||
* The table for MCC which the length of MNC is 3
|
||||
*
|
||||
* This table is built from below links.
|
||||
* - http://www.itu.int/pub/T-SP-E.212B-2013
|
||||
* - http://en.wikipedia.org/wiki/Mobile_Network_Code
|
||||
*/
|
||||
this.MCC_TABLE_FOR_MNC_LENGTH_IS_3 = [
|
||||
"302", // Canada
|
||||
"310", // United States of America
|
||||
"311", // United States of America
|
||||
"312", // United States of America
|
||||
"313", // United States of America
|
||||
"316", // United States of America
|
||||
"330", // Puerto Rico
|
||||
"334", // Mexico
|
||||
"338", // Jamaica
|
||||
"342", // Barbados
|
||||
"344", // Antigua and Barbuda
|
||||
"346", // Cayman Islands
|
||||
"348", // British Virgin Islands
|
||||
"350", // Bermuda
|
||||
"352", // Grenada
|
||||
"354", // Montserrat
|
||||
"356", // Saint Kitts and Nevis
|
||||
"358", // Saint Lucia
|
||||
"360", // Saint Vincent and the Grenadines
|
||||
"365", // Anguilla
|
||||
"366", // Dominica
|
||||
"376", // Turks and Caicos Islands
|
||||
"405", // India
|
||||
"708", // Honduras
|
||||
"722", // Argentina
|
||||
"732", // Colombia
|
||||
"750" // Falkland Islands (Malvinas)
|
||||
];
|
||||
|
||||
// Allow this file to be imported via Components.utils.import().
|
||||
this.EXPORTED_SYMBOLS = Object.keys(this);
|
||||
|
|
|
@ -10203,7 +10203,14 @@ let ICCRecordHelper = {
|
|||
// MCC is the first 3 digits of IMSI.
|
||||
RIL.iccInfo.mcc = imsi.substr(0,3);
|
||||
// The 4th byte of the response is the length of MNC.
|
||||
RIL.iccInfo.mnc = imsi.substr(3, ad[3]);
|
||||
let mncLength = ad && ad[3];
|
||||
if (!mncLength) {
|
||||
// If response dose not contain the length of MNC, check the MCC table
|
||||
// to decide the length of MNC.
|
||||
let index = MCC_TABLE_FOR_MNC_LENGTH_IS_3.indexOf(RIL.iccInfo.mcc);
|
||||
mncLength = (index !== -1) ? 3 : 2;
|
||||
}
|
||||
RIL.iccInfo.mnc = imsi.substr(3, mncLength);
|
||||
if (DEBUG) debug("MCC: " + RIL.iccInfo.mcc + " MNC: " + RIL.iccInfo.mnc);
|
||||
ICCUtilsHelper.handleICCInfoChange();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче