One additional note regarding the usage of the goToSleep method.
In my opinion it is very dangerous to offer this API to normal
application. If applications could easily use this API they could put
your device to sleep whenever they want. Especially when you download
a 3rd party application the
It might be that having root permissions might be not sufficient to
use goToSleep() correctly.
I found in one of the threads that you also want to make sure that
your app is singed as system app.
I'm puzzled in this problem for days.
I have tried to learn the source code to find out how goToSleep()
method work.
It ended in the file /framework/base/server/
PowerManagerService.java.What it does in goToSleep() method is to
clear all the wake lock in current service.After all the wake lock
Are you looking in the log for error messages? Note that applications
shouldn't be able to generate key events except when they will be handled by
the app itself, and I don't believe applications can get permission to force
the device to go to sleep (though I am not sure about that).
On Mon, Jul
If you are launching from an application, it counts as that application.
On Mon, Jul 27, 2009 at 8:33 PM, Sansiro wangjiangfeng0...@gmail.comwrote:
Dear Hackborn:
The Log show nothing.
The program I wrote is not an application with activity, more like a
system process.
I put my code to the