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 27, 2009 at 6:56 PM, Sansiro <wangjiangfeng0...@gmail.com>wrote: > > 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 - > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---