Commit graph

109 commits

Author SHA1 Message Date
Andy Hung
f4871891b2 Merge "HidRawDeviceTest: Enable for device build" am: 698fe8448b
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2404797

Change-Id: Ie2968a66d2f4961ffd8462874710f7eb37dd99ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-06 21:01:17 +00:00
Andy Hung
b264eb4bd3 HidRawDeviceTest: Enable for device build
Test: $ adb shell hidrawdevice_test /dev/hidraw0
Bug: 265754293
Change-Id: I103ebc030f012d11e977fc155fc68f884f71f518
2023-01-27 11:42:20 -08:00
Christopher Ferris
de12b9273e Merge "Modify a data structure into a union." am: 8e965d90de am: 9d6b418d6f
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2243423

Change-Id: Id3bbeac041d086619e7313286e144ea2b7c1a931
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 02:30:27 +00:00
Brian Duddie
2e6815d22a Increase dynamic sensor op timeout to 1.6 sec am: 9a056455f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/libhardware/+/20333186

Change-Id: Ie65bd144da9d4fc20fc3ea799dc148419fda0484
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-02 10:02:52 +00:00
Brian Duddie
9a056455f2 Increase dynamic sensor op timeout to 1.6 sec
Minimizes intermittent failures when a device is in sniff mode.

Fixes: 245881714
Test: enable/disable with spatial audio feature enabled
Change-Id: I5fb5b9ff37a6f8a245678c87ee82e2032dc845f2
2022-10-31 23:15:15 +00:00
Christopher Ferris
8b0619b47d Modify a data structure into a union.
The new 6.0 kernel headers changed all variable length
structures from [0] to []. This causes a clang warning to
trigger, so rewrite the affected data structure using a
union to avoid having a variable sized array in the middle
of the structure.

Test: Builds.
Change-Id: I60c6d31a93566c4aa9f7501f39f88543ee76ce91
2022-10-13 12:39:44 -07:00
Manish Kushwaha
d4085b7193 [dynamic_sensor] correctly interpret HID data
specifically, interpret HID data value as unsigned if minValue is
positive

Fix: 238391386
Test: See "Testing Done" in comments in ag/19889364
Change-Id: I715c2189ad90ee71e022ae131354354157694556
2022-09-09 16:50:00 +00:00
Brian Duddie
f4def6edb5 Clarify and clean up dynamic_sensor documentation
Test: n/a
Change-Id: I0b0226b1fce940bd37b8d8a1f72123948ff1fe0a
2022-08-24 23:21:45 +00:00
Erik Staats
3493565708 Add /dev permissions to dynamic sensor README.md .
Bug: 228879057
Test: Verified in gitiles.
Change-Id: If82a5bf302cb68a2c5b486006e4679fbfc8ee545
2022-04-20 11:16:52 -07:00
Erik Staats
fdb42f78cd dynamic_sensor: Fix HID min/max sample rate computation.
Bug: 228369656
Test: Used uhid-sample to add a dynamic sensor and verified correct
 min/max sample rate.
Change-Id: I88a1bec26a03a97ee7a3c590d2601151b89ee545
2022-04-06 15:30:02 -07:00
Erik Staats
9b8bc0f7c1 dynamic_sensor: Support timing out sensor operations.
Bug: 226012902
Test: Used uhid-sample to add a dynamic sensor and verified it can be
 sampled.
Test: Simulated start sampling ioctl timeout and verified operation
 completes with a timeout and eventually cleans up.
Test: Simulated start sampling ioctl timeout with device removal before
 completion and verified operation completes with a timeout and
 eventually cleans up.
Change-Id: I9a957bc1e4000b2c587278146ecbe6e903010616
2022-04-06 12:42:06 +00:00
Brian Duddie
b9769d799c Change dynamic sensors handle base to 1
Fixes: 227766975
Test: load on device, confirm handle number changed
Change-Id: I0466784d7e468bd785f2525f1ab7cd02cc5436e8
2022-04-01 17:22:31 +00:00
Erik Staats
cbcdc02ef4 dynamic_sensor: Support Android head tracker sensor type.
Bug: 189507742
Test: Verified head tracker sensor type and sampling.
Test: Verified custom Android sensor sampling.
Change-Id: Id403de916111ed737b9cebebe9850d5e5845cf56
2022-01-27 20:10:57 +00:00
Zhaoming Yin
c76c1d5799 Fix opendir NULL dirp return issue
Bug: 206035991
Test: use forrest to run boottest

