The PowerManagerService directly takes care of turning the screen on/off based on full wake locks that are held. For example:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/PowerManagerService.java;h=a6daaefe710296b3c50a5a0fe6fcba302454f75d;hb=HEAD#l1607 It also tells the kernel about wakelocks being held by user space, so the kernel knows when it can't put the CPU to sleep due to wakelocks. This happens for example here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/PowerManagerService.java;h=a6daaefe710296b3c50a5a0fe6fcba302454f75d;hb=HEAD#l882 On Tue, Jun 21, 2011 at 12:18 PM, freakingtux <kees.jongenbur...@gmail.com>wrote: > Hi, > > > On Monday, June 20, 2011 6:35:24 PM UTC+2, Diego wrote: >> >> Hello, >> >> I'm porting Android on a platform that doesn't support suspend-to-ram >> (echo >> mem >/sys/power/state) but just standby (echo standby >/sys/power/state). >> I >> ended up hacking my kernel so that every call to suspend-to-ram becomes a >> standby request, but I'm wondering how the thing is managed on the Android >> >> side. I tried looking in: >> frameworks/base/services/java/**com/android/server/** >> PowerManagerService.java >> hardware/libhardware_legacy/**power/power.c >> and several other places, but didn't found a clear point where >> suspend-to-RAM >> is specified instead of standby (I'm using donut). >> > Have a look at > http://www.kandroid.org/online-pdk/guide/power_management.html > > The kernel will enter suspend as soon as there are no wakelocks present of > type SUSPEND. The PowerManagerService > holds such a lock(s) so releasing the lock will cause suspend to happen by > itself. I think this is why you will not find "echo mem > /sys/power/state" > > I had a quick look at the PowerManagerService but did not find where this > might happen > > Greetings > > -- > unsubscribe: android-porting+unsubscr...@googlegroups.com > website: http://groups.google.com/group/android-porting > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting