mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1111990 - Support access EF_FDN only if FDN service is available. r=echen
This commit is contained in:
parent
3f07f3317f
commit
a8e9f406ce
@ -1316,6 +1316,7 @@ this.GECKO_ICC_SERVICES = {
|
||||
},
|
||||
// @see 3GPP2 C.S0023-D 3.4.18 (RUIM).
|
||||
ruim: {
|
||||
FDN: 3,
|
||||
ENHANCED_PHONEBOOK: 6,
|
||||
SPN: 17,
|
||||
SDN: 18
|
||||
|
@ -15271,6 +15271,7 @@ ICCContactHelperObject.prototype = {
|
||||
*/
|
||||
readICCContacts: function(appType, contactType, onsuccess, onerror) {
|
||||
let ICCRecordHelper = this.context.ICCRecordHelper;
|
||||
let ICCUtilsHelper = this.context.ICCUtilsHelper;
|
||||
|
||||
switch (contactType) {
|
||||
case GECKO_CARDCONTACT_TYPE_ADN:
|
||||
@ -15281,10 +15282,13 @@ ICCContactHelperObject.prototype = {
|
||||
}
|
||||
break;
|
||||
case GECKO_CARDCONTACT_TYPE_FDN:
|
||||
if (!ICCUtilsHelper.isICCServiceAvailable("FDN")) {
|
||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
||||
break;
|
||||
}
|
||||
ICCRecordHelper.readADNLike(ICC_EF_FDN, onsuccess, onerror);
|
||||
break;
|
||||
case GECKO_CARDCONTACT_TYPE_SDN:
|
||||
let ICCUtilsHelper = this.context.ICCUtilsHelper;
|
||||
if (!ICCUtilsHelper.isICCServiceAvailable("SDN")) {
|
||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
||||
break;
|
||||
@ -15411,6 +15415,7 @@ ICCContactHelperObject.prototype = {
|
||||
*/
|
||||
updateICCContact: function(appType, contactType, contact, pin2, onsuccess, onerror) {
|
||||
let ICCRecordHelper = this.context.ICCRecordHelper;
|
||||
let ICCUtilsHelper = this.context.ICCUtilsHelper;
|
||||
|
||||
switch (contactType) {
|
||||
case GECKO_CARDCONTACT_TYPE_ADN:
|
||||
@ -15425,6 +15430,10 @@ ICCContactHelperObject.prototype = {
|
||||
onerror(GECKO_ERROR_SIM_PIN2);
|
||||
return;
|
||||
}
|
||||
if (!ICCUtilsHelper.isICCServiceAvailable("FDN")) {
|
||||
onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
|
||||
break;
|
||||
}
|
||||
ICCRecordHelper.updateADNLike(ICC_EF_FDN, contact, pin2, onsuccess, onerror);
|
||||
break;
|
||||
default:
|
||||
|
@ -130,8 +130,12 @@ add_test(function test_read_icc_contacts() {
|
||||
ril.appType = aSimType;
|
||||
ril._isCdma = (aSimType === CARD_APPTYPE_RUIM);
|
||||
ril.iccInfoPrivate.cst = (aEnhancedPhoneBook) ?
|
||||
[0x0, 0x0C, 0x0, 0x0, 0x0]:
|
||||
[0x0, 0x00, 0x0, 0x0, 0x0];
|
||||
[0x20, 0x0C, 0x0, 0x0, 0x0]:
|
||||
[0x20, 0x00, 0x0, 0x0, 0x0];
|
||||
|
||||
ril.iccInfoPrivate.sst = (aSimType === CARD_APPTYPE_SIM)?
|
||||
[0x20, 0x0, 0x0, 0x0, 0x0]:
|
||||
[0x2, 0x0, 0x0, 0x0, 0x0];
|
||||
|
||||
// Override some functions to test.
|
||||
contactHelper.getContactFieldRecordId = function(pbr, contact, field, onsuccess, onerror) {
|
||||
@ -242,8 +246,11 @@ add_test(function test_update_icc_contact() {
|
||||
function do_test(aSimType, aContactType, aContact, aPin2, aFileType, aHaveIapIndex, aEnhancedPhoneBook) {
|
||||
ril.appType = aSimType;
|
||||
ril._isCdma = (aSimType === CARD_APPTYPE_RUIM);
|
||||
ril.iccInfoPrivate.cst = (aEnhancedPhoneBook) ? [0x0, 0x0C, 0x0, 0x0, 0x0]
|
||||
: [0x0, 0x00, 0x0, 0x0, 0x0];
|
||||
ril.iccInfoPrivate.cst = (aEnhancedPhoneBook) ? [0x20, 0x0C, 0x0, 0x0, 0x0]
|
||||
: [0x20, 0x00, 0x0, 0x0, 0x0];
|
||||
ril.iccInfoPrivate.sst = (aSimType === CARD_APPTYPE_SIM)?
|
||||
[0x20, 0x0, 0x0, 0x0, 0x0]:
|
||||
[0x2, 0x0, 0x0, 0x0, 0x0];
|
||||
|
||||
recordHelper.readPBR = function(onsuccess, onerror) {
|
||||
if (aFileType === ICC_USIM_TYPE1_TAG) {
|
||||
|
Loading…
Reference in New Issue
Block a user