A wake lock is not currently held for services; you will need to wrap it
with a broadcast receiver.  (Actually it is held, but because services are
async the power manager is immediately told that the pending intent has been
sent, and releases its wake lock.)

On Fri, Dec 18, 2009 at 4:23 PM, Alberto <[email protected]> wrote:

> Hello, I have a question about alarms used with services with regards
> to wake locks. The documentation explains the behavior using
> BroadcastReceivers, a wakelock is held during onReceive(), but doesn't
> describe the behavior for alarms starting services with the RTC_WAKEUP
> flag. What is the behavior in this case?
>
> I have an app implementing this, an alarm is created with the
> RTC_WAKEUP flag that starts a service. The service onCreate() then
> starts a thread to do some network activity. It seems to work just
> fine but I just want to make sure that I don't need to explicity hold
> a wakelock myself.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?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.

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

Reply via email to