The default bug view has changed. See this FAQ.

B2G RIL: control radio power via Settings API

RESOLVED FIXED in mozilla15

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: philikon, Assigned: jaoo)

Tracking

unspecified
mozilla15
ARM
Gonk (Firefox OS)
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Need to be able to turn the radio on and off via the Settings API.
(Assignee)

Updated

5 years ago
Assignee: nobody → josea.olivera
(Reporter)

Updated

5 years ago
Summary: B2G RIL: control adio power via Settings API → B2G RIL: control radio power via Settings API
(Assignee)

Comment 1

5 years ago
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.
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+
(Assignee)

Comment 3

5 years ago
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.
(Assignee)

Comment 4

5 years ago
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.
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+
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0bb98a2b524
Please set the target milestone when landing on inbound :-)

https://hg.mozilla.org/mozilla-central/rev/a0bb98a2b524
Status: NEW → RESOLVED
Last Resolved: 5 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!
(Reporter)

Updated

5 years ago
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.