Last Comment Bug 753170 - B2G 3G: Expose state information through WebMobileConnection
: B2G 3G: Expose state information through WebMobileConnection
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla16
Assigned To: José Antonio Olivera Ortega [:jaoo]
:
Mentors:
: 762959 (view as bug list)
Depends on:
Blocks: b2g-3g 713849
  Show dependency treegraph
 
Reported: 2012-05-08 16:09 PDT by José Antonio Olivera Ortega [:jaoo]
Modified: 2012-06-22 03:44 PDT (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
+


Attachments
wip (2.97 KB, patch)
2012-05-10 23:08 PDT, Philipp von Weitershausen [:philikon]
no flags Details | Diff | Splinter Review
WIP v2 (4.23 KB, patch)
2012-05-16 05:54 PDT, José Antonio Olivera Ortega [:jaoo]
philipp: feedback+
Details | Diff | Splinter Review
WIP v3 (3.91 KB, patch)
2012-06-21 08:59 PDT, José Antonio Olivera Ortega [:jaoo]
philipp: review+
Details | Diff | Splinter Review

Description José Antonio Olivera Ortega [:jaoo] 2012-05-08 16:09:44 PDT
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.
Comment 1 Philipp von Weitershausen [:philikon] 2012-05-10 23:08:52 PDT
Created attachment 623051 [details] [diff] [review]
wip

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).
Comment 2 José Antonio Olivera Ortega [:jaoo] 2012-05-16 05:54:56 PDT
Created attachment 624358 [details] [diff] [review]
WIP v2

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.
Comment 3 Philipp von Weitershausen [:philikon] 2012-06-08 09:51:07 PDT
*** Bug 762959 has been marked as a duplicate of this bug. ***
Comment 4 Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-20 20:02:08 PDT
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.
Comment 5 Philipp von Weitershausen [:philikon] 2012-06-20 21:50:15 PDT
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.
Comment 6 José Antonio Olivera Ortega [:jaoo] 2012-06-20 23:36:31 PDT
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?
Comment 7 José Antonio Olivera Ortega [:jaoo] 2012-06-21 08:59:55 PDT
Created attachment 635344 [details] [diff] [review]
WIP v3

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.
Comment 8 José Antonio Olivera Ortega [:jaoo] 2012-06-21 09:08:11 PDT
(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
Comment 9 José Antonio Olivera Ortega [:jaoo] 2012-06-21 09:42:57 PDT
(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?
Comment 10 José Antonio Olivera Ortega [:jaoo] 2012-06-21 10:52:39 PDT
(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 11 Philipp von Weitershausen [:philikon] 2012-06-21 17:22:04 PDT
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?
Comment 12 Philipp von Weitershausen [:philikon] 2012-06-21 17:23:38 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/74c23f01b3c3
Comment 13 Philipp von Weitershausen [:philikon] 2012-06-21 17:26:37 PDT
(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!
Comment 14 Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-22 00:56:18 PDT
(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.
Comment 15 Tim Guan-tin Chien [:timdream] (please needinfo) 2012-06-22 00:56:38 PDT
Thanks guys!
Comment 16 Ed Morley [:emorley] 2012-06-22 03:44:13 PDT
https://hg.mozilla.org/mozilla-central/rev/74c23f01b3c3

Note You need to log in before you can comment on or make changes to this bug.