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, 9 Dec 2013 23:26:55 +0000 (15:26 -0800)
commitf84776247777ca8710eca8a911f607e10256cc7d
tree7e3d4a68f572c131f2a4106448852189244030f0
parent0bd030b5df7381949ff368f15ebca214560fbf22
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

Change-Id: I1e35508949df98a1acef7a4a2d012eea87b4a5eb
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]