Closed Bug 879695 Opened 11 years ago Closed 11 years ago

B2G RIL: Notify modem that the screen is off

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: gerard-majax, Assigned: gerard-majax)

References

Details

(Whiteboard: [fixed-in-birch])

Attachments

(1 file, 1 obsolete file)

On Android devices, one can notice (adb logcat -b radio) that when you power off the screen, the event gets propagated to the modem so that it can enter in low power mode. One side effect of this is that Android apps can't get radio signal updates when the screen is off. When checking this behavior on B2G, it's not the case. The RIL Worker has some setScreenState() method to notify the modem, defined in https://mxr.mozilla.org/mozilla-b2g18/source/dom/system/gonk/ril_worker.js#2460 but looking at the source shows it is never called. I'd suspect we should notify our RIL code from https://mxr.mozilla.org/mozilla-b2g18/source/dom/power/PowerManager.cpp#147 that we are entering or leaving a screen state change, and thus notify the modem via setScreenState() from the RIL Worker.
Siddarth has raised this issue in Bug 843382, but seems not active for 2 months.
Oops, so let's go there for further discuss.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Bug 843382 is a confidential bug for some reason it shouldn't be. Sorry for the message spam, but I'm going to reverse the case here.
Status: RESOLVED → REOPENED
Component: General → DOM: Device Interfaces
Product: Boot2Gecko → Core
Resolution: DUPLICATE → ---
Summary: Notify modem that the screen is off → B2G RIL: Notify modem that the screen is off
Attached patch Patch v1 (obsolete) (deleted) — Splinter Review
This patch, on b2g18, with Nexus S: I/power (11850): *** set_screen_state 0 I/Gecko (11850): -*- RadioInterfaceLayer: Received a screen-state-changed event: "off" I/Gecko (11850): -*- RadioInterfaceLayer: setScreenState: "off" I/Gecko (11850): RIL Worker: Received DOM message {"rilMessageType":"setScreenState","on":false} I/Gecko (11850): RIL Worker: Will set RIL_REQUEST_SCREEN_STATE: {"rilMessageType":"setScreenState","on":false} I/power (11850): *** set_screen_state 1 I/Gecko (11850): -*- RadioInterfaceLayer: Received a screen-state-changed event: "on" I/Gecko (11850): -*- RadioInterfaceLayer: setScreenState: "on" I/Gecko (11850): RIL Worker: Received DOM message {"rilMessageType":"setScreenState","on":true} I/Gecko (11850): RIL Worker: Will set RIL_REQUEST_SCREEN_STATE: {"rilMessageType":"setScreenState","on":true} I/power (11850): *** set_screen_state 0 I/Gecko (11850): -*- RadioInterfaceLayer: Received a screen-state-changed event: "off" I/Gecko (11850): -*- RadioInterfaceLayer: setScreenState: "off" I/Gecko (11850): RIL Worker: Received DOM message {"rilMessageType":"setScreenState","on":false} I/Gecko (11850): RIL Worker: Will set RIL_REQUEST_SCREEN_STATE: {"rilMessageType":"setScreenState","on":false}
Attachment #758492 - Flags: feedback?(vyang)
Attachment #758492 - Flags: feedback?(kchen)
Attachment #758492 - Flags: feedback?(kchen) → feedback+
Comment on attachment 758492 [details] [diff] [review] Patch v1 Review of attachment 758492 [details] [diff] [review]: ----------------------------------------------------------------- Thank you for this quick patch :) ::: dom/system/gonk/RadioInterfaceLayer.js @@ +2044,5 @@ > > + setScreenState: function setScreenState(state) { > + debug("setScreenState: " + JSON.stringify(state)); > + this.worker.postMessage({rilMessageType: "setScreenState", > + on: (state === "on")}); nit: please have: this.worker.postMessage({ rilMessageType: "setScreenState", on: (state === "on") });
Attachment #758492 - Flags: feedback?(vyang) → review+
Attached patch Patch v2 (deleted) — Splinter Review
Thanks for your comments, here is a new patch that addresses the remarks.
Attachment #758492 - Attachment is obsolete: true
Attachment #758678 - Flags: review?(vyang)
Attachment #758678 - Flags: review?(kchen)
Attachment #758678 - Flags: review?(vyang) → review+
Comment on attachment 758678 [details] [diff] [review] Patch v2 Review of attachment 758678 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #758678 - Flags: review?(kchen) → review+
Assignee: nobody → lissyx+mozillians
Whiteboard: [fixed-in-birch]
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: