The function of PowerManager.goToSleep

Put your problem here if it does not fit any of the other categories.

The function of PowerManager.goToSleep

Postby ChadLu » Mon Mar 09, 2009 7:18 am

Dear all,
Recently, I have got interested in the power management on android platform. And then I found the api,"PowerManager", I tried to use the methods defined in that class. I can't know very well about what the method,"goToSleep" means. I got the related source code, and studied it. I found the method only has the system turn the screen off, I don't know why turning the screen off could make the system go to sleep.

I find another topic about this method, the link is as follow,
1.http://groups.google.com/group/android- ... 471072f0e6

In this list, we could know we can't use this method in the application regardless of using DEVICE_POWER permission. So, when could we use this method?

BTW,
The description of this method in framework reference document is here

public void goToSleep (long time)
Force the device to go to sleep. Overrides all the wake locks that are held.
(Does the device mean the whole system?)
Parameters
time is used to order this correctly with the wake lock calls. The time should be in the SystemClock.uptimeMillis() time base.
ChadLu
Freshman
Freshman
 
Posts: 2
Joined: Wed Mar 04, 2009 10:58 am

Top

Postby ChadLu » Wed Mar 11, 2009 2:34 am

any help, please
ChadLu
Freshman
Freshman
 
Posts: 2
Joined: Wed Mar 04, 2009 10:58 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 14 guests