Commit graph

457 commits

Author SHA1 Message Date
TreeHugger Robot
e5f735df7d Merge changes from topic "multihal_2_1" into rvc-dev am: 89b216690c
Change-Id: I3d5bc424d10777f37fb66b6023f4d822afcfea7a
2020-04-29 21:03:43 +00:00
TreeHugger Robot
32d96a1852 Merge "Remove non-test ScopedWakelock dependency" into rvc-dev am: 24087f1219
Change-Id: I9f5da262411ec143ba3da9da0e5734d96dfa53b9
2020-04-29 21:02:58 +00:00
TreeHugger Robot
89b216690c Merge changes from topic "multihal_2_1" into rvc-dev
* changes:
  Update tests for multihal to test HAL 2.1
  Create Multi-HAL 2.1 service
  Set up Multi-HAL for Sensors HAL 2.1
2020-04-29 20:56:30 +00:00
Anthony Stange
67888489ce Update tests for multihal to test HAL 2.1
Updates tests and fake subhals to support Multi-HAL 2.1 to make
on-device testing feasible.

Bug: 149758467
Test: Verify that the new unit tests and subhals in this topic load and
run on a Pixel device

Change-Id: I2be51568ba8dd99aa0588b8945d3d41bda7d9941
2020-04-29 11:25:26 -04:00
Stan Rokita
99a9a529ba Remove non-test ScopedWakelock dependency
Unit tests were depending on a non test library unecesarrily and it was
causing unit test build failure.

Fixes: 155239061
Test: atest android.hardware.sensors@2.0-halproxy-unit-tests
Change-Id: I057a432fdbef93680a67558c27ed7adc7fedfbbc
2020-04-28 18:31:46 -07:00
Anthony Stange
82f8d46691 Create Multi-HAL 2.1 service
Bug: 149758467
Test: Verify that the new unit tests and subhals in this topic load and
run on a Pixel device

Change-Id: Id5ab7b606f91764a456d8e3a16f7f0f2cf9b4fef
2020-04-28 17:49:02 -04:00
Anthony Stange
bc20e5c2a3 Set up Multi-HAL for Sensors HAL 2.1
Bug: 149758467
Test: Load onto device and verify VTS passes
Test: Verify new fake subhals load properly and that unit tests pass
that have been updated in this topic

Change-Id: Icefae8c1261b29d704beedd51de5b3f53b374cc4
2020-04-28 17:48:59 -04:00
TreeHugger Robot
c57ee9e0a5 Merge "Add the missing unregisterCallback call" into rvc-dev am: eac1cdbba9
Change-Id: Ib273274fbd4e400ce14450da445e62487413f2c2
2020-04-15 19:22:12 +00:00
Roman Kiryanov
279a5ae37e Add the missing unregisterCallback call
The sensor reading thread continues producing
event and refers to the already destroyed
callback object which causes a crash in
SensorsHidlEnvironmentBase::addEvent.

Bug: 153754380
Test: atest VtsHalSensorsV2_0TargetTest
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Id7fb72c42dc67f89ceef93d937241e1584b853e7
2020-04-15 10:34:11 -07:00
TreeHugger Robot
14725a36aa Merge "Don't modify -1 sensorHandle value" into rvc-dev am: 2adce34722
Change-Id: I7c346a31648c7f9d3aabd0d4a4c54ef174d84986
2020-04-09 17:39:12 +00:00
TreeHugger Robot
2adce34722 Merge "Don't modify -1 sensorHandle value" into rvc-dev 2020-04-09 17:14:38 +00:00
Anthony Stange
cd4d9abdcc Don't modify -1 sensorHandle value
A -1 sensorHandle value is used to denote all active sensors should be
stopped for a given channel. Make sure the multi-HAL code doesn't modify
handles of this value or it'll corrupt them before passing to the direct
channel sub-HAL.

Bug: 153413565
Test: atest VtsHalSensorsV2_0Target
Change-Id: I3fe9cbf4661aa3db4ff534765d5112a193b7bf4a
2020-04-09 11:07:56 -04:00
TreeHugger Robot
db79614a58 Merge "Adds context_hub group to sensors HAL" into rvc-dev am: ee01c9ec22
Change-Id: I4bc3a5aefe6eb65aca35ea62ed17fa7042f2b0ee
2020-04-09 12:10:21 +00:00
TreeHugger Robot
ee01c9ec22 Merge "Adds context_hub group to sensors HAL" into rvc-dev 2020-04-09 11:55:15 +00:00
Dan Shi
aad51fa000 Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 16:37:40 -07:00
Rick Chen
cdc9be8c7d Adds context_hub group to sensors HAL
Bug: 152005392
Bug: 152727489
Test: Compile pass. Verify sensor function.
Signed-off-by: Rick Chen <rickctchen@google.com>
Change-Id: Ifd7b9239a732619307bbb2e99d37791915fe7dc1
2020-04-07 22:51:13 +08:00
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