B2G RIL: Check contact attributes values when export to SIM

RESOLVED FIXED in mozilla26

Status

()

defect
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: arcturus, Assigned: allstars.chh)

Tracking

Trunk
mozilla26
ARM
Gonk (Firefox OS)
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [u=commsapps-user c=contacts p=0])

Attachments

(1 attachment, 1 obsolete attachment)

When exporting a contact to the SIM card we assume that contact attribute will have at least one value.

i.e:

http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/RILContentHelper.js#881

If the contact doesn't have any email, the mozContact can have an empty array as email attribute.

Same will happen in lines above.
Reuben, Gregor

Just reproduced it taking a contact already saved in the api, and trying to do the export.

Right now this is blocking bug 887673, new feature in 1.2 version.

Thanks a lot guys!
Blocks: 887673
blocking-b2g: --- → koi?
Checking again this bug, the error now lives in line:

http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/RILContentHelper.js#924

|if (contact.name) {
       iccContact.alphaId = contact.name[0];
     }
 
     if (contact.tel) {
       iccContact.number = contact.tel[0].value;
     }
 
     if (contact.email) {
       iccContact.email = contact.email[0].value;
     }
 
     if (contact.tel.length > 1) {
       iccContact.anr = contact.tel.slice(1);
     }
|

We need the contact to have name, email and phone number, but we can save contacts that are just an email, or just a phone or just the name.
Component: General → DOM: Device Interfaces
OS: Mac OS X → Gonk (Firefox OS)
Product: Boot2Gecko → Core
Hardware: x86 → ARM
Version: unspecified → Trunk
Assignee: nobody → allstars.chh
Summary: [CONTACTS] Check contact attributes values when export to SIM → B2G RIL: Check contact attributes values when export to SIM
Whiteboard: [u=commsapps-user c=contacts p=0]
Posted patch Patch (obsolete) — Splinter Review
Attachment #787300 - Flags: review?(vyang)
Comment on attachment 787300 [details] [diff] [review]
Patch

Review of attachment 787300 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/RILContentHelper.js
@@ +909,4 @@
>    },
>  
>    updateContact: function updateContact(window, contactType, contact, pin2) {
> +    debug("XXX updateContact contact="+JSON.stringify(contact));

Please remove this debug line or wrap it with |if (DEBUG) {...}|.

@@ +937,1 @@
>        iccContact.anr = contact.tel.slice(1);

Please move this into previous |contact.tel| check.  And it seems ril_worker expects an array of strings, not an array of |{value: <string>}|.
Attachment #787300 - Flags: review?(vyang)
Posted patch Patch v2.Splinter Review
Attachment #787300 - Attachment is obsolete: true
Attachment #788021 - Flags: review?(vyang)
Attachment #788021 - Flags: review?(vyang) → review+
https://hg.mozilla.org/mozilla-central/rev/4c6b93898662
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
blocking-b2g: koi? → ---
Removing koi? since this is in gecko 26 which will be the basis for Firefox OS 1.2.
You need to log in before you can comment on or make changes to this bug.