Closed Bug 744709 Opened 12 years ago Closed 12 years ago

B2G RIL: control radio power via Settings API

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: philikon, Assigned: jaoo)

References

Details

Attachments

(1 file, 1 obsolete file)

Need to be able to turn the radio on and off via the Settings API.
Assignee: nobody → josea.olivera
Summary: B2G RIL: control adio power via Settings API → B2G RIL: control radio power via Settings API
Attached patch WIP v1 (obsolete) — Splinter Review
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.
Attachment #622162 - Flags: feedback?(philipp)
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.
Attachment #622162 - Flags: feedback?(philipp) → feedback+
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.
Attached patch WIP v2Splinter Review
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.
Attachment #622162 - Attachment is obsolete: true
Attachment #625612 - Flags: review?(philipp)
(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 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?
Attachment #625612 - Flags: review?(philipp) → review+
Please set the target milestone when landing on inbound :-)

https://hg.mozilla.org/mozilla-central/rev/a0bb98a2b524
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
José, please make sure to add the necessary UI bits and default setting (radio enabled) to Gaia asap!
Depends on: 758466
(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.
(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.
(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
You need to log in before you can comment on or make changes to this bug.