Last Comment Bug 744709 - B2G RIL: control radio power via Settings API
: B2G RIL: control radio power via Settings API
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla15
Assigned To: José Antonio Olivera Ortega [:jaoo]
:
Mentors:
Depends on: 758466
Blocks: b2g-ril
  Show dependency treegraph
 
Reported: 2012-04-12 01:32 PDT by Philipp von Weitershausen [:philikon]
Modified: 2012-05-25 08:54 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
WIP v1 (11.05 KB, patch)
2012-05-08 15:09 PDT, José Antonio Olivera Ortega [:jaoo]
philipp: feedback+
Details | Diff | Review
WIP v2 (11.63 KB, patch)
2012-05-21 05:03 PDT, José Antonio Olivera Ortega [:jaoo]
philipp: review+
Details | Diff | Review

Description Philipp von Weitershausen [:philikon] 2012-04-12 01:32:17 PDT
Need to be able to turn the radio on and off via the Settings API.
Comment 1 José Antonio Olivera Ortega [:jaoo] 2012-05-08 15:09:01 PDT
Created attachment 622162 [details] [diff] [review]
WIP v1

Need feedback about this WIP. Reads the radio state at booting time and toggles the radio on or off depending on what the 'ril.radio.enabled' setting says. Reads the 'ril.radio.enabled' setting at booting time but it uses a fake value since there is no yet a way to set that setting from the IU. Will figure out a way to set it from whereever for testing and going ahead.
Comment 2 Philipp von Weitershausen [:philikon] 2012-05-17 16:55:57 PDT
Comment on attachment 622162 [details] [diff] [review]
WIP v1

Review of attachment 622162 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/RadioInterfaceLayer.js
@@ +733,5 @@
>    // nsIRadioInterfaceLayer
>  
> +  setRadioEnabled: function setRadioEnabled(value) {
> +    debug("Setting radio power to " + value);
> +    this.worker.postMessage({type: "setRadioPower", on: value});

You also need to fix RIL.setRadioPower in ril_worker.js to take an `options` object rather than a simple parameter. Which means you haven't really tested this patch yet. Please do this in the future. Thanks!

Rest looks good! Will need tests, though. Please file a follow-up for that.
Comment 3 José Antonio Olivera Ortega [:jaoo] 2012-05-18 04:33:11 PDT
BWT, in order to implement the 'Airplane mode' (also known as offline mode or standalone mode) what other signal transmitting functions should we set off? I mean FM Receiver, Bluetooth, WiFi and GPS.
Comment 4 José Antonio Olivera Ortega [:jaoo] 2012-05-21 05:03:16 PDT
Created attachment 625612 [details] [diff] [review]
WIP v2

New WIP v1. Tested on SGS2 ICS (UI for that lives at https://github.com/jaoo/gaia/tree/b2g-airplanemode). Next is to add test.
Comment 5 Philipp von Weitershausen [:philikon] 2012-05-23 15:53:09 PDT
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #3)
> BWT, in order to implement the 'Airplane mode' (also known as offline mode
> or standalone mode) what other signal transmitting functions should we set
> off? I mean FM Receiver, Bluetooth, WiFi and GPS.

That's OT for this bug. Certainly I would like to be able to optionally use Wifi in Airplane mode since airlines now offer Wifi on planes.
Comment 6 Philipp von Weitershausen [:philikon] 2012-05-23 16:08:43 PDT
Comment on attachment 625612 [details] [diff] [review]
WIP v2

Review of attachment 625612 [details] [diff] [review]:
-----------------------------------------------------------------

r=me

As for tests, I'm not even sure we can test the emulator radio turning on and off. http://developer.android.com/guide/developing/devices/emulator.html is very sparse on this. Can you find out, please?
Comment 7 Philipp von Weitershausen [:philikon] 2012-05-23 22:26:15 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0bb98a2b524
Comment 8 Ed Morley [:emorley] 2012-05-24 09:19:25 PDT
Please set the target milestone when landing on inbound :-)

https://hg.mozilla.org/mozilla-central/rev/a0bb98a2b524
Comment 9 Philipp von Weitershausen [:philikon] 2012-05-24 18:09:42 PDT
José, please make sure to add the necessary UI bits and default setting (radio enabled) to Gaia asap!
Comment 10 José Antonio Olivera Ortega [:jaoo] 2012-05-24 23:04:28 PDT
(In reply to Philipp von Weitershausen [:philikon] from comment #9)
> José, please make sure to add the necessary UI bits and default setting
> (radio enabled) to Gaia asap!

Just noticed all activity this patch has generated during the night (CET). I'll add the necessary UI bits and default setting to Gaia this morning (CET). Sorry for the inconvenience.
Comment 11 José Antonio Olivera Ortega [:jaoo] 2012-05-25 05:35:09 PDT
(In reply to José Antonio Olivera Ortega [:jaoo] from comment #10)
> (In reply to Philipp von Weitershausen [:philikon] from comment #9)
> > José, please make sure to add the necessary UI bits and default setting
> > (radio enabled) to Gaia asap!

https://github.com/andreasgal/gaia/pull/1489

I'll have to figure out a proper way of setting default values for any particular setting as 'ril.radio.disabled' for example. My idea is to add way to do it in m-c/b2g/chrome/content/shell.js.
Comment 12 José Antonio Olivera Ortega [:jaoo] 2012-05-25 08:54:05 PDT
(In reply to Philipp von Weitershausen [:philikon] from comment #9)
> José, please make sure to add the necessary UI bits and default setting
> (radio enabled) to Gaia asap!

Set default value for 'ril.radio.enabled' setting in Gaia. Please see https://github.com/andreasgal/gaia/pull/1490

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