Commit graph

441 commits

Author SHA1 Message Date
Anthony Stange
f1d431f634 Add SubHal header for Sensors HAL 2.1
Bug: 149758467
Test: compile
Change-Id: Id10d20e5d24571572565ac5d968f265ef7d7070f
2020-03-19 18:11:28 -04:00
TreeHugger Robot
d6f4acf514 Merge "Move Multi-HAL 2.0 to the common directory" into rvc-dev 2020-03-05 07:02:59 +00:00
TreeHugger Robot
0dad3a6381 Merge "HalProxy unit test to expose incorrect numEventsOnPendingQueue" into rvc-dev 2020-03-04 21:47:07 +00:00
TreeHugger Robot
89fe74560d Merge "Build HalProxy unit tests with a test library ScopedWakelock" into rvc-dev 2020-03-04 21:43:00 +00:00
Anthony Stange
05d7496e4c Move Multi-HAL 2.0 to the common directory
Sensors Multi-HAL 2.0 will soon have a shared implementation for both
Sensors HAL 2.0 and 2.1 and moving the files to the common directory
first will minimize the diff in upcoming CLs.

Bug: 149758467
Test: compile
Change-Id: I15f84a7aaa302d83d4f4b1ffe357f515e36d6382
2020-03-04 15:09:58 -05:00
Stan Rokita
14499028cf HalProxy unit test to expose incorrect numEventsOnPendingQueue
Bug: 147912609
Test: run unit test
Merged-In: Ia6fe3cafc1c2adb02463c28481bcf4c723551860
Change-Id: Ia6fe3cafc1c2adb02463c28481bcf4c723551860
2020-03-04 14:56:07 -05:00
Stan Rokita
d5d021b380 Build HalProxy unit tests with a test library ScopedWakelock
Unit tests do not currently build because they cannot find the
ScopedWakelock shared object. Make a test library version of
ScopedWakelock for them.

Bug: 147912609
Test: Build and run atest android.hardware.sensors@2.0-halproxy-unit-tests
Merged-In: Ie8d3eb606ccba3825be2c8102b9a7bc6ea033f65
Change-Id: Ie8d3eb606ccba3825be2c8102b9a7bc6ea033f65
2020-03-04 14:55:59 -05:00
Anthony Stange
e969e81bee Fix Sensors HAL 1.0 VTS tests
HAL 1.0 VTS tests need to detach the polling thread or it will never
exit on its own. Additionally, the poll() methods return status needs to
be checked or HIDL will assert and cause the program to crash.

Bug: 150475314
Test: atest VtsHalSensorsV1_0TargetTest VtsHalSensorsV2_0TargetTest
Change-Id: I626b7aa064a1f258c968d1787872b9c67786dede
2020-03-04 18:44:06 +00:00
Anthony Stange
72992c7bea Merge "Move common tests into SensorsV2_0 VTS only" into rvc-dev 2020-03-02 22:45:29 +00:00
Anthony Stange
e49ee681b0 Move common tests into SensorsV2_0 VTS only
Since Sensors HAL 2.1 implementations need to run VTS for both HAL 2.0
and 2.1, move tests that don't differ in logic between the two HAL
implementations to the VTS for 2.0 only to minimize the total run time
for both suites.

Bug: 149927057
Test: atest VtsHalSensorsV2_0Target VtsHalSensorsV2_1Target
Change-Id: I5213cdf05bafb2d4014078a03b22d98b96b7c5ee
2020-03-02 15:25:12 -05:00
Arthur Ishiguro
85c4ad2351 Starts default Context Hub HAL in context_hub group
Also adds group to default sensors HAL.

Bug: 149981913
Test: Compile
Change-Id: Ib9178dd9ad0a92821cfebe82f09e8819b42a42f7
2020-02-25 18:01:37 -08:00
Anthony Stange
aef69c9538 Create separate VTS target for Sensors HAL 2.1
Dependencies don't use cflags set by code that depends on them so the
VTS test for HAL 2.1 wasn't properly pulling the 2.1 interface when
present on the device (it was using the 2.0 interface). Modify the
Android.bp files to define the right flags depending on whether we're
testing HAL 2.0 or 2.1.

