Commit graph

718 commits

Author SHA1 Message Date
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
d8defc5d14 Merge "Revert "sensors: adding a common convert lib"" am: df0bf96001 am: 11b7a8c73f am: 73e349fb15
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2321957

Change-Id: I3ca09ef208152d3ec5624afb2c0d54a76cecb721
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-30 10:31:20 +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
e21316aa06 Merge "sensors: adding a common convert lib" am: 7b571f974e am: aaf2c58c6d am: fbe3168d82
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2313739

Change-Id: I8b613ccb835b2bad8cca6bb62d45a8f3311786a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-29 23:02:06 +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
ab55b8a8d2 Merge "Make sensors convert library host_supported" am: 6a58599217 am: 9e39f2f17b am: f339add894
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2306947

Change-Id: I2468ec4a1d3abb3da425d9cbb26d0511c09b12bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 17:34:10 +00:00
Devin Moore
6a58599217 Merge "Make sensors convert library host_supported" 2022-11-22 17:37:49 +00:00
Karthik Bharadwaj
97258c512f Merge "Default accel Z direction value to +9.8" am: 34557d4596 am: 72239c642e am: 92cbbeabd7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2310345

Change-Id: Ie14cc774a21dd1c79e4852bf73ed10aa07d8baa8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-21 23:33:15 +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
6367f85c58 Merge changes from topics "sensor_conver", "sensorservice_aidl" am: 3259213a9e am: fd2903c283 am: 87fd3220be
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2298582

Change-Id: Ic0e758d7b0cac7d010cbce7130f6138a03ade4eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 20:11:44 +00:00
Devin Moore
378dd165a1 Add host_supported to sensors AIDL interface am: 9ef0c60a25 am: f52079e9f4 am: 43e16a4205
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2292599

Change-Id: If021993d03032c04b61d148bbeeb13a8166dd8ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 20:11:36 +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
Treehugger Robot
c4aae36c8c Merge "Use EXPECT_LE instead of EXPECT_LT for some iio sensors that do not support runtime suspend." am: 105ac0f1ae am: 97f136591c am: 2d7e24ed2d am: a4ba8ecef1 am: 6171253db8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2213140

Change-Id: I5ae434a0d2c17f8a909373c5f9c8af34b8c50172
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-13 05:11:27 +00: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
Sally Qi
0435c6b4f3 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
2022-09-01 13:28:00 -07:00
Sally Qi
784c253a05 Add cc_defaults as wrapper for graphics composer/common AIDL
interfaces.

- Add new Android.bp in graphics folder and wrap composer and common
  AIDL in to separate cc_defaults.
- remove composer3 dependency from allocator's VTS .bp file.

Bug: 243429120
Test: builds
Change-Id: Ia91e4ab87b7ac86248094317185b317d5604e654
2022-08-26 15:18:42 -07: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
Arthur Ishiguro
8492dab99d 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
2022-08-04 16:27:10 +00:00
Arthur Ishiguro
31acf98d49 Add group 'input' to AIDL sensors multi-HAL
Fixes: 238211395
Change-Id: I046e4491348b10681a660d62c143a652df0f66b4
Test: Compile
2022-07-07 00:04:50 +00:00
Alexander Koskovich
0338168581 interfaces: sensors: Add group 'input' to 2.[0-1] multihals am: 9abc8e213f am: 0266615a44 am: b464656efe am: 273b5b6a59 am: d39d29be27
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2146560

Change-Id: I826f562036a706f3a6ee157fe6756855dfa7b922
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 21:26:31 +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
TreeHugger Robot
20a62be9c1 Merge "Remove AIDL-libs from VNDK" 2022-06-14 03:13:27 +00:00
Arthur Ishiguro
5d301a1c45 Adds missing AIDL HAL SensorStatus conversion logic am: 6b48d121d9 am: 8f44b69c39 am: e39fd50fde am: 2c4b7216e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18871136

Change-Id: Ied765b893216c872a6789c0d812704f28efaa6b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 18:49:18 +00: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
TreeHugger Robot
5ac76f2d3b Merge "Support AIDL IAllocator for direct channel tests" into tm-dev am: f828bd264c am: a5857d9f95
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18823396

