Yes, I agree.
Anyways, Sincerely thanks for this solution. It helped a lot. 2011/8/16 Hemanth(ヘマント) <hemanth....@gmail.com> > Hi, > > I think we are straying out of bounds for this group, but anyway.. > > >I have implemented timer and timertask in PowerManagerService. > As far as I know, you don't need to change anything in the framework > to get this to work. > > You can try something like: > http://www.mensus.net/phone/toggle.shtml > > > On Aug 13, 3:12 am, Pratik Prajapati <pratik.prajap...@gmail.com> > wrote: > > Hi, > > > > Thank you for this great input. > > > > I have implemented some state machine as per my requirements. Everything > > works fine, except one. > > > > I want to put device on sleep mode as soon as my timer goes off. I have > > implemented timer and timertask in PowerManagerService. I'm calling > > gotoSleep() method or PowerManagerService from the timerTask. but this > > gotoSleep(0 doesn't get called somehow. > > > > I have put prints in gotoSleep() but no prints comes up! > > > > Any idea, what could be wrong? > > > > 2011/8/11 Hemanth(ヘマント) <hemanth....@gmail.com> > > > > > > > > > > > > > > > > > > > > > Hi, > > > > > The settings app updates the settings database with the timeout value > > > selected by the user. > > > See: > > > > >http://developer.android.com/reference/android/provider/Settings.Syst. > .. > > > > > This value is read by PowerManagerService.java > > > > >http://www.netmite.com/android/mydroid/frameworks/base/services/java/. > .. > > > > > It looks like it uses a state machine to transition between bright<- > > > >dim<->off states. > > > See setTimeoutLocked() and the Runnable that calls it , and > > > setScreenOffTimeoutsLocked() for the poke handling that happens when > > > you press a key to keep the screen on for some additional time. > > > > > To get a better idea of the flow, it might be useful to enable the > > > prints under mSpew. You can check the value of the class variables > > > easily. > > > > > On Aug 11, 2:13 am, Pratik Prajapati <pratik.prajap...@gmail.com> > > > wrote: > > > > Hi, > > > > > > Can any one please let me know, how/where the screen timeout is > > > implemented? > > > > > > Its like when user does not press any key or touch on the screen, the > > > screen > > > > goes timed out and turn off the back light or reduces the brightness! > > > > > > Regards, > > > > Pratik > > > > > -- > > > unsubscribe: android-kernel+unsubscr...@googlegroups.com > > > website:http://groups.google.com/group/android-kernel > > > > -- > > Kind Regards, > > Pratik Prajapati > > -- > unsubscribe: android-kernel+unsubscr...@googlegroups.com > website: http://groups.google.com/group/android-kernel > -- Kind Regards, Pratik Prajapati -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel