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
being cleared, device will go to sleep automatically.
But how to clear all the wake lock? Google provide this with C, but
it's too difficult for me to read them.

Even I got a funny idea.As pressing RedKey can make emulator go to
sleep, I tried to send virtual key "ENDCALL" and "POWER" to make
emulator sleep. But I got another failure. %>_<%!!!

On Jul 28, 1:20 am, Roman <roman.baumgaert...@t-mobile.com> wrote:
> 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.
>
> http://groups.google.com/group/android-developers/browse_thread/threa...
>
> Let me know what you find out. I am curious whether you find a way to
> resolve this problem.
>
> --
> Roman Baumgaertner
> Sr. SW Engineer-OSDC
> ·T· · ·Mobile· stick together
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Jul 26, 8:47 pm, Sansiro <wangjiangfeng0...@gmail.com> wrote:
>
>
>
> > PowerManager.gotosleep() method seems to not work .
> > There is no permission problem because my program has the root
> > permission.
>
> > So any other suggestion?- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to