Accelerometer power tied to display backlight power

548 views
Skip to first unread message

Jordan Frank

unread,
Mar 14, 2009, 2:23:08 PM3/14/09
to Android Developers
Hi,

Although I haven't received confirmation from anyone at Google, I can
confidently state that when the power to the display goes off, one can
no longer obtain data from the accelerometers. I can easily think of a
number of examples of where one would like to continue collecting
accelerometer data even when the display is of.

Supposing that I wanted to "fix" this, can anyone suggest where should
I start looking? Would this be in the SDK, the kernel, or in some
proprietary firmware that I can't touch?

Thanks,
Jordan Frank

Stoyan Damov

unread,
Mar 14, 2009, 3:20:34 PM3/14/09
to android-d...@googlegroups.com

Jordan Frank

unread,
Mar 15, 2009, 9:57:41 AM3/15/09
to Android Developers
My fault for not explaining myself better. I want to still be able to
collect accelerometer data while the display is off. I'm well aware of
the fact that I can keep the display on, but if I want to, for
instance, create a pedometer application that counts footsteps while
in the user's pocket, then the last thing I want is to keep the
display to be on the whole time.

Cheers,
Jordan

On Mar 14, 3:20 pm, Stoyan Damov <stoyan.da...@gmail.com> wrote:
> http://developer.android.com/reference/android/os/PowerManager.WakeLo...

Marco Nelissen

unread,
Mar 15, 2009, 12:35:26 PM3/15/09
to android-d...@googlegroups.com
That's why you'd use a *partial* wakelock.

Jordan Frank

unread,
Mar 16, 2009, 9:01:37 AM3/16/09
to Android Developers
A partial wakelock doesn't help because, as I have already explained,
as soon as the display goes off, the accelerometers go off. I can keep
the CPU awake, and my program continues to run when the display is
off. However, as soon as the display goes off, the accelerometers go
silent.

So this is why I think that the solution lies in one of the lower
layers, I'm just not sure where to start digging.

Cheers,
Jordan

On Mar 15, 12:35 pm, Marco Nelissen <marc...@android.com> wrote:
> That's why you'd use a *partial* wakelock.
>

David Burström

unread,
Apr 17, 2009, 4:18:21 AM4/17/09
to Android Developers
Hi Jordan,

I can only agree with your findings. Regardless of which lock is being
used, the service stops sending callbacks as soon as the screen turns
off or the power button is pressed.

:David

Carter

unread,
Apr 17, 2009, 2:13:41 PM4/17/09
to Android Developers

Jordan Frank

unread,
Apr 20, 2009, 10:55:10 AM4/20/09
to Android Developers
Known but not resolved. Even in the bug report that is mentioned in
the thread that you quoted, the only response has been "things might
have changed in cupcake". Of course determining what has changed, or
if this specific problem has been fixed requires wiping the phone and
installing cupcake*, whereas it seems like someone in the know could
say "we fixed this", or "this is still the behaviour" and we could
stop discussing this.

Jordan

* If I haven't heard anything more about this by the end of the week,
I will probably end up wiping and upgrading to cupcake.

On Apr 17, 2:13 pm, Carter <ccjerni...@gmail.com> wrote:
> This is a known issue.
>
> See this thread:http://groups.google.com/group/android-developers/browse_thread/threa...

Jordan Frank

unread,
Apr 20, 2009, 3:15:14 PM4/20/09
to Android Developers
Good news! I upgraded my device to cupcake, and it appears that I can
now receive onSensorChanged events when the screen is off, provided
that I hold a Partial Wake Lock.

However, the sampling frequency seems to be far more sporadic. I think
that it has to do with the fact that cupcake now flips the orientation
of all applications, and when it does the redrawing, it suspends the
application (and thus the sensor listeners). I'm experimenting with
turning this auto-orientation behaviour off (Anyone know how to do
this on an application-by-application basis, rather than turning it
off in the device settings?).

Anyway, things look good for those of us who wanted sensor data
without having to leave the screen on.

Jordan
Reply all
Reply to author
Forward
0 new messages