Is this on ICS or JB? Reading this code, I think the JB code path ends up here <http://dxr.mozilla.org/mozilla-central/source/widget/gonk/libdisplay/GonkDisplayJB.cpp#153> which seems like it's turning the screen on and off. However, the ICS version of this function <http://dxr.mozilla.org/mozilla-central/source/widget/gonk/libdisplay/GonkDisplayICS.cpp#137> calls set_screen_state. Assuming that this code is the implementation of that function <https://android.googlesource.com/platform/hardware/libhardware_legacy/+/ics-mr0/power/power.c> then it's writing "mem" to /sys/power/state if you pass false to it, which suspends the device. That seems like a bug to me.

Cheers,
Ehsan

On 2013-11-12 6:49 AM, Marco Chen wrote:
Hi all,

[1] shows the properties of power manager (WebAPI) and 
PowerManager.screenEnabled didn't have a suitable name and explanation.

This property didn't only control enable/disable of the device screen but also the device's power 
state ("on" or "mem").
When gaia developer called this API for turning off the screen but he didn't 
know the system is going to suspend mode too.
This will cause entire system go into frozen state so the following work that 
developer expected will not be performed until device is woken up by any wakup 
source.

So I suggest to rename this property and split it to two for power state and 
screen state if necessary.
ex: PowerManager.requestToSleep (just an example and welcome to new word)

May I know your suggestion?

[1] https://developer.mozilla.org/en-US/docs/Web/API/PowerManager

Sincerely yours.

-------------------------------------
Marco Chen
Engineering Manager
System Team, Device Engineering
Mozilla Taiwan

Tel: +886-2-87861100 # 352
mail: [email protected]

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g


_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to