Closed
Bug 1054148
Opened 10 years ago
Closed 10 years ago
Clean up MOZ_B2G_RIL in NetworkManager
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.2 S3 (9jan)
People
(Reporter: edgar, Assigned: jessica)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
edgar
:
review+
|
Details | Diff | Splinter Review |
I really don't like having a lot of MOZ_B2G_RIL in NetworkManager.
For the platform without RIL function, there will be no NetworkInterface with MOBILE type registered. It seems most of MOZ_B2G_RIL can be replaced by checking network type.
Let's try to clean up this.
Reporter | ||
Comment 1•10 years ago
|
||
Just a WIP patch, didn't verify it yet.
Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Edgar Chen [:edgar][:echen] from comment #1)
> Created attachment 8534864 [details] [diff] [review]
> WIP, patch
>
> Just a WIP patch, didn't verify it yet.
Thanks Edgar! Should I take it from here? :)
Reporter | ||
Comment 3•10 years ago
|
||
Yes, please help me to finish it if you don't mind. :)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jjong
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8534864 -
Attachment is obsolete: true
Assignee | ||
Comment 5•10 years ago
|
||
Comment on attachment 8538297 [details] [diff] [review]
patch, v1.
Edgar, may I have your review on this? Thanks.
Attachment #8538297 -
Flags: review?(echen)
Reporter | ||
Comment 6•10 years ago
|
||
Comment on attachment 8538297 [details] [diff] [review]
patch, v1.
Review of attachment 8538297 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for taking this bug, please see my comments below.
::: dom/system/gonk/NetworkManager.js
@@ +340,2 @@
> // Update data connection when Wifi connected/disconnected
> + try {
The try-catch is for the exception thrown by Cc["@mozilla.org/foo;1"].getService(Ci.nsIFoo);
Per offline discussion, let's use `defineLazyGetter` and we could handle the exception there. Something like,
XPCOMUtils.defineLazyGetter(NetworkManager.prototype, "mRil", function() {
try {
return Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
} catch (e) {}
return null;
});
@@ +340,3 @@
> // Update data connection when Wifi connected/disconnected
> + try {
> + if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
Then checking |this.mRIL| here, if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI && this.mRil) { ...
@@ +376,3 @@
> // Update data connection when Wifi connected/disconnected
> + try {
> + if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
Ditto, check |this.mRIL|.
@@ +1357,1 @@
> XPCOMUtils.defineLazyServiceGetter(NetworkManager.prototype, "mRil",
Rewrite with `defineLazyGetter`.
Attachment #8538297 -
Flags: review?(echen)
Assignee | ||
Comment 7•10 years ago
|
||
Address review comment 6.
Edgar, may I have your review again? Thanks.
Attachment #8540573 -
Flags: review?(echen)
Reporter | ||
Updated•10 years ago
|
Attachment #8538297 -
Attachment is obsolete: true
Reporter | ||
Comment 8•10 years ago
|
||
Comment on attachment 8540573 [details] [diff] [review]
patch, v2.
Review of attachment 8540573 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, thank you.
Attachment #8540573 -
Flags: review?(echen) → review+
Assignee | ||
Comment 9•10 years ago
|
||
Assignee | ||
Comment 10•10 years ago
|
||
Target Milestone: --- → 2.2 S3 (9jan)
Comment 11•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•