Bug: 149759782
Test: atest VtsHalSensorsV2_0TargetTest VtsHalSensorsV2_1TargetTest
Change-Id: I3533b6c244e767a8defe0a44a14025fdeb8eeeba
2020-02-19 12:47:50 -05:00
Anthony Stange
32895908b9 Prep ISensorsWrapper to be used by the framework
Bug: 144139857
Test: Load sensors framework and verify it can receive data
Change-Id: I08bdb23779a1ec716cd99e3bc9ded4371fe9c89a
2020-02-18 17:45:04 -05:00
Anthony Stange
a9a5eb411e Add VTS tests for Sensors HAL 2.1
Bug: 144139857
Test: atest VtsHalSensorsV2_0TargetTest VtsHalSensorsV2_1TargetTest
Change-Id: If2b751929b8d89c9d381032f5e8424a24719b6bd
2020-02-18 17:45:02 -05:00
Anthony Stange
535c63e672 Add Hinge Angle Sensor to default impl for HAL 2.1
Bug: 144139857
Test: Verify this type is exposed when VTS is run
Change-Id: I994f1b4c77729b76760b7cafc19b825c98ca97ca
2020-02-18 15:24:38 -05:00
Anthony Stange
1d71acc129 Add default impl of Sensors HAL 2.1
Create a default implementation of HAL 2.1 that shares 90% of the
underlying code with HAL 2.0 since the interfaces are very similar.

Bug: 144139857
Test: compile
Change-Id: Ic6b139df98ddb1f92833b1f2d65e1cecc297fd41
2020-02-18 15:24:35 -05:00
Anthony Stange
c002dd9eca Create wrapper for 2.0/2.1 sensor HALs
Creates a wrapper that makes a 2.0 sensor HAL appear to look like a 2.1
sensor HAL so that various pieces of code can be shared between the two
implementations.

Bug: 144139857
Test: Run VTS
Change-Id: I4ee4fd2b900e5d4ca744f420f69e150ba38f7949
2020-02-18 13:34:56 -05:00
Anthony Stange
d8cafdbdfd Add Sensors HAL 2.1
Creates Sensors HAL 2.1 to support the addition of a new sensor type for
hinge angle sensors.

Bug: 144139857
Test: mma
Change-Id: Id78fb16324d28f2291b3ad1950197bfd2632d6f4
2020-02-18 13:34:56 -05:00
Automerger Merge Worker
f20dd169e2 Merge "Fix formatting errors in sensors MH2 bp files" am: 30fc7d4ba3 am: 59c1adabc7 am: 217167bf87
Change-Id: I55b5eebb64c27f3559de3badf139f0efdf35e458
2020-02-05 01:08:52 +00:00
Automerger Merge Worker
59c1adabc7 Merge "Fix formatting errors in sensors MH2 bp files" am: 30fc7d4ba3
Change-Id: Idc0c3ec90157f917bca3f1ed5750dde690b0d210
2020-02-05 00:38:34 +00:00
Automerger Merge Worker
14edbe86dd Merge "Remove reference of VtsHalHidlTargetTestBase" am: badb75e309 am: 88b5b44f89 am: 4eaa7205f8
Change-Id: Ie3eb4abb16005f5a8d137ce800dcc8e21e32b5e8
2020-02-05 00:23:34 +00:00
Treehugger Robot
30fc7d4ba3 Merge "Fix formatting errors in sensors MH2 bp files" 2020-02-05 00:23:26 +00:00
Stan Rokita
4820138e21 Fix formatting errors in sensors MH2 bp files
Test: build

