>> when the PowerManagerService(
>>PowerManagerSerivce.java) write "on" to /sys/power/state (using
SetScreenState(true) ),

Note that in android (for that matter, universally in java) java
applications cant access system resources (sys/power/state file in this
case) directly, as they have to bypass VM (dalvik in android).

so, usually its java-app -> JNI -> native library -> kernel component
so, the sysfs entry sys/poewr/state will be updated in kernel component
finally. the call sequence will be like
com.android.PowerManagerSerivce  => android.app.ActivityManagerNative => JNI
=> ... => kernel power -> writing /sys/power/state

btw, "ON" is not supported in /sys/power/state, and supported state are
'standby'     (Power-On Suspend)
'mem'         (Suspend-to-RAM)
'disk'         (Suspend-to-Disk).


System enters either of the above state, when user says so, and system will
resume on a scheduled event or user input..




On Tue, Apr 6, 2010 at 1:12 PM, ZhangJieJing <kzj...@gmail.com> wrote:

> Hi All:
>
> At android power manage service, it have early suspend and late resume
> mechanism to control devices such as LCD backlight, touchscreen, when wake
> lock free/expired or user request suspend, the kernel will call early
> suspend workqueue, and execute the registered early suspend handler. when
> the user(PowerManageService) request "on" (echo "on" > /sys/power/state) ,
> the late resume handlers will be called.
>
> My question is,
> 1, when the PowerManagerService(PowerManagerSerivce.java) write "on" to
> /sys/power/state (using SetScreenState(true) ),
> 2, and how the services know the resume of system to write /sys/power/state
> ?
>
> Thanks in advance,
>
> ---
> Best regards,
> Zhang Jiejing
>
> --
> unsubscribe: 
> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com>
> website: http://groups.google.com/group/android-porting
>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

To unsubscribe, reply using "remove me" as the subject.

Reply via email to