Closed Bug 915987 Opened 11 years ago Closed 11 years ago

B2G RIL: Map recordId from ICC Contact to mozContact.id

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.2 FC (16sep)

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

Attachments

(3 files)

In Bug 850098 we're trying to create another DOM object IccContact, and we need the id mapping when we try to edit or delete the SIM contact. But it seems we can reuse the id property from nsIDOMContact, and this id property can be used to identify the record Id (or index) for the contact on SIM.
Attachment #804256 - Flags: review?(vyang)
Attachment #804256 - Flags: review?(htsai)
Attachment #804256 - Flags: review+
Comment on attachment 804254 [details] [diff] [review]
Part 1: reuse nsIDOMContact.id.

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

::: dom/system/gonk/ril_worker.js
@@ +882,5 @@
>        options.contactType,
>        function onsuccess(contacts) {
>          // Reuse 'options' to get 'requestId' and 'contactType'.
>          options.contacts = contacts;
> +        options.iccid = RIL.iccInfo.iccid;

nit: please also update that comment line to include 'recordId' as well.
Attachment #804254 - Flags: review?(vyang)
Attachment #804254 - Flags: review?(htsai)
Attachment #804254 - Flags: review+
Comment on attachment 804255 [details] [diff] [review]
Part 2: Update recordId for USIM contact

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

Can't this patch merge into part 1 line 922?
Attachment #804255 - Flags: review?(vyang)
Attachment #804255 - Flags: review?(htsai)
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #5)
> Comment on attachment 804255 [details] [diff] [review]
> Part 2: Update recordId for USIM contact
> 
> Review of attachment 804255 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Can't this patch merge into part 1 line 922?

You can see ICCContactHelper.readUSimContact, the recordId and the phonebook set id should be handled inside that function.
I don't think we should do this in Part 1.
Comment on attachment 804255 [details] [diff] [review]
Part 2: Update recordId for USIM contact

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

After clarification from yoshi, we may have two phone book set and each of them have |ICC_MAX_LINEAR_FIXED_RECORDS| records.  The |recordId| attribute could be 0..(2*ICC_MAX_LINEAR_FIXED_RECORDS - 1) and we only need the offset part before diving into |ICCContactHelper.updateUSimContact()|.
Attachment #804255 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/bb2c8956f37b
https://hg.mozilla.org/mozilla-central/rev/1a4154829e67
https://hg.mozilla.org/mozilla-central/rev/72c352e6ee38
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 1.2 FC (16sep)
Blocks: 1157082
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: