OSDN Git Service

DO NOT MERGE: Sensor multi HAL
authorMike Lockwood <lockwood@google.com>
Thu, 17 Oct 2013 15:05:00 +0000 (08:05 -0700)
committerMike Lockwood <lockwood@google.com>
Mon, 2 Dec 2013 15:34:19 +0000 (07:34 -0800)
commit0bae43dc59372a84ffe0c1e57af68076dffab73a
treea307b4cc69a6678fd40f61b1f6726bda90c2f61c
parent7ccf148f5066ceb1a161f0d7a7d66f75c6e8d420
DO NOT MERGE: Sensor multi HAL

Squashed commit of:

Move sensors multi HAL to libhardware

Added a SensorEventQueue, a circular buffer meant for reading with one thread
and polling a subhal with another. The writing thread gets access to pointers
in the internal buffer. This design avoids a memcpy on write when the multihal
fetches subhal events using poll().

Unit-tests include multithreaded reading and writing lots of events, in
random-sized chunks.

This is not used by the multihal yet. That will be a different CL.

MultiHal multithreaded polling

Tests SensorEventQueue I/O when the queue is full.
Reduced debug logging in multihal.

deactivated multihal logspam, made warnings warnings, left critical startup info

Removed unneeded linux/input.h includes, to fix Mac SDK build
modules/Android.mk
modules/sensors/Android.mk [new file with mode: 0644]
modules/sensors/SensorEventQueue.cpp [new file with mode: 0644]
modules/sensors/SensorEventQueue.h [new file with mode: 0644]
modules/sensors/multihal.cpp [new file with mode: 0644]
modules/sensors/tests/Android.mk [new file with mode: 0644]
modules/sensors/tests/SensorEventQueue_test.cpp [new file with mode: 0644]