You need to hold a partial wake lock if you want to ensure that the CPU
continues to run while the screen is off.  There are very, very few
exceptions to this -- broadcasts received from the alarm manager being the
big one.  There may be a few other broadcasts that hold a wake lock for you
while they are being sent, but in almost all cases outside of broadcasts you
will need to hold a wake lock.

Also, keep in mind, sitting there monitoring the sensors while the screen is
off is probably going to be a pretty big battery drain; at the very least,
you'd want to have a very clear UI with the user about what is going on and
how they can turn it off.

On Sun, Aug 30, 2009 at 10:01 AM, polymorph
<[email protected]>wrote:

>
> Ok, thanks for the reply Mark.
>
> It seems the documentation doesn't state either way whether anything
> will or will not continue to function while in standby.  I wonder if
> there's anyone from the Android team that could let me know the
> official stance on this?
>
> There's also the situation with the Hero, which won't continue with
> these OnSensorChanged() messages even when a WakeLock is in place.
>
>
>
> On Aug 30, 5:44 pm, Mark Murphy <[email protected]> wrote:
> > polymorph wrote:
> > > It's in a background service which does get called for GPS location
> > > changes and other things while in standby, so I'd expect it to do so
> > > for the sensor changes too (as it did used to in standby).
> >
> > The subtle point I was trying to get across is that a regression in an
> > undocumented capability may or may not be a bug, and therefore may or
> > may not be "fixed". The core Android team has been very explicit about
> > the risks inherent in relying upon undocumented capabilities, even if
> > this undocumented capability was not addressed specifically. For
> > example, this issue could very well be dictated by hardware concerns.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > Android 1.5 Programming Books:http://commonsware.com/books.html
> >
>


-- 
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