Closed
Bug 1139736
Opened 9 years ago
Closed 9 years ago
Map settings "network.debugging.enabled" to preference
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(firefox39 fixed)
RESOLVED
FIXED
2.2 S8 (20mar)
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: jessica, Assigned: jessica)
References
Details
Attachments
(2 files, 3 obsolete files)
983 bytes,
patch
|
jessica
:
review+
|
Details | Diff | Splinter Review |
28.11 KB,
patch
|
jessica
:
review+
|
Details | Diff | Splinter Review |
Using settings, we can have a checkbox to enable/disable network logs in the FxOS Settings page.
Assignee | ||
Comment 1•9 years ago
|
||
So here is what I observed: 'network.debugging.enabled' is mapped correctly to preference instantly, but because NetworkManager checks this preference only on top of the file, we need to restart b2g to take effect. However, I noticed that, on the first restart, reading the preference on the top of the file does not give the correct result. If I 'observe' the preference, I can get the correct result after a couple of seconds. But on the second restart, reading the preference on the top of the file gives the correct result. That means, we need to restart b2g twice for the logging to take effect. What I can do is force flushing the preference to file when a 'network.debugging.enabled' change is observed by calling 'Services.prefs.savePrefFile(null)', not sure if it's the right thing to do though.
Assignee | ||
Comment 2•9 years ago
|
||
To make it more flexible, I'll just observe 'network.debugging.enabled' changes and define the 'debug' function dynamically in NetworkManager, NetworkService and TetheringService.
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8576582 -
Attachment is obsolete: true
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8577141 [details] [diff] [review] Part 1: map setting 'network.debugging.enable' to pref. Fabrice, may I have your review on this? Thanks.
Attachment #8577141 -
Flags: review?(fabrice)
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8577142 [details] [diff] [review] Part 2: define debug function dynamically. Edgar, may I have your review on this? Thanks.
Attachment #8577142 -
Flags: review?(echen)
Comment 7•9 years ago
|
||
Comment on attachment 8577142 [details] [diff] [review] Part 2: define debug function dynamically. Review of attachment 8577142 [details] [diff] [review]: ----------------------------------------------------------------- r=me with comments addressed. Thank you. ::: dom/system/gonk/NetworkManager.js @@ -57,5 @@ > > -// Read debug setting from pref. > -try { > - let debugPref = Services.prefs.getBoolPref("network.debugging.enabled"); > - DEBUG = DEBUG || debugPref; IMO, we should still keep |DEBUG| being synced with preference value to prevent confusion. Or remove the |DEBUG| lives in global scope. @@ +62,5 @@ > + let debugPref; > + try { > + debugPref = Services.prefs.getBoolPref(PREF_NETWORK_DEBUG_ENABLED); > + } catch (e) { > + debugPref = false; Nit: Assign a default value to |debugPref|. let debugPref = false; try { debugPref = Services.prefs.getBoolPref(PREF_NETWORK_DEBUG_ENABLED); } catch (e) {} @@ +66,5 @@ > + debugPref = false; > + } > + > + if (DEBUG || debugPref) { > + debug = function (s) { Nit: No space between `function` and `(`. Here and elsewhere. ::: dom/system/gonk/NetworkService.js @@ -39,5 @@ > > -// Read debug setting from pref. > -try { > - let debugPref = Services.prefs.getBoolPref("network.debugging.enabled"); > - DEBUG = DEBUG || debugPref; Ditto @@ +47,5 @@ > + let debugPref; > + try { > + debugPref = Services.prefs.getBoolPref(PREF_NETWORK_DEBUG_ENABLED); > + } catch (e) { > + debugPref = false; Ditto ::: dom/system/gonk/TetheringService.js @@ -106,5 @@ > let DEBUG = false; > -// Read debug setting from pref. > -try { > - let debugPref = Services.prefs.getBoolPref("network.debugging.enabled"); > - DEBUG = DEBUG || debugPref; Ditto @@ +113,5 @@ > + let debugPref; > + try { > + debugPref = Services.prefs.getBoolPref(PREF_NETWORK_DEBUG_ENABLED); > + } catch (e) { > + debugPref = false; Ditto
Attachment #8577142 -
Flags: review?(echen) → review+
Updated•9 years ago
|
Attachment #8577141 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 8•9 years ago
|
||
Add r=fabrice. Thanks Fabrice!
Attachment #8577141 -
Attachment is obsolete: true
Attachment #8578450 -
Flags: review+
Assignee | ||
Comment 9•9 years ago
|
||
Add r=echen and address review comment 7. Thanks Edgar!
Assignee: nobody → jjong
Attachment #8577142 -
Attachment is obsolete: true
Attachment #8578451 -
Flags: review+
Assignee | ||
Comment 10•9 years ago
|
||
try looks good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=08b07f035035 mochitest-9 is a known failure.
Assignee | ||
Comment 11•9 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/846fa7616502 https://hg.mozilla.org/integration/b2g-inbound/rev/883bea484ad4
https://hg.mozilla.org/mozilla-central/rev/846fa7616502 https://hg.mozilla.org/mozilla-central/rev/883bea484ad4
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S8 (20mar)
You need to log in
before you can comment on or make changes to this bug.
Description
•