Closed Bug 911006 Opened 12 years ago Closed 12 years ago

B2G RIL: Improve the flow of requestNetworkInfo in ril_worker.js

Categories

(Core :: DOM: Device Interfaces, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: sku, Assigned: sku)

Details

Attachments

(1 file, 1 obsolete file)

According to current ril_worker.js design, RIL will set _processingNetworkInfo to true and request query for voice/data/operator/signal in requestNetworkInfo. This seems work properly in most cases. However, modem/ril daemond may report serials of UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED event (in a row) before first five requests back. That means we may lost precision of network information by this design. Therefore, we would like to to modify the flow to only keep the latest request, and, ignore stale requests from last requests. // Snippet: requestNetworkInfo: function requestNetworkInfo() { if (this._processingNetworkInfo) { if (DEBUG) debug("Network info requested, but we're already requesting network info."); return; } if (DEBUG) debug("Requesting network info"); this._processingNetworkInfo = true; this.getVoiceRegistrationState(); this.getDataRegistrationState(); //TODO only GSM this.getOperator(); this.getNetworkSelectionMode(); this.getSignalStrength(); },
Assignee: nobody → sku
Take a log as an example, device might get UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED multiple times before all requests in requestNetworkInfo() back. // Ex: requestNetworkInfo() will be only triggered once for #1, and ignore #2/#3. #1 09-02 10:01:34.999 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED #2 09-02 10:01:35.009 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED #3 09-02 10:01:35.009 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED #4 09-02 10:01:35.039 111 240 I Gecko : RIL Worker[0]: _sendPendingNetworkInfo 09-02 10:01:35.179 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:35.389 111 240 I Gecko : RIL Worker[0]: _sendPendingNetworkInfo 09-02 10:01:36.179 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:36.179 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:36.189 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:36.199 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:36.249 111 240 I Gecko : RIL Worker[0]: _sendPendingNetworkInfo 09-02 10:01:38.029 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:38.069 111 240 I Gecko : RIL Worker[0]: _sendPendingNetworkInfo 09-02 10:01:38.809 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:38.869 111 240 I Gecko : RIL Worker[0]: UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED 09-02 10:01:38.869 111 240 I Gecko : RIL Worker[0]: _sendPendingNetworkInfo
Attachment #798416 - Flags: review?(htsai)
Attachment #798416 - Flags: feedback?(echen)
Comment on attachment 798416 [details] [diff] [review] Bug 911006 - B2G RIL: Improve the flow of requestNetworkInfo in ril_worker.js Thanks Shawn, this patch indeed fix the issue you found. Do you think it is possible to add some test cases for this (Maybe Marionette or xpcshell)?
Attachment #798416 - Flags: feedback?(echen) → feedback+
Comment on attachment 798416 [details] [diff] [review] Bug 911006 - B2G RIL: Improve the flow of requestNetworkInfo in ril_worker.js Review of attachment 798416 [details] [diff] [review]: ----------------------------------------------------------------- Thank you. ::: dom/system/gonk/ril_worker.js @@ +264,5 @@ > /** > + * Multiple requestNetworkInfo() in a row before finishing the first > + * request, hence we need to fire requestNetworkInfo() again after > + * gathering all necessary stuffs. This is to make sure that ril_worker > + * get precise network information. nit: s/get/gets @@ +265,5 @@ > + * Multiple requestNetworkInfo() in a row before finishing the first > + * request, hence we need to fire requestNetworkInfo() again after > + * gathering all necessary stuffs. This is to make sure that ril_worker > + * get precise network information. > + **/ nit: should use */
Attachment #798416 - Flags: review?(htsai) → review+
Keywords: checkin-needed
Attachment #798416 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: