Closed
Bug 1003650
Opened 10 years ago
Closed 10 years ago
DEBUG flag in ril_worker is not dynamic changeable by pref "ril.debugging.enabled"
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S2 (23may)
People
(Reporter: aknow, Assigned: aknow)
References
Details
(Whiteboard: [p=2])
Attachments
(1 file, 2 obsolete files)
6.56 KB,
patch
|
aknow
:
review+
|
Details | Diff | Splinter Review |
In ril_worker, DEBUG flag could only be set during initialization [1]. Thus, after that, the value is fixed and could not be altered by pref value unless you also restart the b2g. In TelephonyProvider.js, we observe the pref value changed and update the debug flag immediately [2]. IMO, it's a better way for debugging. So I would like to mimic the same mechanism in ril_worker. [1] https://github.com/mozilla/gecko-dev/blob/ae6c78e6e8134aa74bdf7b697137bba8ee2116e9/dom/system/gonk/ril_worker.js#L14703 [2] https://github.com/mozilla/gecko-dev/blob/ae6c78e6e8134aa74bdf7b697137bba8ee2116e9/dom/telephony/gonk/TelephonyProvider.js#L907
Assignee | ||
Comment 1•10 years ago
|
||
We should also apply the change on RadioInterfaceLayer.js.
Assignee: nobody → szchen
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8425219 -
Flags: review?(htsai)
Comment 3•10 years ago
|
||
Comment on attachment 8425219 [details] [diff] [review] Dynamically update debug flag Review of attachment 8425219 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/RadioInterfaceLayer.js @@ +1535,5 @@ > }, > }; > > function RadioInterfaceLayer() { > + this.workerMessenger = new WorkerMessenger(); I don't think we'd like to let RadioInterfaceLayer hold a reference to workerMessenger because RadioInterfaceLayer isn't communicating with worker per the whole structure. I'd suggest letting WokerMessenger itself take care of observing preference change. @@ +1548,4 @@ > } > > Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); > + Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false); Oh... I just noticed that our current code doesn't pref.removeObserver properly... I'll file another follow-up to fix that. But please removeObserver properly when shutdown in the patch.
Attachment #8425219 -
Flags: review?(htsai)
Comment 4•10 years ago
|
||
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #3) > Comment on attachment 8425219 [details] [diff] [review] > Dynamically update debug flag > > Review of attachment 8425219 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/system/gonk/RadioInterfaceLayer.js > @@ +1535,5 @@ > > }, > > }; > > > > function RadioInterfaceLayer() { > > + this.workerMessenger = new WorkerMessenger(); > > I don't think we'd like to let RadioInterfaceLayer hold a reference to > workerMessenger because RadioInterfaceLayer isn't communicating with worker > per the whole structure. I'd suggest letting WokerMessenger itself take care > of observing preference change. > > @@ +1548,4 @@ > > } > > > > Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); > > + Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false); > > Oh... I just noticed that our current code doesn't pref.removeObserver > properly... I'll file another follow-up to fix that. > > But please removeObserver properly when shutdown in the patch. Sorry, please ignore this. See https://bugzilla.mozilla.org/show_bug.cgi?id=926302#c21 for explanation.
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #8425219 -
Attachment is obsolete: true
Attachment #8425367 -
Flags: review?(htsai)
Comment 6•10 years ago
|
||
Comment on attachment 8425367 [details] [diff] [review] #2 Dynamically update debug flag Review of attachment 8425367 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, thank you!
Attachment #8425367 -
Flags: review?(htsai) → review+
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8425367 -
Attachment is obsolete: true
Attachment #8426078 -
Flags: review+
Assignee | ||
Comment 8•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=5346b5f559e1
Comment 9•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/b7757cf53850
Keywords: checkin-needed
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b7757cf53850
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
•