Change-Id: Idb00ed68c9805a055bf87560f02605920c4149e5
2020-02-04 16:01:44 -08:00
Automerger Merge Worker
88b5b44f89 Merge "Remove reference of VtsHalHidlTargetTestBase" am: badb75e309
Change-Id: Ia1b74f69ff92f57117e5e9510896b6c4b6730548
2020-02-04 23:54:32 +00:00
Dan Shi
badb75e309 Merge "Remove reference of VtsHalHidlTargetTestBase" 2020-02-04 23:44:04 +00:00
Dan Shi
9910d38aa7 Remove reference of VtsHalHidlTargetTestBase
Bug: 147894326
Test: m -j VtsHalWifiHostapdV1_0TargetTestUtil \
  VtsHalSensorsTargetTestUtils
Change-Id: If11f23db93333ddd702ce5ebf7c5c0b9583c57fa
2020-02-04 03:29:50 +00:00
Automerger Merge Worker
11b3d6ecdf Merge "[Sensors MH2] Keep track of most events seen on pending queue" am: b2e4c01a76 am: ec3f43a767 am: dd2b347ca0
Change-Id: I48beab8e0bb822cc7e97328bd36a76b9d676803c
2020-02-04 00:01:30 +00:00
Automerger Merge Worker
ec3f43a767 Merge "[Sensors MH2] Keep track of most events seen on pending queue" am: b2e4c01a76
Change-Id: I9f5e18c4538d7aea4f6d2f0af0b9a1df67d4df7d
2020-02-03 23:40:07 +00:00
Stan Rokita
e7f293621e [Sensors MH2] Keep track of most events seen on pending queue
Bug: 148243746
Test: Load onto device and run
'adb shell lshal debug android.hardware.sensors@2.0::ISensors/default'
to observe correct output

Change-Id: I8f7d87e86860bbca229051fec35b7048c4b3268b
2020-02-03 13:41:56 -08:00
Automerger Merge Worker
c56cf74d72 Merge "Fix the format specifier in assert log statements" am: ddc10d848a am: 1ffb992d29 am: 7ab599b97c
Change-Id: I2dff3d4a75f8f8f7c6f5ba3074f9324cd6307a3d
2020-01-25 01:15:04 +00:00
Stan Rokita
1ffb992d29 Merge "Fix the format specifier in assert log statements"
am: ddc10d848a

Change-Id: I79f81bbd4c0b4ff22496a0ade4e6cec155965a6a
2020-01-24 16:48:50 -08:00
Treehugger Robot
ddc10d848a Merge "Fix the format specifier in assert log statements" 2020-01-24 23:21:11 +00:00
Stan Rokita
010c36d22d Fix the format specifier in assert log statements
There are two ALOG_ASSERT calls in the HalProxyCallback::postEvents
method that do not have the correct format specifier types. This causes
a build error if you try to build with debug logs.

Test: Build and load onto device
Change-Id: I793b6fcd72dd13b07422af0e292a373a66b2c200
2020-01-21 15:38:36 -08:00
Automerger Merge Worker
e91b85631f Merge "Decrement size of pending write queue by correct amount" am: 79fc8d0212 am: b492ac69b5 am: 0cf13f7ded
Change-Id: I555d97575c9f4780bc4edcd46ba4cad0b2ff64ef
2020-01-17 21:38:00 +00:00
Anthony Stange
b492ac69b5 Merge "Decrement size of pending write queue by correct amount"
am: 79fc8d0212

Change-Id: I4d8f3d5bac10dd7192788cccf47ddcfa6231d7c8
2020-01-17 12:55:11 -08:00
Stan Rokita
bc0b20ad1f Decrement size of pending write queue by correct amount
The pending write events vector is destructed before using its size to
decrement the number of events on the pending write events queue which
may cause the value decrement by 0 instead of the actual number of
events removed.