Change-Id: I9e77b7d6184a0ee132b8f058f7f83302c54bcb4a
2022-01-16 08:13:00 -08:00
Erik Staats
8262a62fb2 dynamic_sensor: Use HID unique ID for head tracker UUID.
Also, don't require 16-bit strings for HID name, manufacturer, and
unique ID. Also change dump of HID unique ID to be in hex.

Bug: 213483369
Test: Verified that the standard Android head tracker sensor uses the
 HID unique ID for the sensor UUID.
Test: Verified that custom Android sensors use a fabricated UUID.
Change-Id: I125f84187868543dccab758e22dce744c013578e
2022-01-06 12:28:06 -08:00
Erik Staats
75fb5d739e Add dynamic sensor README.md.
Bug: 207008609
Test: Verified in gitiles.
Change-Id: I7bb8575aef0a8764390a6dc8f4ca785f49a1eb61
2021-12-16 20:09:59 +00:00
Erik Staats
4b4cb8dab3 dynamic_sensor: Fix report item offset calculation.
Bug: 207008609
Test: Verified dynamic sensor sampling with proposed standard Android
 head tracker.
Change-Id: I163b79c2c99f02961adebcb5dcb7e39603944e24
2021-12-10 12:20:22 -08:00
Erik Staats
dbf2545214 dynamic_sensor: Support recognizing head tracker sensor.
Bug: 207008609
Test: Verified dynamic sensor sampling with proposed standard Android
 head tracker.
Test: Verified dynamic sensor sampling with custom Android sensor.
Change-Id: Ia9b991d4a8f7de132cb8509bcc84c51f62e56b31
2021-12-02 15:48:00 -08:00
Erik Staats
4cb45aba7f dynamic_sensor: Support non-8-bit sized HID report items.
Bug: 207008609
Test: Verified dynamic sensor sampling.
Test: Verified unit tests pass.
Change-Id: I797ccabadefa0dde59fd0f3e8541f9853d657f3f
2021-12-01 14:45:36 -08:00
Erik Staats
f99f73ceeb dynamic_sensor: Support report and power usage collections.
Bug: 207008609
Test: Verified dynamic sensor sampling.
Change-Id: If0bef3647d5c52f9bf1d92a2a0ead72e98c70b8c
2021-11-22 10:56:57 -08:00
Erik Staats
24ead9d84a dynamic_sensor: Don't hold mgr lock when operating sensor.
Bug: 205041452
Test: Verified that multiple subscriptions can be made with sensor_test
 to a dynamic sensor without hanging.
Change-Id: Ie7671df8294bee04a0ebe1940242c2a83105f897
2021-11-03 15:32:49 -07:00
Erik Staats
35964ba076 dynamic_sensor: Add multi-HAL 2.1 flush support.
Bug: 201730055
Test: Verified that flush, batch, and activate sensor VTS tests pass.
Change-Id: I6721d9f8976b3ef9f6af02b2320833025b479ee6
2021-10-04 15:17:32 -07:00
Erik Staats
43bc7bccdc dynamic_sensor: Add multi-HAL 2.1 sampling support.
Bug: 195964858
Test: Paired a Sony PS4 controller and verified it can be sampled as an
 accelerometer. The first subscription always returns all 0's, but
 subsequent subscriptions return proper accel samples.
Change-Id: I4bbc4695c988f600a62502f9fccabaa68f42c72b
2021-09-30 06:50:43 -07:00
Erik Staats
7b29add5f7 dynamic_sensor: Notify multi-HAL 2.1 of connected sensors.
Bug: 195964858
Test: Paired a Sony PS4 controller and verified it is present in sensor
 list as an accelerometer. It can't be sampled, but the LSM6DSR
 accelerometer may still be sampled.
Change-Id: I182291cebdf84e5f6cd44d16debd6a07c4bc5281
2021-09-29 10:07:03 -07:00
Erik Staats
3c7a12d8f1 dynamic_sensor: Add sensor manager init to sub-HAL 2.1.
Bug: 195964858
Test: Verified dynamic sensor manager is present in sensor list and that
 no SELinux violations occur on sc-v2-dev and master.

$ make -j28 && \
         vendor/google/tools/flashall -w -s 14281FDEE000A5 --disable_verity && \
         sleep 90 && adb root
.
.
.
$ adb shell sensor_test list | grep "sensor_test\|Type\|Dynamic"
sensor_test version 74
Type     Subtype  Name
32       0        Dynamic Sensor Manager
$ adb logcat -d | grep avc | grep sensor
$

Change-Id: Ib3da287e4f4118ad6b19498248e263f8c1662b3a
2021-09-24 06:16:51 -07:00
Erik Staats
1d509cf815 Revert "dynamic_sensor: Add sensor manager init to sub-HAL 2.1."
Revert submission 15874906-bug_195964858.2

