Wake locks should be released when the object is garbage collected.
See the finalize() method in the WakeLock subclass here:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/os/PowerManager.java

You will get a thrown exception in your logs if this occurs.

So, as long as your Service is no longer referenced in memory (e.g. it
has been destroyed), the wakelock should be released. Obviously this
should not be the behaviour by design :)


On Fri, Jun 4, 2010 at 3:36 PM, Satya Komatineni
<satya.komatin...@gmail.com> wrote:
> Scenario:
>
> 1. Broadcast Receiver holds a static wake lock hoping the service it
> started, when it finishes will release the lock
> 2. Howvever Service dies with out releasing the wake lock?
>
> What is likely to happen?
>
> I am assuming the process will be stopped after calling the
> "onDestory()" of the service, and I am hoping the device will go to
> sleep ignoring the "held" wake lock.
>
> Or does the call to "onDestroy()" delayed because of the wakelock
> although the service called "stopSelf()"
>
> Thanks
> Satya
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to