Change-Id: I514cea33b9e7e739b72008d361981456ab1fffc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 16:56:21 +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
Jooyung Han
5527adfd7f 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
Change-Id: If999df9c78a20df931177da11742b1c5de19bc08
2022-06-02 17:43:19 +09:00
Daniel Norman
80e55dabf3 Fixes sensors AIDL default impl APEX's binary name.
commit bde01c60fa
moved this APEX from the HIDL to AIDL impl, but accidentally
left out the rename of the binary in the file_contexts

Also deletes unused .rc file here; the APEX already reuses the
.rc file from outside the APEX dir.

Bug: 222579208
Test: Build cf_x86_64_phone using sensors APEX: http://ab/P33964358
      Boot the device, use accel sensor to rotate the screen.
Change-Id: Ib107770312bb80b67364c855efd2df3a9bc52b9a
2022-04-28 22:37: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
acd9782b5a Fix sub-HAL handle in dynamic sensor meta events am: 280fd70dc4 am: f36e358316 am: b0625b0c96 am: 916352ec6b am: 48dbbd8341
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2064302

Change-Id: Ief36440f820dcbbacad1dcbaf037a9de5381311f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 04:38:28 +00:00
Brian Duddie
b0625b0c96 Fix sub-HAL handle in dynamic sensor meta events am: 280fd70dc4 am: f36e358316
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2064302

Change-Id: I3163ef73f89393ab0d2e60849d6ad551b9246cbb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-27 02:52:32 +00: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
Deyao Ren
fb69c3e2af Merge "Cuttlefish sensors apex uses aidl implementation" 2022-04-20 20:17:13 +00:00
deyaoren@google.com
bde01c60fa Cuttlefish sensors apex uses aidl implementation
Bug: 210883464
Test: atest hal_implementation VtsAidlHalSensorsTargetTest
Tests run on abtd:
https://android-build.googleplex.com/builds/abtd/run/L63300000953949688
https://android-build.googleplex.com/builds/abtd/run/L18600000953935211
One test is failing on tip of tree
Change-Id: Iec27e916c94e5a327fc6c4d87451e055b14d9660
2022-04-18 20:25:44 +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
TreeHugger Robot
0677c4205b Merge "VtsAidlHalSensorsTargetTest: Fix assignment" 2022-01-14 18:57:26 +00:00
Tyler Trephan
bd838b8b5e Moved implementation of ConvertUtils to cpp file.
Test: make android.hardware.sensors@aidl-multihal
Bug: 206867060
Change-Id: I73e8d061bdfe39f956acda1cf9b138da2dcc1f22
2022-01-14 18:47:19 +00:00
Greg Kaiser
aae30614d6 VtsAidlHalSensorsTargetTest: Fix assignment
To make this assignment have an impact outside the function, we
need to assign to the dereference of the pointer.

