Closed
Bug 788377
Opened 12 years ago
Closed 12 years ago
SIM Contacts Import is broken
Categories
(Core :: DOM: Device Interfaces, defect)
Core
DOM: Device Interfaces
Tracking
()
People
(Reporter: gwagner, Assigned: allstars.chh)
References
Details
(Whiteboard: [WebAPI:P0])
Attachments
(3 files, 6 obsolete files)
2.66 KB,
patch
|
gwagner
:
review+
|
Details | Diff | Splinter Review |
4.73 KB,
patch
|
Details | Diff | Splinter Review | |
2.66 KB,
patch
|
Details | Diff | Splinter Review |
Currently I see following if I enable the debug flag to import my 3 contacts from the SIM card:
I/Gecko ( 1498): RIL Worker: We have at least one complete parcel.
I/Gecko ( 1498): RIL Worker: Solicited response for request type 28, token 338, error 0
I/Gecko ( 1498): RIL Worker: Handling parcel as REQUEST_SIM_IO
I/Gecko ( 1498): RIL Worker: ADN[0] alphaId = Asdf number = 123456
I/Gecko ( 1498): RIL Worker: ADN[1] alphaId = Ghjk number = 987654
I/Gecko ( 1498): RIL Worker: ADN[2] alphaId = Namr?e number = 123
I/Gecko ( 1498): RIL Worker: Parcel handling threw DataCloneError: The object could not be cloned.
I/Gecko ( 1498): undefined
I/Gecko ( 1498): RIL Worker: Next parcel size unknown, going to sleep.
Reporter | ||
Updated•12 years ago
|
blocking-basecamp: --- → ?
Reporter | ||
Comment 1•12 years ago
|
||
It fails in postmessage with following message:
I/Gecko ( 2063): RIL Worker: {"command":178,"fileId":20282,"pathId":"3f007f105f3a","p1":250,"p2":4,"p3":32,"data":null,"pin2":null,"type":1,"loadAll":true,"requestId":138,"rilRequestType":28,"rilRequestError":0,"recordSize":32,"totalRecords":250,"rilMessageType":"icccontacts","contactType":"ADN","contacts":[{"alphaId":"Asdf","number":"123456"},{"alphaId":"Ghjk","number":"987654"},{"alphaId":"Namr?e","number":"123"}]}
I/Gecko ( 2063): RIL Worker: Parcel handling threw DataCloneError: The object could not be cloned.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → allstars.chh
Assignee | ||
Comment 2•12 years ago
|
||
Hi, philikon
I found that if I reuse the options object, and the DataCloneError will happen.
But I don't know why. Maybe you can shed me some light here.
The original 'options' contains many properties, so in this patch I create another simple object.
Thanks
Attachment #658424 -
Flags: review?(philipp)
Comment 3•12 years ago
|
||
Comment on attachment 658424 [details] [diff] [review]
Patch
Review of attachment 658424 [details] [diff] [review]:
-----------------------------------------------------------------
Ah yes, DataCloneError will be thrown if you're trying to an object that can't be represented as structured clone data from one thread to another. I'm guessing in this case it's the callback functions (`options.callback` and `options.onerror`). In which case your fix scratches only the tip of the iceberg. How about before invoking these callbacks, we delete them from `options`?
Attachment #658424 -
Flags: review?(philipp) → review-
Comment 4•12 years ago
|
||
Importing contacts from the SIM is a v1 requirement.
blocking-basecamp: ? → +
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #658424 -
Attachment is obsolete: true
Attachment #658753 -
Flags: review?(philipp)
Assignee | ||
Comment 6•12 years ago
|
||
Hi, philikon
Thanks for your comments, it was caused by function object in options.
So now I delete them first so I can reuse the options object now.
Thanks for your valuable comments. :)
Attachment #658754 -
Flags: review?(philipp)
Updated•12 years ago
|
Whiteboard: [WebAPI:P0]
Assignee | ||
Comment 7•12 years ago
|
||
update comments in the IDL.
Attachment #658753 -
Attachment is obsolete: true
Attachment #658753 -
Flags: review?(philipp)
Attachment #659110 -
Flags: review?(philipp)
Assignee | ||
Comment 8•12 years ago
|
||
revise typos.
Attachment #659110 -
Attachment is obsolete: true
Attachment #659110 -
Flags: review?(philipp)
Attachment #659111 -
Flags: review?
Assignee | ||
Updated•12 years ago
|
Attachment #659111 -
Attachment is obsolete: true
Attachment #659111 -
Flags: review?
Assignee | ||
Updated•12 years ago
|
Attachment #659111 -
Attachment is obsolete: false
Attachment #659111 -
Flags: review?(philipp)
Assignee | ||
Comment 9•12 years ago
|
||
Hi, gwagner
I just rename type to contactType in order to simplify implementatin(Part 3).
Could you review this for me ?
Thanks
Attachment #658754 -
Attachment is obsolete: true
Attachment #658754 -
Flags: review?(philipp)
Attachment #659179 -
Flags: review?(anygregor)
Assignee | ||
Comment 10•12 years ago
|
||
Hi, philikon
This is the implementations,
can you review this for me?
Thanks
Attachment #659180 -
Flags: review?(philipp)
Reporter | ||
Updated•12 years ago
|
Attachment #659179 -
Flags: review?(anygregor) → review+
Comment 11•12 years ago
|
||
Comment on attachment 659111 [details] [diff] [review]
Part 1: Rename type to contactType in getICCContacts. v3
Review of attachment 659111 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/nsIRadioInterfaceLayer.idl
@@ +127,5 @@
> * Type of the dialling number, i.e. ADN, FDN.
> * @param contacts
> * Array of the ICC contacts of the specified type.
> */
> + void receiveContactsList(in DOMString contactType, in jsval contacts);
Don't forget to rev the UUID of nsIRILContactCallback
@@ +292,5 @@
> + * "FDN" (Fixed Dialling Numbers)
> + * @param callback
> + * A nsIRILContactCallback object.
> + */
> + void getICCContacts(in DOMString contactType, in nsIRILContactCallback callback);
Nit: overlong line. We often put each parameter in IDLs on its own line anyway.
Attachment #659111 -
Flags: review?(philipp) → review+
Comment 12•12 years ago
|
||
Comment on attachment 659180 [details] [diff] [review]
Part 3: Get SIM Contacts.
Review of attachment 659180 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/ril_worker.js
@@ +1291,5 @@
> " number = " + this.iccInfo.fdn[i].number);
> }
> }
> + delete options.callback;
> + delete options.onerror;
I would like to delete these from the options object before calling `callback()` or `onerror()`. That way we have to do it only in one place and not everywhere.
Attachment #659180 -
Flags: review?(philipp) → review-
Assignee | ||
Comment 13•12 years ago
|
||
(In reply to Philipp von Weitershausen [:philikon] from comment #12)
> I would like to delete these from the options object before calling
> `callback()` or `onerror()`. That way we have to do it only in one place and
> not everywhere.
Hi, philikon:
No, callback cannot be deleted before calling, (at least in this case, getting sim contact) because it will be called in each iteration.
See parseDiallingNumber in [1].
The reason to do this is all SIM contacts are stored in EF_ADN,
and in EF_ADN it contains 254(or 508) records (Each record is a phonebook entry)
So we need to call iccIO with options.p1 increased to get each record so the callback will be invoked in each iteration.
[1]: http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_worker.js#1265
Assignee | ||
Comment 14•12 years ago
|
||
Hi, philikon:
Do you have any option?
I think you're asking me to delete callback in _processICCIORead{Record|Binary}, right[1]? But I think it cannot work because we need to call the callback iteratively.
Or if you're talking about different thing please let me know.
Thanks
[1]: http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_worker.js#2441
Updated•12 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Comment 15•12 years ago
|
||
This is a pretty big dogfood blocker, would love to see this closed up asap.
Comment 16•12 years ago
|
||
Comment on attachment 659180 [details] [diff] [review]
Part 3: Get SIM Contacts.
Review of attachment 659180 [details] [diff] [review]:
-----------------------------------------------------------------
Begrudgingly, r=me
Sorry for the delay, Yoshi, and thanks for your explanation. Makes total sense!
Attachment #659180 -
Flags: review- → review+
Assignee | ||
Comment 17•12 years ago
|
||
Address to philikon's comments
1. update uuid of nsIRILContactCallback
2. update comments in IDL, to make them in the same line
Attachment #659111 -
Attachment is obsolete: true
Assignee | ||
Comment 18•12 years ago
|
||
just update comments in the patch description.
Attachment #659180 -
Attachment is obsolete: true
Assignee | ||
Comment 19•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a39bb13adde
https://hg.mozilla.org/integration/mozilla-inbound/rev/cd30e265c0ac
https://hg.mozilla.org/integration/mozilla-inbound/rev/8593043a22c5
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla18
Comment 20•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6a39bb13adde
https://hg.mozilla.org/mozilla-central/rev/cd30e265c0ac
https://hg.mozilla.org/mozilla-central/rev/8593043a22c5
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•