Reason for revert: b/200815351
Reverted Changes:
I76a60f7fb:Allow the sensor HAL to access dynamic sensor prop...
I5d587dc46:dynamic_sensor: Add sensor manager init to sub-HAL...

Change-Id: I26b95614bb276e5c2a686de78d73ab48767176a3
2021-09-22 17:53:58 +00:00
Erik Staats
c7038f8a78 dynamic_sensor: Add sensor manager init to sub-HAL 2.1.
Bug: 195964858
Test: Verified dynamic sensor manager is present in sensor list and that
 no SELinux violations occur.
Test: See details in testing done comment in
 https://googleplex-android-review.git.corp.google.com/15874906 .
Change-Id: I5d587dc46bdec66c3162bf222d36b285b8d2ca3d
2021-09-20 16:58:27 -07:00
Erik Staats
3482ca5bf7 Revert "dynamic_sensor: Add sensor manager init to sub-HAL 2.1."
This reverts commit 28b58c62b5.

Reason for revert: 200210164

Change-Id: I6be2c972a29ec7943dbdf450ef3e491065b011a6
2021-09-16 22:58:51 +00:00
Erik Staats
28b58c62b5 dynamic_sensor: Add sensor manager init to sub-HAL 2.1.
Bug: 195964858
Test: Verified dynamic sensor manager is present in sensor list.
Test: Test: See details in testing done comment in
 https://googleplex-android-review.git.corp.google.com/15831086 .
Change-Id: Ia34596d79f8a6c6985b35dcae75126e456f6009e
2021-09-15 13:48:11 -07:00
Erik Staats
2ac7393bd8 dynamic_sensor: Add stubbed sensor multi-HAL 2.1 support.
Bug: 195964858
Test: Verified the dynamic sensor sub-HAL initializes and non-dynamic
 sensors can sample.
Test: See details in testing done comment in
 https://googleplex-android-review.git.corp.google.com/15806307 .
Change-Id: I59934814cc61c7319731eb840ff2132a8c5ce241
2021-09-13 15:03:51 -07:00
Bob Badour
d7984ccf02 [LSC] Add LOCAL_LICENSE_KINDS to hardware/libhardware
Added SPDX-license-identifier-Apache-2.0 to:
  modules/audio/Android.bp
  modules/audio_remote_submix/Android.bp
  modules/audio_remote_submix/tests/Android.bp
  modules/camera/3_0/Android.bp
  modules/consumerir/Android.bp
  modules/fingerprint/Android.bp
  modules/gralloc/Android.mk
  modules/hwcomposer/Android.bp
  modules/input/evdev/Android.bp
  modules/local_time/Android.bp
  modules/nfc-nci/Android.bp
  modules/nfc/Android.bp
  modules/power/Android.bp
  modules/radio/Android.bp
  modules/sensors/Android.bp
  modules/sensors/Android.mk
  modules/sensors/dynamic_sensor/Android.bp
  modules/sensors/dynamic_sensor/HidUtils/Android.bp
  modules/soundtrigger/Android.bp
  modules/thermal/Android.bp
  modules/tv_input/Android.bp
  modules/usbaudio/Android.bp
  modules/usbcamera/Android.bp
  modules/vibrator/Android.bp
  modules/vr/Android.bp
  tests/camera3/Android.bp
  tests/fingerprint/Android.bp
  tests/hardware/Android.bp
  tests/hwc/Android.bp
  tests/input/evdev/Android.bp
  tests/nusensors/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  Android.bp
  modules/camera/3_4/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I28924363e6c478f5d0b465b63534c4efd041c770
2021-02-12 20:51:13 -08:00
Nick Desaulniers
79149a378b libhardware: fix -Wreorder-init-list
C++20 is stricter about member ordering in designated initializers than
C99.

Bug: 139945549
Test: mm
Change-Id: I045da46821280e720286a25a0c96b5750d1ad05e
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-11 14:41:57 -08:00
Colin Cross
377856d1be Fix accidental implicit fallthroughs
-Wimplicit-fallthrough was printing warnings for these, they look
like real errors.  Fix them and re-enable the error.