Test: TreeHugger
Bug: 195593357
Change-Id: I3541735574d6ebe2f2620c2bc5fbf5dd7d97cd91
2022-01-14 07:54:49 -08:00
Bob Badour
154fbf1519 [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  sensors/aidl/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I6597543c2398a639c850f72bfe7013e9df2a2358
2022-01-13 16:50:17 -08:00
Tyler Trephan
5b6c2834d4 Merge "Updated multihal to use new sensors AIDL interface." 2022-01-13 20:36:58 +00:00
Grace Cheng
012f4e7d65 Merge "Implements AIDL VTS direct channel tests" 2022-01-12 22:24:22 +00:00
Grace Cheng
629b3a4cf2 Implements AIDL VTS direct channel tests
Bug: 195593357
Test: Compile, run tests

Change-Id: I3e78050fc28c9a0d20cd18788a357bc9b82f2ced
2022-01-12 07:56:27 +00:00
Brian Duddie
d72ba14c90 Add HEAD_TRACKER sensor type definition
This new sensor type supports tracking the orientation and rate of
rotation of a user's head, which can be useful for features such as
spatial audio.

Bug: 210156629
Test: compile only; to be validated in later CLs
Change-Id: I861be09d14e208fb992b23554b6c0733e4163f0c
2022-01-12 02:11:49 +00:00
Tyler Trephan
17857cc469 Updated multihal to use new sensors AIDL interface.
Test: make android.hardware.sensors@aidl-multihal
Fix: 206867060
Change-Id: I9b78a0f25117d11fdf4beb1e0913393c1c14620d
2022-01-11 21:09:17 +00:00
Grace Cheng
bc2a1b7321 Adds sensors aidl default (cuttlefish) implementation
Bug: 195593357
Test: Verify VTS AIDL sensors tests pass

Change-Id: I12f09adfb0d81c8c15e2c18c836f03cbd9d82daf
2021-12-30 22:02:22 +00:00
Arthur Ishiguro
c7ac0b2a17 Adds sensors HAL AIDL interface
Bug: 195593357
Test: Compile
Change-Id: I6c63a6ba2dc3fbe5b25f401728d0724df2620bef
2021-12-23 23:46:59 +00:00
Arthur Ishiguro
b0b47e318a Add conversion code for sensor_t to v2.1 SensorInfo
Bug: 195593357
Test: Compile
Change-Id: I0c7239b23896c44f7835430bad7e45f1dbde87ed
2021-11-16 00:20:35 +00:00
Arthur Ishiguro
d3c693e6b4 Refactor collectEvent method in SensorsHidlTestBase
Bug: 195593357
Test: Compile, run VTS
Change-Id: Ie4db0bfd88841ce2821ed664053e27ab18262a56
2021-11-10 18:53:54 +00:00
TreeHugger Robot
e51ea5f40c Merge "Rename SensorsHidlEnvironmentBase to SensorsVtsEnvironmentBase" 2021-11-09 18:24:21 +00:00
Arthur Ishiguro
7040ab262a Rename SensorsHidlEnvironmentBase to SensorsVtsEnvironmentBase
Can be used by new AIDL VTS tests.

Bug: 195593357
Test: Compile
Change-Id: Iaa279b4dd65da06042de8c560ae2a98b32771659
2021-11-09 17:21:56 +00:00
Yiming Pan
0f7f2cc6b4 Update OWNERS for VtsHalSensors tests.
Added a bug component where issues seen on this test are triaged. This
will affect the following tests:

VtsHalSensorsV1_0TargetTest
VtsHalSensorsV2_0TargetTest
VtsHalSensorsV2_1TargetTest

Test: Tree Hugger
Bug: 143903671
Change-Id: I60f3607619bc53f2f4a78692e6835e68cffba8af
2021-10-19 16:33:52 +00:00
Treehugger Robot
c6e82fe78c Merge "Add OWNERS for VTS module VtsHalSensorsV2_0TargetTest" am: 3f295c0a74
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1792999

Change-Id: I4de3006d2c3d6ec32f7a88d9e4e4a45f2af29d30
2021-09-23 00:47:09 +00:00
Yiming Pan
2f5b640243 Add OWNERS for VTS module VtsHalSensorsV2_0TargetTest
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.

Test: Tree Hugger
Bug: 143903671
Change-Id: I918fdb16d05e0dbf5b189eca2f41a9ad1b5b1255
2021-09-22 15:58:49 -07:00
Treehugger Robot
0dbdd53141 Merge "Creates a default com.android.hardware.sensors vendor APEX." am: 6d92ada666
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1817319

Change-Id: I0270e9c91b3167866fd2d2ca75819c7c6bd0e2b3
2021-09-10 22:41:05 +00:00
Daniel Norman
b57b5e0b77 Creates a default com.android.hardware.sensors vendor APEX.
This provides the default android.hardware.sensors@2.1 implementation.

Bug: 198635611
Test: use on Cuttlefish; observe rotation is functional;
      observe dumpsys sensorservice lists the available sensors;
Change-Id: Ic6dd4ba011c4774159609864e4f55d342a16f8e3
2021-09-10 03:35:52 +00:00
Hsin-Yi Chen
6bdfc478cf Merge "Use CLOCK_BOOTTIME for default sensor implementation" am: bd0d99e730
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1817938

Change-Id: Ib02ef91ee0f8e60fcbb3d95a8ad5e1eb0530286e
2021-09-06 03:58:40 +00:00
Hsin-Yi Chen
adac97fa08 Use CLOCK_BOOTTIME for default sensor implementation
The sensor implementation used to generate periodic signals according to
CLOCK_REALTIME. The clock can be adjusted by user or synchronization
service and results in wrong period. This commit changes it to
CLOCK_BOOTTIME which is monotonic.

Test: atest VtsHalSensorsV2_0TargetTest
Test: atest VtsHalSensorsV2_1TargetTest
Test: atest CtsSensorTestCases
Bug: 194030777
Change-Id: Iac39c93d6d2518b1abe8fc07fd695b9bb2cf30a5
2021-09-03 12:07:15 +08:00
Treehugger Robot
555c368ddb Merge "Replace writepid with task_profiles command for cgroup migration" am: a43f14bdac am: 7151796908
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1740279

Change-Id: I8c9ebb5de59a2b8a87c8045cfc8c64b71eac0f10
2021-06-23 23:09:57 +00:00
Suren Baghdasaryan
dd50b2f45d Replace writepid with task_profiles command for cgroup migration
writepid command usage to join a cgroup has been deprecated in favor
of a more flexible approach using task_profiles. This way cgroup path
is not hardcoded and cgroup changes can be easily made. Replace
writepid with task_profiles command to migrate between cgroups.

Bug: 191283136
Test: build and boot
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I249ecc45a001a69d73b06b77154f9b6e5f9964d9
2021-06-23 18:43:27 +00:00
karthik bharadwaj
a5b5c359cb Enforce sensors of the same type having a unique name.
Bug: 179076515
Test: run vts -m VtsHalSensorsV2_0Target
Change-Id: Ibf0d90afdcdce5ee5908dc35f8c392ee06e4b49e
2021-06-17 14:50:01 -07:00
Anthony Stange
57323715d1 Merge "sensors: trivial fixes in comments" am: c75b96410e am: 056a7cd65d am: 51ae67e98e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/572085

Change-Id: Id06b20b5c52bc5e775d747b993071bd7258132aa
2021-05-13 15:39:17 +00:00
Sergii Piatakov
59bb6f9394 sensors: trivial fixes in comments
Fix trivial typos in HAL and VTS comments.

Test: n/a
Change-Id: Ib52d6e1e8e83290cb4b1cf142677b8c772d606e7
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2021-05-12 20:43:21 +00:00
masonwang
92912b6300 Fix VTS BatchingOperation Test.
Change list:
1. Cap minFifoCount to batching period worth of samples.
2. Modify the test period:
From :
batchingPeriodInNs * (0.8 + 0.8) = 1.6 times the batchingPeriodInNs
To
batchingPeriodInNs * (0.8 + 0.2) = batchingPeriodInNs

Bug: 185972775
Test: Verify pass by checking event count if it is closed to the
criteria.

Change-Id: Ied178150788e1a80d6fa6c87afbd1738ade48a0b
2021-05-10 15:49:32 +08:00
Daniel Norman
09dde55f90 Merge "Allows injection for the default HINGE_ANGLE sensor." am: d215599f10 am: 4ece0d712e am: 703d8c64a8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1668408

Change-Id: I6f94a8122cb71fce75bb0dcc4f435ad62ccf359f
2021-04-08 18:14:33 +00:00
Daniel Norman
56645759d3 Allows injection for the default HINGE_ANGLE sensor.
This will allow cuttlefish to inject HINGE_ANGLE sensor data, to
simulate a hinge sensor on the virtual device.

Bug: 181157794
Test: Inject HINGE_ANGLE sensor data.
      Observe events with `dumpsys sensorservice`.
Change-Id: Ie267bcfdbc98ed017a673b9e38ceccbf75090dd1
2021-04-07 16:51:23 -07:00
Anthony Stange
d1a8d70d09 Merge "Don't assert while a callback is registered" am: 6a022ad1c4 am: d5e4905caa am: 8a673bc15e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1654108

Change-Id: If6b5fe800955b602be362f269d6350014e384c6a
2021-03-25 22:00:59 +00:00
Anthony Stange
0b72e2e105 Don't assert while a callback is registered
If an assert fails while a callback is registered and some data
is delivered that attempts to invoke the callback, it'll cause a
segfault since the callback is allocated on a part of the stack
that's no longer valid.

Bug: 183362725
Change-Id: I3a1f8fbf15c24e344fde8e5b44bb93681ef47d38
Test: Run VTS
2021-03-25 16:36:10 +00:00