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?
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?)
time is used to order this correctly with the wake lock calls. The time should be in the SystemClock.uptimeMillis() time base.