Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-28 Thread 陳侃如
Marco Chen mc...@mozilla.com writes: Hi Kan-Ru, 1. Changing PowerManager.screenEnabled is THE ONLY WAY to trigger the suspend. This is not true. The android kernel could call suspend at anytime when the wake lock count in kernel hits zero. When design power management API we must

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-27 Thread Marco Chen
Hi Kan-Ru, Thanks for your reply first. Changing PowerManager.screenEnabled is just one way to trigger the suspend. As I knew, 1. Changing PowerManager.screenEnabled is THE ONLY WAY to trigger the suspend. and remove the cpuSleepAllowed attribute from PowerManager 1. Currently

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-27 Thread 陳侃如
[ +dev-webapi You could find the original thread here: https://groups.google.com/forum/#!msg/mozilla.dev.b2g/UP5h_a3QAHE/i3S3aCwNPTUJ ] Marco Chen mc...@mozilla.com writes: Hi Kan-Ru, Thanks for your reply first. Changing PowerManager.screenEnabled is just one way to trigger the suspend.

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-27 Thread Marco Chen
Hi Kan-Ru, 1. Changing PowerManager.screenEnabled is THE ONLY WAY to trigger the suspend. This is not true. The android kernel could call suspend at anytime when the wake lock count in kernel hits zero. When design power management API we must remember that the user space has to cooperate

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-26 Thread 陳侃如
Marco Chen mc...@mozilla.com writes: Hi Thomas, There is already PowerManager.cpuSleepAllowed for keeping the CPU running. Yes, you are right. But does PowerManager.screenEnabled API told developers that you should request a wakelock first or system will go into sleep not just turn off the

[b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-12 Thread Marco Chen
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

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-12 Thread Thomas Zimmermann
Hi Marco On 12.11.2013 12:49, 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

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-12 Thread Ehsan Akhgari
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

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-12 Thread Marco Chen
Hi Ehsan, Actually GonkDisplayJB.cpp did the same thing as GonkDisplayICS.cpp and additionally request screen to off. http://dxr.mozilla.org/mozilla-central/source/widget/gonk/libdisplay/GonkDisplayJB.cpp#169 The link as above is the way GonkDisplayJB asked system to suspend. So both of JB and

Re: [b2g] [WebAPI] The Naming of PowerManager.screenEnabled Misleads the Gaia Developers

2013-11-12 Thread Marco Chen
Hi Thomas, There is already PowerManager.cpuSleepAllowed for keeping the CPU running. Yes, you are right. But does PowerManager.screenEnabled API told developers that you should request a wakelock first or system will go into sleep not just turn off the screen? It didn't make sense for this