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 <[email protected]> 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(ヘマント) <[email protected]> > > > > > > > > > > > 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 <[email protected]> > > 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: [email protected] > > website:http://groups.google.com/group/android-kernel > > -- > Kind Regards, > Pratik Prajapati -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