Bug: 147686560
Test: Build and load onto device with fake subhals
Change-Id: I7b6c6231eacfa89b0dd55bc405b235d34be5ff46
2020-01-15 08:29:17 -08:00
Automerger Merge Worker
467d0220e4 Merge "Convert VtsHalSensorsV*_0TargetTest to be parameterized." am: c81f9c9958 am: 6887dc320d am: 6d3e344091
Change-Id: Icbdcf15a369e4263e622c08c8427ac100c6e1c0c
2019-12-11 00:44:35 +00:00
Automerger Merge Worker
6d3e344091 Merge "Convert VtsHalSensorsV*_0TargetTest to be parameterized." am: c81f9c9958 am: 6887dc320d
Change-Id: I5b2714ffdb54d43634a0a2b361a239d26d26656b
2019-12-11 00:29:56 +00:00
Dan Shi
395288173d Convert VtsHalSensorsV*_0TargetTest to be parameterized.
Bug: 142397658
Test: atest VtsHalSensorsV1_0TargetTest VtsHalSensorsV2_0TargetTest
Change-Id: I76bf0b68abf8c8a1c79afabbc26242e33778bd25
2019-12-09 10:10:44 -08:00
Stan Rokita
655675db00 Make ScopedWakelock a shared library am: 1d53f9563b am: 1e9bac4b58
am: b0af4f5a25

Change-Id: I641b4d611e8b9637f07fda2592d3d078dc82a677
2019-11-25 14:37:40 -08:00
Stan Rokita
b0af4f5a25 Make ScopedWakelock a shared library am: 1d53f9563b
am: 1e9bac4b58

Change-Id: I68ece185c348668aa5da86e6b3802f5db167af0d
2019-11-25 14:34:48 -08:00
Stan Rokita
1d53f9563b Make ScopedWakelock a shared library
Change the build configuration of multihal and its tests to make the
ScopedWakelock.cpp file and its associated headers available as a
library to be included by the fake subhals and the multihal binary
seperately.

Bug: 144722764
Test: Compiled and loaded onto device without issue
Change-Id: Ide83b6761302c5df6c72bc3202727341361b36ed
2019-11-25 12:36:10 -08:00
Stan Rokita
dda3a5c7c4 Merge "Change instance name to default in multihal 2 xml" am: 724b7471e0 am: c3f2745aae
am: eba6d2429a

Change-Id: Ifbbabaee01f39c79f395408c2d29764541ce8e46
2019-11-19 08:30:03 -08:00
Stan Rokita
eba6d2429a Merge "Change instance name to default in multihal 2 xml" am: 724b7471e0
am: c3f2745aae

Change-Id: I2553def9c40ab1494be28b2659685f86a3601ceb
2019-11-19 08:25:58 -08:00
Treehugger Robot
724b7471e0 Merge "Change instance name to default in multihal 2 xml" 2019-11-19 16:15:08 +00:00
Stan Rokita
a1ed22e34f Change instance name to default in multihal 2 xml
Bug: 144722764
Test: N/A
Change-Id: Ic6b4a4f5ccb8df11ac8ed819fd750841373bc11f
2019-11-18 15:09:00 -08:00
Nick Desaulniers
6f4a232928 hardware: interfaces: sensors: fix -Wreorder-init-list
C++20 is stricter about member ordering in designated initializers than
C99.

Bug: 139945549
Test: mm
Change-Id: I22179dfb829c328462c9b31caf543692d3cf57d9
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-12 13:48:58 -08:00
Nick Desaulniers
69871db874 Merge changes I8a7ff4b0,Id121ecd4,I23375d73 am: 944e640e16
am: d770f4c628

Change-Id: Ie2a0a0dad8d32f7eb2a07784bd0f60bf666b61a1
2019-11-06 09:58:31 -08:00
Nick Desaulniers
8cb3c9b326 [hardware][interfaces][sensors] fix -Wreorder-init-list
C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Merged-In: I78d64ea2b7df3f2bd3b8503aa553a0523b20d711
Change-Id: I8a7ff4b025ac693398b79ad5f16687afe3a4c5a9
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-05 14:58:13 -08:00
Nick Desaulniers
890faa2ac5 [hardware][interfaces][sensors] fix -Wreorder-init-list again
C++20 will require members in a designated initializer to be in order
unlike C99.

This snuck in because I haven't upgraded the platform toolchain yet.

Bug: 139945549
Test: mm
Change-Id: Id121ecd46b7e53f5dd7b4a32daae0594d851d0e5
Merged-in: Ica2844a213467e41d9b6a8955f1750692da8b444
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-05 14:55:47 -08:00