I guess I don't understand what you are asking. Wakelocks keep the system from going to sleep. If you want it to go to sleep, but for some reason it isn't, then you need to find out who else is holding a wake lock to keep it awake. You can't use a wake lock to force it to go to sleep.
There are many drivers that will acquire wake locks themselves at various points to make sure the system continues running long enough to process their work -- for example when receiving data over the network. I don't know whether or not the serial driver does this. On Sat, Apr 3, 2010 at 11:27 PM, Jebediah Huang <[email protected]>wrote: > I don't want it to keep the CPU running. I want the system to suspend > at that point even if there's IO on the serial port. Do I have to add > wakelocks to the app to achieve that? > > On Sun, Apr 4, 2010 at 2:23 PM, Dianne Hackborn <[email protected]> > wrote: > > The program needs to hold a partial wake lock during the time it needs to > > keep the CPU running. > > > > On Sat, Apr 3, 2010 at 9:03 PM, Jebediah Huang <[email protected] > > > > wrote: > >> > >> I added external application that reads some data from serial port. > >> When Android suspend, it says: > >> <6>[ 757.743150] request_suspend_state: sleep (0->3) at 757743750809 > >> (1970-01-01 00:12:37.743740962 UTC) > >> <6>[ 758.220460] PM: Syncing filesystems ... done. > >> <4>[ 758.226651] Freezing user space processes ... > >> <3>[ 758.235448] Freezing of user space aborted > >> <3>[ 758.239823] serialfmread > >> > >> In logcat, after resume: > >> > >> I//system/bin/serialfmread( 690): serialfmread: done doing read > >> I/logwrapper( 690): /system/bin/serialfmread terminated by exit(0) > >> > >> and then it restart my application. My application is input device > >> reader generating input event and it does not touch wakelocks. Is > >> there something I must do to my application to make it behave > >> correctly with Android wakelock? > >> > >> Jeb > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "android-platform" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > >> [email protected]<android-platform%[email protected]> > . > >> For more options, visit this group at > >> http://groups.google.com/group/android-platform?hl=en. > >> > > > > > > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > > 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. > > > > -- > > unsubscribe: > > [email protected]<android-porting%[email protected]> > > website: http://groups.google.com/group/android-porting > > > -- Dianne Hackborn Android framework engineer [email protected] 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. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting To unsubscribe, reply using "remove me" as the subject.
