mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
Bug 895169 - B2G RIL: Check contact attributes values when export to SIM. r=vicamo
This commit is contained in:
parent
7c511e8959
commit
bd04de3d30
@ -41,7 +41,8 @@ function testAddContact(type, pin2) {
|
||||
|
||||
contact.init({
|
||||
name: "add",
|
||||
tel: [{value: "0912345678"}]
|
||||
tel: [{value: "0912345678"}],
|
||||
email:[]
|
||||
});
|
||||
|
||||
let updateRequest = icc.updateContact(type, contact, pin2);
|
||||
|
@ -922,22 +922,26 @@ RILContentHelper.prototype = {
|
||||
// Parsing nsDOMContact to Icc Contact format
|
||||
let iccContact = {};
|
||||
|
||||
if (contact.name) {
|
||||
if (Array.isArray(contact.name) && contact.name[0]) {
|
||||
iccContact.alphaId = contact.name[0];
|
||||
}
|
||||
|
||||
if (contact.tel) {
|
||||
iccContact.number = contact.tel[0].value;
|
||||
if (Array.isArray(contact.tel)) {
|
||||
iccContact.number = contact.tel[0] && contact.tel[0].value;
|
||||
let telArray = contact.tel.slice(1);
|
||||
let length = telArray.length;
|
||||
if (length > 0) {
|
||||
iccContact.anr = [];
|
||||
}
|
||||
for (let i = 0; i < telArray.length; i++) {
|
||||
iccContact.anr.push(telArray[i].value);
|
||||
}
|
||||
}
|
||||
|
||||
if (contact.email) {
|
||||
if (Array.isArray(contact.email) && contact.email[0]) {
|
||||
iccContact.email = contact.email[0].value;
|
||||
}
|
||||
|
||||
if (contact.tel.length > 1) {
|
||||
iccContact.anr = contact.tel.slice(1);
|
||||
}
|
||||
|
||||
cpmm.sendAsyncMessage("RIL:UpdateIccContact", {
|
||||
clientId: 0,
|
||||
data: {
|
||||
|
Loading…
Reference in New Issue
Block a user