зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset deaef09b17c1 (bug 944725) for marionette web-api bustage on a CLOSED TREE
This commit is contained in:
Родитель
1e2e5432f7
Коммит
9fb2389abd
|
@ -667,13 +667,6 @@ this.USIM_TAG_NAME[ICC_USIM_EFUID_TAG] = "uid";
|
||||||
this.USIM_TAG_NAME[ICC_USIM_EFEMAIL_TAG] = "email";
|
this.USIM_TAG_NAME[ICC_USIM_EFEMAIL_TAG] = "email";
|
||||||
this.USIM_TAG_NAME[ICC_USIM_EFCCP1_TAG] = "ccp1";
|
this.USIM_TAG_NAME[ICC_USIM_EFCCP1_TAG] = "ccp1";
|
||||||
|
|
||||||
// Error message for ICC contact.
|
|
||||||
this.CONTACT_ERR_REQUEST_NOT_SUPPORTED = GECKO_ERROR_REQUEST_NOT_SUPPORTED;
|
|
||||||
this.CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED = "ContactTypeNotSupported";
|
|
||||||
this.CONTACT_ERR_FIELD_NOT_SUPPORTED = "FieldNotSupported";
|
|
||||||
this.CONTACT_ERR_NO_FREE_RECORD_FOUND = "NoFreeRecordFound";
|
|
||||||
this.CONTACT_ERR_CANNOT_ACCESS_PHONEBOOK = "CannotAccessPhoneBook";
|
|
||||||
|
|
||||||
// CDMA IMSI_M's byte const.
|
// CDMA IMSI_M's byte const.
|
||||||
// 3GPP2 C.S0065 Sec. 5.2.2
|
// 3GPP2 C.S0065 Sec. 5.2.2
|
||||||
this.CSIM_IMSI_M_MIN2_BYTE = 1;
|
this.CSIM_IMSI_M_MIN2_BYTE = 1;
|
||||||
|
|
|
@ -851,7 +851,7 @@ let RIL = {
|
||||||
*/
|
*/
|
||||||
readICCContacts: function readICCContacts(options) {
|
readICCContacts: function readICCContacts(options) {
|
||||||
if (!this.appType) {
|
if (!this.appType) {
|
||||||
options.errorMsg = CONTACT_ERR_REQUEST_NOT_SUPPORTED;
|
options.errorMsg = GECKO_ERROR_REQUEST_NOT_SUPPORTED;
|
||||||
this.sendChromeMessage(options);
|
this.sendChromeMessage(options);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -899,7 +899,7 @@ let RIL = {
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
if (!this.appType || !options.contact) {
|
if (!this.appType || !options.contact) {
|
||||||
onerror(CONTACT_ERR_REQUEST_NOT_SUPPORTED );
|
onerror(GECKO_ERROR_REQUEST_NOT_SUPPORTED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11162,20 +11162,19 @@ let ICCIOHelper = {
|
||||||
* Process ICC IO error.
|
* Process ICC IO error.
|
||||||
*/
|
*/
|
||||||
processICCIOError: function processICCIOError(options) {
|
processICCIOError: function processICCIOError(options) {
|
||||||
let requestError = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
let error = options.onerror || debug;
|
||||||
if (DEBUG) {
|
|
||||||
// See GSM11.11, TS 51.011 clause 9.4, and ISO 7816-4 for the error
|
// See GSM11.11, TS 51.011 clause 9.4, and ISO 7816-4 for the error
|
||||||
// description.
|
// description.
|
||||||
let errorMsg = "ICC I/O Error code " + requestError +
|
let errorMsg = "ICC I/O Error code " +
|
||||||
|
RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError] +
|
||||||
" EF id = " + options.fileId.toString(16) +
|
" EF id = " + options.fileId.toString(16) +
|
||||||
" command = " + options.command.toString(16);
|
" command = " + options.command.toString(16);
|
||||||
if (options.sw1 && options.sw2) {
|
if (options.sw1 && options.sw2) {
|
||||||
errorMsg += "(" + options.sw1.toString(16) +
|
errorMsg += "(" + options.sw1.toString(16) +
|
||||||
"/" + options.sw2.toString(16) + ")";
|
"/" + options.sw2.toString(16) + ")";
|
||||||
}
|
}
|
||||||
debug(errorMsg);
|
error(errorMsg);
|
||||||
}
|
|
||||||
onerror(requestError);
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
ICCIOHelper[ICC_COMMAND_SEEK] = null;
|
ICCIOHelper[ICC_COMMAND_SEEK] = null;
|
||||||
|
@ -12156,10 +12155,8 @@ let ICCRecordHelper = {
|
||||||
ICCIOHelper.loadNextRecord(options);
|
ICCIOHelper.loadNextRecord(options);
|
||||||
} else {
|
} else {
|
||||||
// No free record found.
|
// No free record found.
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug(CONTACT_ERR_NO_FREE_RECORD_FOUND);
|
error("No free record found.");
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_NO_FREE_RECORD_FOUND);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12660,10 +12657,8 @@ let ICCContactHelper = {
|
||||||
ICCRecordHelper.readADNLike(ICC_EF_FDN, onsuccess, onerror);
|
ICCRecordHelper.readADNLike(ICC_EF_FDN, onsuccess, onerror);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug("Unsupported contactType :" + contactType);
|
error(GECKO_ERROR_REQUEST_NOT_SUPPORTED);
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -12693,10 +12688,8 @@ let ICCContactHelper = {
|
||||||
ICCRecordHelper.findFreeRecordId(ICC_EF_FDN, onsuccess.bind(null, 0), onerror);
|
ICCRecordHelper.findFreeRecordId(ICC_EF_FDN, onsuccess.bind(null, 0), onerror);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug("Unsupported contactType :" + contactType);
|
error(GECKO_ERROR_REQUEST_NOT_SUPPORTED);
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -12711,10 +12704,8 @@ let ICCContactHelper = {
|
||||||
findUSimFreeADNRecordId: function findUSimFreeADNRecordId(pbrs, onsuccess, onerror) {
|
findUSimFreeADNRecordId: function findUSimFreeADNRecordId(pbrs, onsuccess, onerror) {
|
||||||
(function findFreeRecordId(pbrIndex) {
|
(function findFreeRecordId(pbrIndex) {
|
||||||
if (pbrIndex >= pbrs.length) {
|
if (pbrIndex >= pbrs.length) {
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug(CONTACT_ERR_NO_FREE_RECORD_FOUND);
|
error("No free record found.");
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_NO_FREE_RECORD_FOUND);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12758,6 +12749,7 @@ let ICCContactHelper = {
|
||||||
* @param onerror Callback to be called when error.
|
* @param onerror Callback to be called when error.
|
||||||
*/
|
*/
|
||||||
updateICCContact: function updateICCContact(appType, contactType, contact, pin2, onsuccess, onerror) {
|
updateICCContact: function updateICCContact(appType, contactType, contact, pin2, onsuccess, onerror) {
|
||||||
|
let error = onerror || debug;
|
||||||
switch (contactType) {
|
switch (contactType) {
|
||||||
case "adn":
|
case "adn":
|
||||||
if (!this.hasDfPhoneBook(appType)) {
|
if (!this.hasDfPhoneBook(appType)) {
|
||||||
|
@ -12768,16 +12760,13 @@ let ICCContactHelper = {
|
||||||
break;
|
break;
|
||||||
case "fdn":
|
case "fdn":
|
||||||
if (!pin2) {
|
if (!pin2) {
|
||||||
onerror(GECKO_ERROR_SIM_PIN2);
|
error("pin2 is empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ICCRecordHelper.updateADNLike(ICC_EF_FDN, contact, pin2, onsuccess, onerror);
|
ICCRecordHelper.updateADNLike(ICC_EF_FDN, contact, pin2, onsuccess, onerror);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (DEBUG) {
|
error(GECKO_ERROR_REQUEST_NOT_SUPPORTED);
|
||||||
debug("Unsupported contactType :" + contactType);
|
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -12948,10 +12937,8 @@ let ICCContactHelper = {
|
||||||
ICCRecordHelper.readANR(fileId, fileType, recordId, gotFieldCb, onerror);
|
ICCRecordHelper.readANR(fileId, fileType, recordId, gotFieldCb, onerror);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug("Unsupported field :" + field);
|
error("Unknown field " + field);
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_FIELD_NOT_SUPPORTED);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
@ -12991,10 +12978,8 @@ let ICCContactHelper = {
|
||||||
|
|
||||||
ICCRecordHelper.readIAP(pbr.iap.fileId, contact.recordId, gotIapCb, onerror);
|
ICCRecordHelper.readIAP(pbr.iap.fileId, contact.recordId, gotIapCb, onerror);
|
||||||
} else {
|
} else {
|
||||||
if (DEBUG) {
|
let error = onerror | debug;
|
||||||
debug("USIM PBR files in Type 3 format are not supported.");
|
error("USIM PBR files in Type 3 format are not supported.");
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_REQUEST_NOT_SUPPORTED);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -13009,10 +12994,8 @@ let ICCContactHelper = {
|
||||||
let gotPbrCb = function gotPbrCb(pbrs) {
|
let gotPbrCb = function gotPbrCb(pbrs) {
|
||||||
let pbr = pbrs[contact.pbrIndex];
|
let pbr = pbrs[contact.pbrIndex];
|
||||||
if (!pbr) {
|
if (!pbr) {
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug(CONTACT_ERR_CANNOT_ACCESS_PHONEBOOK);
|
error("Cannot access Phonebook.");
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_CANNOT_ACCESS_PHONEBOOK);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.updatePhonebookSet(pbr, contact, onsuccess, onerror);
|
this.updatePhonebookSet(pbr, contact, onsuccess, onerror);
|
||||||
|
@ -13089,11 +13072,6 @@ let ICCContactHelper = {
|
||||||
this.updateContactFieldType1(pbr, contact, field, onsuccess, onerror);
|
this.updateContactFieldType1(pbr, contact, field, onsuccess, onerror);
|
||||||
} else if (pbr[field].fileType === ICC_USIM_TYPE2_TAG) {
|
} else if (pbr[field].fileType === ICC_USIM_TYPE2_TAG) {
|
||||||
this.updateContactFieldType2(pbr, contact, field, onsuccess, onerror);
|
this.updateContactFieldType2(pbr, contact, field, onsuccess, onerror);
|
||||||
} else {
|
|
||||||
if (DEBUG) {
|
|
||||||
debug("USIM PBR files in Type 3 format are not supported.");
|
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_REQUEST_NOT_SUPPORTED);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -13111,11 +13089,6 @@ let ICCContactHelper = {
|
||||||
ICCRecordHelper.updateEmail(pbr, contact.recordId, contact.email, null, onsuccess, onerror);
|
ICCRecordHelper.updateEmail(pbr, contact.recordId, contact.email, null, onsuccess, onerror);
|
||||||
} else if (field === USIM_PBR_ANR0) {
|
} else if (field === USIM_PBR_ANR0) {
|
||||||
ICCRecordHelper.updateANR(pbr, contact.recordId, contact.anr[0], null, onsuccess, onerror);
|
ICCRecordHelper.updateANR(pbr, contact.recordId, contact.anr[0], null, onsuccess, onerror);
|
||||||
} else {
|
|
||||||
if (DEBUG) {
|
|
||||||
debug("Unsupported field :" + field);
|
|
||||||
}
|
|
||||||
onerror(CONTACT_ERR_FIELD_NOT_SUPPORTED);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -13150,13 +13123,7 @@ let ICCContactHelper = {
|
||||||
ICCRecordHelper.updateEmail(pbr, recordId, contact.email, contact.recordId, onsuccess, onerror);
|
ICCRecordHelper.updateEmail(pbr, recordId, contact.email, contact.recordId, onsuccess, onerror);
|
||||||
} else if (field === USIM_PBR_ANR0) {
|
} else if (field === USIM_PBR_ANR0) {
|
||||||
ICCRecordHelper.updateANR(pbr, recordId, contact.anr[0], contact.recordId, onsuccess, onerror);
|
ICCRecordHelper.updateANR(pbr, recordId, contact.anr[0], contact.recordId, onsuccess, onerror);
|
||||||
} else {
|
|
||||||
if (DEBUG) {
|
|
||||||
debug("Unsupported field :" + field);
|
|
||||||
}
|
}
|
||||||
onerror(CONTACT_ERR_FIELD_NOT_SUPPORTED);
|
|
||||||
}
|
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
ICCRecordHelper.readIAP(pbr.iap.fileId, contact.recordId, gotIapCb, onerror);
|
ICCRecordHelper.readIAP(pbr.iap.fileId, contact.recordId, gotIapCb, onerror);
|
||||||
|
@ -13185,10 +13152,8 @@ let ICCContactHelper = {
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
let errorCb = function errorCb(errorMsg) {
|
let errorCb = function errorCb(errorMsg) {
|
||||||
if (DEBUG) {
|
let error = onerror || debug;
|
||||||
debug(errorMsg + " USIM field " + field);
|
error(errorMsg + " USIM field " + field);
|
||||||
}
|
|
||||||
onerror(errorMsg);
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
ICCRecordHelper.findFreeRecordId(pbr[field].fileId, successCb, errorCb);
|
ICCRecordHelper.findFreeRecordId(pbr[field].fileId, successCb, errorCb);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче