Commit graph

647 commits

Author SHA1 Message Date
Steven Moreland
ddc9daad96 sensors: cleanup OWNERS
I wrote a script to do this.

Bug: N/A
Test: N/A
Change-Id: I2f53125790aea64d7a3c02569cecccc9cec9522b
2022-12-29 23:44:34 +00:00
Devin Moore
e7e44e0022 Merge "Revert^2 "sensors: adding a common convert lib"" 2022-12-06 16:57:01 +00:00
Devin Moore
160d7a4504 Revert^2 "sensors: adding a common convert lib"
3633b6d4fe

Change-Id: Ie13caa288e8cba344225bb2e4fd01fc23b1d4a9d
2022-12-01 23:17:17 +00:00
Aditya Chitnis
e61b64baf5 Adding suport for multiple multihal config files
Bug: 259450346
Test: Presubmits
Change-Id: Ic7b113e6b8bf94e0c0ffe539f965232b24bdf66d
2022-12-01 10:07:31 +00:00
Krzysztof Kosiński
3633b6d4fe Revert "sensors: adding a common convert lib"
Revert submission 2313818-sensors_shared_convert

Reason for revert: Breaks wembley_2GB-userdebug
Reverted Changes:
Icf64c8809:sensorservice: use new convert functions
Ibc6ed5566:libandroid_sensor_headers: make host_supported and...
Ib80130fc0:sensors: adding a common convert lib

Change-Id: I3f4cb4dc228b5bf6f81f451c11c11d6ebf19639a
2022-11-30 05:16:15 +00:00
Devin Moore
d8598ec6db sensors: adding a common convert lib
This common convert library is used by both the HIDL and the AIDL
convert library to provide conversions between ASensorEvent and
sensors_event_t.

Test: atest VtsHalSensorManagerTargetTest
Test: atest VtsHalSensorManagerV1_0TargetTest
Bug: 259711109

Change-Id: Ib80130fc04339245527ed20479cd9212f016713b
2022-11-28 17:55:14 +00:00
Devin Moore
6a58599217 Merge "Make sensors convert library host_supported" 2022-11-22 17:37:49 +00:00
Karthik Bharadwaj
34557d4596 Merge "Default accel Z direction value to +9.8" 2022-11-21 22:03:14 +00:00
Karthik Bharadwaj
4cea52915a Default accel Z direction value to +9.8
Default the accelerometer defaut Z value to +9.8 to indicate a
more 'natural' resting position of flat with screen up for the
device.

Bug: 242736284
Test: Presubmits, vts VtsHalSensorsV2_0TargetTest.
Change-Id: I92357119173dbc99a0a6665de5d733286ac30c3e
2022-11-21 18:28:44 +00:00
Devin Moore
fb3f5ada35 Make sensors convert library host_supported
Used for host_supported fuzzers.

Test: libsensorserviceaidl_fuzzer
Bug: 233850220

Change-Id: I80680907f65edbb6ddb8d433460829967e0b75b0
2022-11-18 19:33:01 +00:00
Devin Moore
00721dc031 Add a convert library for sensor AIDL
This is moving the conversion functions from
frameworks/native/services/sensorservice/AidlSensorHalWrapper.cpp.
This conversion code needs to be shared between sensorservice, a new
libsensorserviceaidl, and the new VTS tests for AIDL sensorservice.
It will likely also be used by vendors interacting with the new AIDL
sensorservice.

Test: VtsHalSensorManagerV1_0TargetTest
Bug: 205764765
Change-Id: Iabb0bcf0770672671e51fd304f79e14ca94a2d15
2022-11-18 00:58:35 +00:00
Devin Moore
9ef0c60a25 Add host_supported to sensors AIDL interface
Useful for host fuzzing. Needed to make the new sensorservice AIDL
host_supported.

Test: m
Bug: 205764765
Change-Id: I3fb0786fe27274d91c05a0598bf9d96c20062edf
2022-11-18 00:58:28 +00:00
Sally Qi
a1c66a2993 Add cc_defaults wrapper for android.hardware.graphics.allocator ndk
package.

- to avoid manually rev up if needed.

Bug: 243429120
Test: builds
Change-Id: I25bfcc203cda61af308c37c3766fa9efe6c6784c
Merged-In: I25bfcc203cda61af308c37c3766fa9efe6c6784c
2022-10-20 18:27:12 -04:00
heqiang1008 thundersoft
d6ef4fb700 Use EXPECT_LE instead of EXPECT_LT for some iio sensors that do not support runtime suspend.
Change-Id: I646511f9d6c62f2967cedf6a2abc19aa621ee073
2022-09-09 09:11:10 +00:00
Xin Li
7406132b49 Merge android13-tests-dev
Merged-In: Ie372f74f3a52decce592181c7d65624f8ec03ed1
Change-Id: Ia81e24391de0d26737a5d65fbc5c8bb86bf03d5b
2022-08-17 16:37:46 -07:00
Arthur Ishiguro
ad325a0150 Adds AndroidTest.xml for AIDL sensors VTS test
Bug: 241174366
Test: run VtsAidlHalSensorsTargetTest, and verify Android app
can receive sensor data after test runs

Change-Id: Ie372f74f3a52decce592181c7d65624f8ec03ed1
(cherry picked from commit 8492dab99d)
2022-08-04 19:59:05 +00:00
Alexander Koskovich
0266615a44 interfaces: sensors: Add group 'input' to 2.[0-1] multihals am: 9abc8e213f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2146560

Change-Id: I6d9af335e64af4c3ca2352f783609992a312a132
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 19:59:06 +00:00
Alexander Koskovich
9abc8e213f interfaces: sensors: Add group 'input' to 2.[0-1] multihals
* Required by some OEM sensor implementations, e.g.
   ASUS ZenFone 8, ASUS ROG Phone 3, OnePlus 9. This
   is done so /dev/input/event* nodes can be read by
   the QCOM sensor HAL.

Test: Verified light and proximity sensor work on ASUS
      ZenFone 8 & ROG Phone 3 (android-12.1.0_r7).
Change-Id: I1a2d7384da0b159a4b59fcf38c37117d43b3b127
2022-07-05 23:16:14 -07:00
Jooyung Han
c0b24f4f13 Remove AIDL-libs from VNDK
Some are still in VNDK because they are used in other VNDK libs.

Ignore-AOSP-First: some libs are still in internal master only.

Bug: 234181591
Test: m
Merged-In: If999df9c78a20df931177da11742b1c5de19bc08
Change-Id: If999df9c78a20df931177da11742b1c5de19bc08
(cherry picked from commit 5527adfd7f)
2022-06-14 14:08:59 +09:00
Arthur Ishiguro
6b48d121d9 Adds missing AIDL HAL SensorStatus conversion logic
Bug: 235629868
Test: Compile
Change-Id: Ice2df3935f2bcab9e9612ebd3fdacc57ea6f8dbc
2022-06-13 16:06:34 +00:00
Brian Duddie
c325337352 Support AIDL IAllocator for direct channel tests
Bug: 234673324
Test: atest VtsHalSensorsV2_1TargetTest -> DirectChannelGralloc pass on
      device using AIDL IAllocator
Change-Id: I169d3bc863f7e588f42e408f151064066b9960cc
2022-06-10 02:09:11 +00:00
Brian Duddie
739ae49519 Fix sub-HAL handle in dynamic sensor meta events
Need to apply the sub-HAL index byte to ensure handles provided in
DYNAMIC_SENSOR_META events align properly with the [dis]connected
callbacks.

Bug: 228879057
Test: try on device with dynamic sensors sub-HAL at index > 0
Merged-In: Ic7290b51733bb829a5494ef41e9430b51dc6074e
Change-Id: Ic7290b51733bb829a5494ef41e9430b51dc6074e
2022-04-27 09:43:22 -07:00
Brian Duddie
280fd70dc4 Fix sub-HAL handle in dynamic sensor meta events
Need to apply the sub-HAL index byte to ensure handles provided in
DYNAMIC_SENSOR_META events align properly with the [dis]connected
callbacks.

Bug: 228879057
Test: try on device with dynamic sensors sub-HAL at index > 0
Change-Id: Ic7290b51733bb829a5494ef41e9430b51dc6074e
2022-04-25 20:29:28 +00:00
Jiyong Park
70f5837e1f Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: I61eb51c0334eb99489c6f1570110d7e18c350c99
2022-04-16 07:03:24 +09:00
Arthur Ishiguro
e9cb2933a4 Fix AIDL sensors VTS test
- According to the AIDL backends, return values are not propagated
  when the status is !ok(). Update the VTS test, HAL implementation,
  and ISensors definition to remove the requirement that the
  handle is populated to -1 on failure for registerDirectChannel.
- Also update VTS tests for some error code checks to reflect the
  actual expecataions according to the ISensors documentation.

Bug: 228645167
Test: VTS passes
Change-Id: I5d4d4d0af3b033b34a58d8462aa40214d89fa442
2022-04-12 22:30:02 +00:00
Arthur Ishiguro
eae8adf209 Fix return values in AIDL multi-HAL shim
- Converts HIDL return values directly to ScopedAStatus
- Adds asserts for unexpected values of conversion code

Bug: 228645167
Test: Run VTS

Change-Id: Ifcc57f565b4e1d9c140db9363e21ab6ee7dd6660
2022-04-11 21:29:29 +00:00
Arthur Ishiguro
5fc076011c Implements AIDL multi-HAL debug dump
Bug: 228645167
Test: adb shell dumpsys android.hardware.sensors.ISensors/default
Change-Id: If5985d669d5fae6ca99d0156f61841f868c8c60f
2022-04-11 15:57:03 +00:00
Jiyong Park
703e97920e Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394
2022-03-31 12:01:39 +09:00
Jooyung Han
6bb92e00b8 Cast to int for union tag
Union tag will be changed from `enum` to `enum class`. We need explicit
casting with enum class.

Bug: 225119187
Bug: 218912230
Test: m
Merged-In: I2401e66dc9d8bc511a601fcdce365e5f823576d4
Change-Id: I2401e66dc9d8bc511a601fcdce365e5f823576d4
(cherry picked from commit 1c4e9829ec)
2022-03-17 09:56:28 +00:00
Chih-hung Hsieh
34593d4e2a Merge "Add timed out test files to tidy_timeout_srcs" am: ff54f73b4f am: fa83970b3a am: 581616e658
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1992232

Change-Id: I2eac13fe3b5ab0b4f15d6ceadf376e5e74124a81
2022-02-24 01:32:09 +00:00
Chih-Hung Hsieh
ad1bf31b78 Add timed out test files to tidy_timeout_srcs
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
  the following settings:
    TIDY_TIMEOUT=90
    WITH_TIDY=1
    CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
  tidy_timeout_srcs files will not be compiled by clang-tidy.
  When developers build locally without TIDY_TIMEOUT,
  tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
  or disable some time consuming checks, and then
  enable clang-tidy to run within limited time.

Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
2022-02-18 17:25:41 -08:00
Brian Duddie
03e15d8e8f Clarify optionality of head tracker velocity
Bug: 218911221
Test: n/a, comment change only
Change-Id: I2645114727c452df8d53ad015736f9f2d8d5b6e2
2022-02-15 19:56:12 +00:00
Chih-hung Hsieh
41be2d8fa5 Merge "Fix cert-dcl16-c warnings" am: 2d028894c7 am: 2f22222a1c am: e18edd3ffd am: 3a8019b93a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1978297

Change-Id: I17838676d19fa572050bd7372bddd65eb405fa8a
2022-02-10 19:33:44 +00:00
Chih-Hung Hsieh
91b4835ada Fix cert-dcl16-c warnings
Bug: 120614316
Test: make tidy-hardware-interfaces-sensors-aidl_subset
Change-Id: Ia9f5a9153b1591623aff0df4e185f445762bcbaf
2022-02-09 15:47:54 -08:00
Chih-Hung Hsieh
4f4d365aa5 Fix cert-dcl16-c warnings
Bug: 120614316
Test: make tidy-hardware-interfaces_subset
Change-Id: I6bbeddb9990e4771155ec7d49a68f0e161789030
2022-02-09 15:38:45 -08:00
TreeHugger Robot
c3ada23eb3 Merge "Update documentation of SensorInfo.aidl" 2022-02-03 21:21:46 +00:00
Arthur Ishiguro
b30f4556fc Update documentation of SensorInfo.aidl
Bug: 217750786
Test: None, comments only
Change-Id: I8c5e6c15b398ea5935bdcac08605f3f7e7399d3a
2022-02-03 19:33:13 +00:00
Tyler Trephan
12cf91d7f6 Updated VTS to support heading sensors.
Test: atest VtsAidlHalSensorsTargetTest
Bug: 214096235
Change-Id: Id8c589c010ebd66cc33f66e08b6bdee1f7612ba3
2022-01-28 21:09:35 +00:00
TreeHugger Robot
df6575e4d3 Merge "Updated VTS to support limited axes IMU sensors." 2022-01-28 15:36:37 +00:00
Treehugger Robot
653d588e32 Merge "Remove early break for sub-HAL initialization failure" am: 6e503b7a4e am: fa9af8de75 am: 0774f2b58e am: b222bd47a3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1961241

Change-Id: I4baa7f43717bbb84cdee578dcd510b97efcd5e5e
2022-01-27 23:24:32 +00:00
TreeHugger Robot
711d3c88a1 Merge "Add head tracking to multi-HAL conversion code" 2022-01-26 23:43:26 +00:00
Yixuan Wang
105da222fb Remove early break for sub-HAL initialization failure
Bug: 212420575
Test: none
Change-Id: I38099a4edbdeffe99ae2d91fc9dc518c9da98b13
2022-01-26 21:22:44 +00:00
Tyler Trephan
38e65b13d6 Updated VTS to support limited axes IMU sensors.
Test: atest VtsAidlHalSensorsTargetTest
Bug: 188012758
Change-Id: If0a2051eb0d39d8afdf7011da1371a48e4b12c44
2022-01-25 23:04:55 +00:00
Arthur Ishiguro
ce255a3176 Add head tracking to multi-HAL conversion code
Also adds OWNERS file.

Bug: 215702376
Test: Compile
Change-Id: Ib0bbb312aae66ab6130a8677ec8e0e82d0db48bb
2022-01-25 22:50:25 +00:00
Arthur Ishiguro
ecd7f8d60d Merge "Relax assertion criteria in HIDL sensors convert code" 2022-01-21 17:53:34 +00:00
Arthur Ishiguro
d97a3c3cd8 Relax assertion criteria in HIDL sensors convert code
Because this code may be used to translate from/between subsequent
sensor types (e.g. new AIDL sensor types), relax the assertion
criteria to allow this generic conversion.

Bug: 215702376
Test: Compile
Change-Id: I40b67aa91d5e0d35199b561d32b2d7f7d59a4ac4
2022-01-21 16:12:04 +00:00
Eva Chen
a81deb0fbe Add TYPE_HEADING sensor type definitions.
Bug: 189983308
Test: Compile + Presubmits
Change-Id: I6ea82097312d84dc0a3f957f936fec152b566bad
2022-01-20 14:21:42 -08:00
Eva Chen
4a05294ae4 Add limited axes imu sensor type definitions.
Includes changes for the following sensors:
- ACCELEROMETER_LIMITED_AXES
- GYROSCOPE_LIMITED_AXES
- ACCELEROMETER_LIMITED_AXES_UNCALIBRATED
- GYROSCOPE_LIMITED_AXES_UNCALIBRATED

These new sensor types will help support varying sensor configurations
for automotive devices.

Bug: 187342209
Test: Compile only. Will be validated with other CLs.
Change-Id: I3f01eb74c26ab58c051a58c4b5f1dfd90d7e853c
2022-01-18 22:01:01 -08:00
Greg Kaiser
5cb52553df Fix copy() using iterators from different containers
We fix up a std::copy that was using the wrong container for
the end().

Test: TreeHugger
Bug: 206867060
Change-Id: I5b7700029db6a513b6fdf03c3449be973d639df5
2022-01-18 15:00:30 -08:00
TreeHugger Robot
d248c6d6fd Merge "Moved implementation of ConvertUtils to cpp file." 2022-01-14 20:09:45 +00:00