Commit Graph

122 Commits

Author SHA1 Message Date
Steven Moreland
3556da3b4a Add include/hardware/*.h symlinks.
These are required to build. Separate CL to preserve blame history.

From running 'update-includes.sh' script here.

Bug: 37280010
Test: boot/build (sanity)
Change-Id: Id9c2dc37f674b27b947a9f823bd38a550d64d31b
2023-06-02 23:01:56 +00:00
Steven Moreland
d783cabd4d Split up headers.
This splits headers into three locations:
include - for backwards compatibility, the global include
include_all - for things system/vendor both use
include_vendor - for things that only vendors use

The goal is to gradually have system things stop referencing
(at least most) of these headers.

Bug: 37280010
Test: build (CL on top adds back in symlinks)

Change-Id: Ibf194276b7faa857e1e7605d7719f4e7d873ecba
2023-06-02 23:01:54 +00:00
Devin Moore
894dd49d68 Add a LINT.IfChange to sensors_event_t
If that is changed, ASensorEvent also needs to be changed.

Test: na
Bug: 259711109
Change-Id: If1fdedba6a73d46b64f47490a7946954c47a3b79
2022-11-29 19:13:56 +00:00
TreeHugger Robot
7af95ea02d Merge "Add heading to sensors_event_t" 2022-01-27 18:43:08 +00:00
Tyler Trephan
3d9af7ccfd Add heading to sensors_event_t
Bug: 189983308
Test: compile (definitions only)
Change-Id: I01b75ecae37755bf43321d99e465a9dc42e2e318
2022-01-26 18:27:43 +00:00
Eva Chen
544076be9c Add TYPE_HEADING sensor type definitions.
Bug: 189983308
Test: Presubmits
Change-Id: I74186ac6685a376158101f65d2687f1905c09814
2022-01-25 17:10:44 -08:00
Eva Chen
f4e1d6a272 Merge "Add limited axes imu types to sensors_event_t" 2022-01-26 00:15:26 +00:00
Eva Chen
8681aa977e Merge "Add limited axes imu sensor type definitions." 2022-01-26 00:15:26 +00:00
Tyler Trephan
6515145f9c Add limited axes imu types to sensors_event_t
Bug: 187342209
Test: compile (definitions only)
Change-Id: Ifa89e45f24a4b4647b4c36b72b5d033397252ee1
2022-01-21 22:22:01 +00:00
Brian Duddie
373a1b9fe9 Add head tracker to sensors_event_t
Bug: 210156629
Test: compile (definitions only)
Change-Id: Ic76e8b957a4e1660dd975fd3195b7b2aa31035b4
2022-01-19 16:06:13 -08:00
Eva Chen
2588d75554 Add limited axes imu sensor type definitions.
Included sensors:
- SENSOR_TYPE_ACCELEROMETER_LIMITED_AXES
- SENSOR_TYPE_GYROSCOPE_LIMITED_AXES
- SENSOR_TYPE_ACCELEROMETER_LIMITED_AXES_UNCALIBRATED
- SENSOR_TYPE_GYROSCOPE_LIMITED_AXES_UNCALIBRATED

These changes will enable support for automotive style IMUs that have
more limited axes for accelerometers (x-axis and y-axis) and gyroscopes
(z-axis).

Bug: 187342209
Test: N/A
Change-Id: Iff0553c88f62e4b5693a72116173063f35b914e9
2022-01-18 20:38:28 -08:00
Brian Duddie
d3e67d55ac Add definitions for new head tracker sensor type
Bug: 210156629
Test: n/a
Change-Id: If267401f059fe1377e495a91776b2eb4448fd1ef
2022-01-10 16:13:14 -08:00
Anthony Stange
e2a118aafb Update new values for latest sensor HAL changes
A hinge angle sensor type has been added to the sensor HAL which
requires updating sensor.h and sensor-base.h.

Bug: 144139857
Test: N/A
Change-Id: I0d8e7d028cc1b2e05a8ec74b7ab3da9ffff5dbde
2020-01-16 19:39:06 -05:00
Aniroop Mathur
443a4acbf7 Sensor: HAL guideline clarification upon activation request
Sensor events can be generated even after completion of sensor deactivation
request so the correct time to abandon the stale events is before making new
activation request instead after sensor deactivation request.

For example: In data injection mode which make sensor deactivation request,
sensor events are generated in sensor deactivation state. These events may
not have been picked up by poll before completion of switching to normal mode.
So it is necessary to abandon stale events at the time of activation request
so that in normal mode, application will not get injected events generated
during data injection mode.

Test: Inject sensor events at fastest possible sensor rate in data injection
mode and check whether there is any injected event received by application
after switching to normal mode.

Change-Id: I3a2c8a76946569a12e9416ac20ad2389f914d6e2
Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
2017-08-25 16:42:29 +00:00
Ashutosh Joshi
d14335b8a6 Ensure that LLOB sensor is names similr to other android sensors.
Ensuring that the LLOB sensos naming style is consistent with other
sensor naming styles.

Bug: 36554362
Test: Verify that the sensor shows up with the appropriate name
      string.

Change-Id: Ic91d13e7c1c6652179d3259509682f3c19cd89dc
2017-04-15 01:08:08 +00:00
Peng Xu
bed42d4c2b Clarify that reserved function pointers has to be set to null
Test: no, comment change
Change-Id: I2b295c721cf199bcec779c8606ee1deb9fdf0a5c
2017-04-06 17:52:29 -07:00
Peng Xu
f144435ef4 [sensors] clarify sensor and direct channel handle size
* clarify direct channel handle must be less than INT32_MAX.
* sensor handle should fit in int32_t and positive.

Test: compiles ok
Change-Id: Iaf4573cf3a66b992fd354217096140a6001c4078
2017-01-17 15:14:49 -08:00
Peng Xu
95f79b1879 [sensors] Minor tuning of hal definition
* Swap GEOMAGNETIC_FIELD with MAGNETIC_FIELD for more accurate
    definition.
  * Clarify that string type will be omitted for well defined sensor
    types.
  * Remove legacy 8-bit restriction to sensor handle. This is an
    unnecessary limit for since long time ago. Still leave the define
    for code compatibility and change the value to 32.
  * update sensors-base.h with companion .hal file change.

Test: test with sensorlogger, all sensor works
Change-Id: I6ff7022146eb25f7efdce87b70bf5ed488a70c6d
2017-01-13 10:58:23 -08:00
Ashutosh Joshi
da8827a283 Merge "Add an uncalibrated accelerometer type." 2017-01-13 17:47:33 +00:00
Peng Xu
08a4dd9e89 [sensors] Adding HAL API support for direct report mode
Added HAL function and constant definition for sensor direct
report mode. This new mode allows sensor hardware to communicate
with application directly via a lock-free queue based on shared
memory to achieve low latency and high report frequency.

Test: compiles and runs
Bug: 30985702
Change-Id: I79c73bcdcc45d43b5a236d65874e5071a589cecd
2017-01-12 12:19:12 -08:00
Ashutosh Joshi
d1e2562a79 Add an uncalibrated accelerometer type.
Add an uncalibrated accelerometer sensor type.

Test: Build compiles.

Change-Id: Iddc3b03abf0ba9beeec542eecf138b06d08355f2
2017-01-11 11:11:11 -08:00
Nick Vaccaro
cfd950b679 Add low latency offbody detect sensor type
Bug: 32492601
Test: no
Change-Id: Ieb0047c2a134b5b3c54ab48ac71b33827a353075
2016-11-04 16:10:08 -07:00
Andreas Huber
9219017251 sensor HAL v3
Bug: 32021636
Test: no
Change-Id: Ibbced293ecb560f07e1bd96d5b78ed3dc3a2fd59
2016-10-12 08:41:05 -07:00
Colin Cross
6f1a00e29a Avoid C-style cast warnings am: cc8d9f9fcb am: ac416b9ed3 am: 9a786a3044
am: 2b932a434e

Change-Id: I6678be57a6905f7c0e490d4b55874107bf8d6e6d
2016-10-08 01:07:21 +00:00
Colin Cross
da3b22546e Fix doc warnings am: 867e1e3043 am: 18bf56aeb7 am: 876f1ffb95
am: 14c19f32da

Change-Id: I29279966a26d5258e9bf80b13356e1c9b6f636df
2016-10-08 01:07:02 +00:00
Colin Cross
cc8d9f9fcb Avoid C-style cast warnings
hardware/libhardware/include was being included with -isystem, which
hides warnings.  Use a macro to convert modules to hw_device_t** to call
the open function that works in C++ and C.

Bug: 32018017
Test: m -j
Change-Id: If68bf15581975f1217fcab366cef7bc784894641
2016-10-07 13:10:20 -07:00
Colin Cross
867e1e3043 Fix doc warnings
hardware/libhardware/include was being included with -isystem, which
hides warnings.  Fix use of doxygen function comments on on function
pointers, which are not considered functions or methods.

Bug: 32018017
Test: m -j
Change-Id: I71a1d33a9ae90b646bf22f32e052bbe22e8aca76
2016-10-07 13:10:07 -07:00
Peng Xu
9dd99334af Merge "[sensor] Clarification of sensor HAL behavior at deactivation" am: 04302ea2fa am: 4b59f97c82 am: 52946f658e
am: 4b36c5e462

Change-Id: I62618abbff602765669ce16660e3f00e071a3c4c
2016-10-06 00:27:03 +00:00
Peng Xu
aaeeaa41bd [sensor] Clarification of sensor HAL behavior at deactivation
Sensor HAL should abandon stale data at deactivation.

Test: documentation change, spell checked.
Bug: 28443809

Change-Id: I29b1d324fc96d0448cdefbf2130161f71c3d3310
2016-10-05 15:17:33 -07:00
Peng Xu
355e3f606a Clarification of poll() and DYNAMIC_SENSOR_META sensor
Change-Id: I755b13535d9752e3337a5cc4a6d1e73a3e7c57d6
2016-07-19 15:11:53 -07:00
Peng Xu
69b5dba69c [sensor] clarify definition of the uuid field
Add description of the byte order the uuid field should use along
with an expample.

Bug: 28305085
Change-Id: If607631f15c1611bd51b158bd80eac1eef331b4b
2016-04-26 19:04:01 +00:00
Peng Xu
d156299686 Add two sensor flags
Add sensor flag for indication of dynamically added sensor and
support of additional information.

Change-Id: I02ee7d6d325f6cb04f371bcde6bb755f52720671
2016-03-30 15:58:39 -07:00
Peng Xu
0743a5ceeb Implementation of sensor additional info report
This implements a mechanism for sensor hardware/HAL to deliver additional information beside sensor
readings to application. It includes internal temperature reading, untracked delay of sample,
location and pose of sensor device placement in phone frame, etc. This is also a very expandable
frame to account for future need.

Change-Id: I9463930ad1eaac2d9b506ebaabd19bc092604e8f
2016-01-27 21:20:07 -08:00
Peng Xu
e20707ad87 Fix build caused by "bool connect"
Change-Id: Ibc0bc984aebff6ae512c11bfe3cb1d1a18845a78
2016-01-27 18:26:10 -08:00
Peng Xu
e641ba987a Dynamic sensor related definitions
Defined the dynamic sensor meta data type and UUID of sensor.

Change-Id: I54385bf70c366057d07ea049def1073cd8a35166
2016-01-27 16:44:34 -08:00
Ashutosh Joshi
cb96331ac3 Adding new sensor types.
Adding new sensor types for the following -
     i) Stationay Detection
    ii) Motion Detection
   iii) Heart Beat Detection

Change-Id: I0e0dca011de99ed1dda56cbb3b6381df529a1345
2016-01-26 05:56:42 -08:00
Ashutosh Joshi
ed021eae5c Adding support for a 6 DOF pose sensor
Adding a six degree of freedom sensor returning device pose.

This pose is comprised of two parts a rotation from an orientaion
pointing due north and zero pitch and roll && a translation from
an initial point of reference.

Change-Id: If9e1d5a421b81e6e388c446a5a1c19e9c08ad067
2016-01-25 14:22:29 -08:00
Trevor Bunker
f8e7ed34bd sensor HAL: add device orientation sensor
This sensor reports the current device orientation (e.g., portrait vs.
landscape).

Bug: 23470411
Change-Id: I7654473d5aaee256b8ae906c40634141a7f9cdd8
2016-01-08 10:22:23 -08:00
Aravind Akella
2d6c8d7e90 Fix DATA_INJECTION flag in sensors.h
Bug: 24001171
Change-Id: Ia42934a97566f0ebe8d324e065351a3d9ed55621
2015-09-11 11:34:17 -07:00
Aravind Akella
c7f54134ca Define a flag for whether a sensor supports data_injection mode or not.
Change-Id: I46373bbd2e10859b84428fe32b76679ac4292607
2015-06-22 18:26:54 -07:00
Ashutosh Joshi
050f2e45a0 Remove custome sensors from sensors.h
Custom sensors should not be included in sensors.h

Change-Id: I553fbe3dd41eaaa70628184f5a0b9499699f17bc
2015-04-15 14:47:43 -07:00
Ashutosh Joshi
6507f5080b Sensors HAL changes
Adding HAL changes for the following
i) a method to place the HAL in a special mode.
     Expect to use this method for data-injection.
ii) a method to inject sensor data into the sensors subsystem.
iii) New sensor type for a SYNC event (google custom sensor).
iv)  New sensor type for a nudge gesture (google custom sensor).

Change-Id: Idf0479b6301c5363cf51938e23aabc790b69fa96
2015-04-14 15:11:49 -07:00
Nick Vaccaro
adbfbb747d Add new SENSOR_TYPE_WRIST_TILT_GESTURE sensor type
Adds a new sensor type for converting the Android Wear defined wrist
tilt sensor type into an official android sensor type.

Change-Id: If6357aeb463a556a68a19b28931edec04f99a952
2015-02-05 12:26:35 -08:00
Aravind Akella
110d2f2713 sensors.h documentation change.
i) on-change sensors should set maxDelay.
  ii) Drivers should hold a wake_lock till poll() is called
  the next time when delivering events from wake-up sensors.

Change-Id: I4b137843d5c857f04601618548306a710fbfbe5c
2014-09-05 14:50:07 -07:00
Griff Hazen
f0f67e6af9 Merge commit '38014a7c' into lmp-dev
Conflicts:
	include/hardware/sensors.h

Change-Id: I21517f717761af7f52c003d535e86059ebb75f05
2014-08-28 17:02:50 -07:00
Vinod Krishnan
74279e3c23 Adding information about the first activation
Change-Id: If5759749c5e6a88dcaf5ab600c9086b056c3908a
2014-08-28 15:25:13 -07:00
Aravind Akella
a7f2cda848 Sensor HAL documentation fix.
Change-Id: Ibc3f643a22163f734ba0ca912f011decf55d9bfa
2014-08-21 16:31:14 -07:00
Etienne Le Grand
772d85ad35 Some parameter renaming and comment update in sensors.h
bug: 16818625
Change-Id: Ifcda8cd4e80a7377a6b5b138b9c7a5a2275af153
2014-08-19 17:29:10 -07:00
Aravind Akella
9057e128b0 Remove WAKE_UP_* sensor constants and stringTypes.
Change-Id: Iabe4bb064d88d9fcecc1a31e609cb8b77ebdd5ad
2014-07-30 16:27:36 -07:00
destradaa
5ebb31c9bc Fix typo in sensor type using an already defined constant.
Change-Id: I209d9191456dc6c1ef2eb695c9a8348a18504a8d
2014-07-21 15:12:21 -07:00