Commit Graph

15 Commits

Author SHA1 Message Date
Nick Vaccaro
59d9fb4f88 Sensors: MultiHal: ignore errors from poll calls
MultiHal was not properly fielding errors from the poll() calls of
sub-HALs.  Propagating errors received from sub-HALs up to Sensor
Services causes Sensor Services to abort, so instead of propagating
the error up to Sensor Services, the MultiHal logs a message to
logcat to fix the sub-HAL problem.

Bug: 30060537
Change-Id: I6e20c193a2f2d228da48cf3d5a23e439eaf663df
2016-08-05 21:04:24 -07:00
Nick Vaccaro
a889c0915a Sensors: MultiHal: fix naming and compiler warning
Changed module name back to sensors.$(TARGET_DEVICE) to assure
proper load ordering.

Fix use of GNU old-style field designator extension and a couple
type-mismatched comparisons.

Bug: 28251347
Change-Id: I7cf6cc1f78085b8b254729cd8ec42bdb20ea3f81
2016-04-18 16:37:34 -07:00
Nick Vaccaro
940bd08b73 Sensors: MultiHal: Increase xfer buffer size am: 98d5e946ba
am: b675803d03

* commit 'b675803d03ed44124c1111d2535ec841da2f3081':
  Sensors: MultiHal: Increase xfer buffer size
2016-02-16 20:31:24 +00:00
Nick Vaccaro
98d5e946ba Sensors: MultiHal: Increase xfer buffer size
Increased the size of the sensor event transfer queue from 20 to
36 sensor events.  This size now matches Sensor Services buffer size
that it passes to poll() for reading events and will allow the
multihal to transfer the maximum events possible per poll cycle.

Change-Id: I55459ea0a70b9da848d3d3d43590050d71c53e28
2016-02-09 15:48:19 -08:00
Nick Vaccaro
993779c3c4 am 3f93d2a9: Merge "libhardware: sensors: update multi hal to support 64bit builds"
* commit '3f93d2a9705df0c4c341ac3e75b3751da82c98c6':
  libhardware: sensors: update multi hal to support 64bit builds
2015-08-04 19:09:33 +00:00
Ching Tzung Lin
4fd217a1c6 Fix compilation error on emerald-dev
Change-Id: I324fb9b1b54e31610fe4fdce8edbb6979e666cbb
2015-07-23 10:18:06 -07:00
Satya Durga Srinivasu Prabhala
1fd36183bf libhardware: sensors: update multi hal to support 64bit builds
To get multi hal working on both 32 & 64 bit targets,
removing hardcoded paths & checks in multi HAL.

Sensor HAL libs must be installed path that is available through
LD_LIBRARY_PATH.
/system/lib & /system/vendor/lib for 32-bit targets.
/system/lib64 & /system/vendor/lib64 for 64-bit targets.

Change-Id: Ib1c1f25f08855c4584d53cc04fbe82a3a768b180
2015-07-08 12:32:34 -07:00
Nick Vaccaro
e914d696a9 Report multihal is SENSORS_DEVICE_API_VERSION_1_3 compliant
Ignore calls to any HALs that are not 1_0 or 1_3 compliant.
Fix an unused parameter compiler warning.

Bug: 17645248
Change-Id: Ia50f7512dfe35f37973440bba84e1b1b177a7bd3
2014-10-10 16:02:26 -07:00
Nick Vaccaro
c384b18637 Don't pass up bad sensor event packets to Sensor Services
If an event packet is read containing an unknown sensor handle,
don't pass it on to Sensor Services. Drop it on the floor instead
as it's causing Sensor Services to crash.

Moved read of queue size in sensors_poll_context_t::poll() to post
queue mutex grab for safety.

Bug: 15285345
Change-Id: I2ebc0f8591a1ae60f09bf9599b8321c5a3dfae69
2014-06-11 10:42:07 -07:00
Nick Vaccaro
ad70dc482f add /system/vendor/lib as valid search path for sensor HALs
MultiHal will now accept sensor HALs listed in the hals.conf file that
reside in either /system/lib/hw or /system/vendor/lib.

Bug: 14994424
Change-Id: I13f17352b97c36b97cfbcee8c9b6a0d2e1ed6dc3
2014-05-15 14:31:51 -07:00
Nick Vaccaro
d34ed32e06 Change MultiHal API version to 1.1
Bug: 14451762

Change-Id: Id16fa71ae7382689ce141a92eb974b208e20327b
2014-05-05 17:56:32 -07:00
Aaron Whyte
f22e1c1808 Reduced most MultiHal ALOGI to ALOGV, reducing bootup logspam.
Bug: 14084750
Change-Id: I099aaaa24caf0213af373b5a600616674349ff95
2014-04-15 16:22:05 -07:00
Aaron Whyte
4d7ac52d75 Fixed multihal handling of nonexistent sensor handles.
This prevents crashes and undefined behavior when someone
calls sensor HAL methods with nonexistent handles.
It also adds checks and warnings if bad sensor HALs provide
garbage sensor handles in their sensor events.

Tested by making sure pedometer and tilt still work.

Bug: 13513595
Change-Id: Ie1489d3f2972bec82ee1c73189e532f6658d1eca
2014-04-15 11:00:14 -07:00
Nick Vaccaro
93bf99647b Fix sensor multi hal crash when sub-HAL reports an error
Fix a null pointer dereference bug that caused the multihal to crash
in an endless loop continuously trying to open a sensor HAL when it
reports back an error.

Change-Id: I6d82e8fdd9acde53f378a5fb3dfdb02c39d7b433
2014-03-17 13:05:09 -07:00
Mike Lockwood
f847762477 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
2013-12-09 15:26:55 -08:00