Test: treehugger
Change-Id: I818e18a995760f17b85b4c72ee577e531fa2a601
2019-11-01 16:37:17 -07:00
TreeHugger Robot
5cfe24991e Merge "Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master" into stage-aosp-master 2019-09-11 20:31:31 +00:00
Brian Duddie
71a921d828 Update sensors OWNERS
Test: n/a
Change-Id: Idbf1b969ab4372c0aeb37bff3066c391c69e64a5
2019-09-09 15:01:59 -07:00
Vineeta Srivastava
bc5b610f7b Strip sensors HAL module.
Bug: 134685292
Test: verified on a device that the library size reduces.
Change-Id: Ic22948a050f59b6ec0ae38dd89184f531d8b5c01
2019-06-12 08:34:24 -07:00
Sasha Smundak
b41d1a0a74 Explicitly include log/log.h instead of cutils/log.h
Eliminates the warning.
Test: treehugger

Change-Id: I567d8fea169e688165ede1fb35d1338c565e3645
2019-01-31 17:18:27 -08:00
Chih-Hung Hsieh
3d68176cfd Fix cert-dcl16-c clang-tidy warnings
Bug: 120614316
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,cert-dcl16-c
Change-Id: I744040edc476bf2bb58413a2a14965c27113a5bd
2018-12-12 22:23:40 +00:00
Brian Duddie
7b007c989f Add bstack to sensors OWNERS file
Test: n/a
Change-Id: I25ae89abe1dfe1552e92cccf0354a269959c0c13
2018-11-30 13:33:20 -08:00
Chih-Hung Hsieh
f91bd7232d Allow implicit-fallthrough warnings locally.
It will be a global error by default.

Test: make checkbuild
Bug: 112564944
Change-Id: Ifdcaca758036cf9624f79befb65a1cbbd2f9b010
Exempt-From-Owner-Approval: do not block on new warnings
2018-10-19 15:26:45 -07:00
Ashutosh Joshi
797ae998eb Update OWNERS
Update OWNERS to new stewards.

Test: Build compiles.
Change-Id: I98f9f58bce6b3686f3ff67f28f3e8d2f2ddf0a88
2018-03-06 03:46:20 +00:00
Dan Willemsen
86e247ae89 Convert to Android.bp
See build/soong/README.md for more information

Test: mmma hardware/libhardware
Change-Id: Ibb7e2af9d55f581e951d8996cea5e52cd0766b04
2017-12-27 11:05:29 -08:00
Chih-Hung Hsieh
66f312b91c Merge "Use -Werror in hardware/libhardware/modules"
am: 298fc4f6f5

Change-Id: I3c23dc4ce4609ec27402cae52b71ef79067c8e73
2017-12-06 18:42:24 +00:00
Chih-Hung Hsieh
1f601b1d7d Use -Werror in hardware/libhardware/modules
* Remove unused local variables.
* Remove or comment out unused static functions.
* Fix trivial bugs found by unused value warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I99389b883c89551850180d25241a35a40bb77b26
2017-12-01 10:37:19 -08:00
Xin Li
1d4b3d5f8f Merge commit '61f704a28f9d984eef9ee645a6e4e761130a5609' into HEAD
Change-Id: I7d27a79c89740aa041c42e1396e8bfc89bc1d4f4
2017-11-13 14:35:39 -08:00
Steven Moreland
210aed90a0 Remove use of PRODUCT_FULL_TREBLE from sensors.
This section of code uses PRODUCT_FULL_TREBLE, but
what PRODUCT_FULL_TREBLE means is too fuzzy, and
it is being broken up into multiple flags.

Also, this is an unnecessary restriction (HALs can
be implemented anyway people want).

Fixes: 67975863
Test: multiproduct_kati
Change-Id: I0de36d1ee23052c1fadcdf9a8b1ce85781dd88a0
2017-11-09 12:23:53 -08:00
Chih-hung Hsieh
6ac9ba500b Merge "Use -Werror in hardware/libhardware" am: d1a2b9f7c1 am: d67dcc5fc8
am: e142c94113

Change-Id: I03daa2046b0454ab9beb3c72585f76afe485fc96
2017-10-12 01:58:44 +00:00
Chih-Hung Hsieh
235942389f Use -Werror in hardware/libhardware
* Remove unused local variables and function.
* Fix unused return value warning.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I269eca76cda2222c7a0176e85e92df0bb0924a0e
2017-10-04 11:09:30 -07:00
Peng Xu
daef5973d4 Proposing ownership for modules/sensors am: eabdd92f5b am: 1d8d7ca653
am: 0b9a9ec203

Change-Id: I627305f40d136d66395ed7754b1c70eaf285fd00
2017-09-26 12:11:23 +00:00
Peng Xu
1d8d7ca653 Proposing ownership for modules/sensors
am: eabdd92f5b

Change-Id: I27405024bbdc9b2a6f34aba0c74a91729068feb8
2017-09-25 23:04:40 +00:00