Closed Bug 753170 Opened 14 years ago Closed 14 years ago

B2G 3G: Expose state information through WebMobileConnection

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16
blocking-kilimanjaro +
blocking-basecamp +

People

(Reporter: jaoo, Assigned: jaoo)

References

Details

Attachments

(1 file, 2 obsolete files)

Need to keep track of some of the state information in data calls and then notify the content when state changes (connected/disconnected, technology changes, etc.). I guess this should be done by using the WebMobileConnection API.
Blocks: b2g-3g
Assignee: nobody → josea.olivera
Attached patch wip (obsolete) — — Splinter Review
Here's a WIP I made for kaze. It is *not* complete. For instance, n.m.data.connected is not really correct, it should only be true if the data call is actually active (and possibly also the active NetworkInterface with theNetworkManager).
Attached patch WIP v2 (obsolete) — — Splinter Review
New WIP patch with Philipp's permission. Notifies the data call is connected only when the connection is active. Need to figure out how to notify it only when the data call is the active NetworkInterface in the NetworkManager.
Attachment #623051 - Attachment is obsolete: true
Attachment #624358 - Flags: feedback?(philipp)
Attachment #624358 - Flags: feedback?(philipp) → feedback+
blocking-basecamp: --- → +
blocking-kilimanjaro: --- → +
Summary: B2G 3G: Keep track of some of the state information. → B2G 3G: Expose state information through WebMobileConnection
Hi, I filed a Gaia issue to track this (if I am looking at the right bug) https://github.com/mozilla-b2g/gaia/issues/1851 The 3G label should automatically appear on Status Bar once the patch landed on Gecko, no Gaia fix needed.
jaoo, it's been over a month since the last revision. Are you still working on this? If not, that's ok, but we need to know so we can get somebody else.
I have had this bug a little abandoned, I'm sorry. Current patch solves the problem but It would be great to complete it to notify it only when the data call is the active NetworkInterface in the NetworkManager. In that situation we should manage to show only the '3G icon' and to hide the 'WiFi icon' and viceversa when the data call is down and the WiFi is up. This is the common behaviour on any phone nowdays. What about If I rebase the patch, test it and file a new bug for implementing what I am telling?
Attached patch WIP v3 — — Splinter Review
New WIP, just rebased. Latest changes in RadioInterfaceLayer do not allow us to notify the content from RILNetworkInterface (because readonly attributes in interfaces I cannot change 'rilContext.data.connected' to true) so I have moved that notification to the 'handleDataCallState' function.
Attachment #624358 - Attachment is obsolete: true
Attachment #635344 - Flags: feedback?(philipp)
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #7) > Created attachment 635344 [details] [diff] [review] > WIP v3 > I have tested it on otoro (adding the patch from bug 763160) and there is still a problem with data calls. There is something wrong in the ril_worker when I try to deactivate the data call. I/Gecko ( 115): RIL Worker: Handling parcel as REQUEST_DEACTIVATE_DATA_CALL I/Gecko ( 115): RIL Worker: Parcel handling threw TypeError: datacall is undefined I/Gecko ( 115): REQUEST_DEACTIVATE_DATA_CALL@resource://gre/modules/ril_worker.js:3179 I/Gecko ( 115): handleParcel@resource://gre/modules/ril_worker.js:2682 I/Gecko ( 115): processParcel@resource://gre/modules/ril_worker.js:508 I/Gecko ( 115): processIncoming@resource://gre/modules/ril_worker.js:460 I/Gecko ( 115): onRILMessage@resource://gre/modules/ril_worker.js:4734
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #6) > I have had this bug a little abandoned, I'm sorry. Current patch solves the > problem but It would be great to complete it to notify it only when the data > call is the active NetworkInterface in the NetworkManager. In that situation > we should manage to show only the '3G icon' and to hide the 'WiFi icon' and > viceversa when the data call is down and the WiFi is up. This is the common > behaviour on any phone nowdays. It seems to be already implemented in gaia. Great. >What about If I rebase the patch, test it > and file a new bug for implementing what I am telling?
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #8) > (In reply to José Antonio Olivera Ortega [:jaoo] from comment #7) > > Created attachment 635344 [details] [diff] [review] > > WIP v3 > > > I have tested it on otoro (adding the patch from bug 763160) and there is > still a problem with data calls. There is something wrong in the ril_worker > when I try to deactivate the data call. > > I/Gecko ( 115): RIL Worker: Handling parcel as > REQUEST_DEACTIVATE_DATA_CALL > I/Gecko ( 115): RIL Worker: Parcel handling threw TypeError: datacall is > undefined > I/Gecko ( 115): > REQUEST_DEACTIVATE_DATA_CALL@resource://gre/modules/ril_worker.js:3179 > I/Gecko ( 115): handleParcel@resource://gre/modules/ril_worker.js:2682 > I/Gecko ( 115): processParcel@resource://gre/modules/ril_worker.js:508 > I/Gecko ( 115): processIncoming@resource://gre/modules/ril_worker.js:460 > I/Gecko ( 115): onRILMessage@resource://gre/modules/ril_worker.js:4734 Quick fix for that: - let token = Buf.newParcel(REQUEST_DEACTIVATE_DATA_CALL); + let token = Buf.newParcel(REQUEST_DEACTIVATE_DATA_CALL, options); This makes the error to disappear but the data connection is shown here (but flagged as DOWN): [eniac mozilla-b2g-B2G (master)]$ adb shell netcfg && adb shell cat /proc/net/route lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00 rmnet0 DOWN 10.80.91.145/30 0x00000000 00:00:00:00:00:00
Comment on attachment 635344 [details] [diff] [review] WIP v3 Review of attachment 635344 [details] [diff] [review]: ----------------------------------------------------------------- lgtm! This needs tests, at least for the very basic things (because we can't test data calls in the emulator, I think). But those things are already grandfathered in, so could you file a follow-up for that please?
Attachment #635344 - Flags: feedback?(philipp) → review+
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #6) > I have had this bug a little abandoned, I'm sorry. Current patch solves the > problem but It would be great to complete it to notify it only when the data > call is the active NetworkInterface in the NetworkManager. In that situation > we should manage to show only the '3G icon' and to hide the 'WiFi icon' and > viceversa when the data call is down and the WiFi is up. This is the common > behaviour on any phone nowdays. What about If I rebase the patch, test it > and file a new bug for implementing what I am telling? Oh, I forgot to respond to that. So, when Wifi comes up, should we not perhaps simply end the data call? In any case, I agree about tackling this question in a follow-up. Please file. Thanks!
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #9) > (In reply to José Antonio Olivera Ortega [:jaoo] from comment #6) > > I have had this bug a little abandoned, I'm sorry. Current patch solves the > > problem but It would be great to complete it to notify it only when the data > > call is the active NetworkInterface in the NetworkManager. In that situation > > we should manage to show only the '3G icon' and to hide the 'WiFi icon' and > > viceversa when the data call is down and the WiFi is up. This is the common > > behaviour on any phone nowdays. > > It seems to be already implemented in gaia. Great. > You're welcome. (In reply to Philipp von Weitershausen [:philikon] from comment #12) > https://hg.mozilla.org/integration/mozilla-inbound/rev/74c23f01b3c3 \O/ (In reply to Philipp von Weitershausen [:philikon] from comment #13) > So, when Wifi comes up, should we not perhaps simply end the data call? In > any case, I agree about tackling this question in a follow-up. Please file. > Thanks! Agree, need to be done in a follow up.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: