Commit graph

379 commits

Author SHA1 Message Date
Dan Shi
95d430d6c8 Use StopServicesSetup to stop/start framework. am: 8a648312f8
Change-Id: I0a3f67e848b2452b1919ae0e26d69fc1a9a9ce15
2020-05-13 18:05:52 +00:00
Dan Shi
8a648312f8 Use StopServicesSetup to stop/start framework.
Bug: 155774142
Test: none
Exempt-From-Owner-Approval: This CL replaces target preparer, shouldn't
change test behavior.

Change-Id: I83cffadfff15e6352a69641c3227efb63e7a34e4
2020-05-12 14:07:30 -07:00
Treehugger Robot
552990ed42 Merge "Rename vts-core to vts" 2020-05-08 01:44:18 +00:00
Dan Shi
fcced28d93 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.

Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
Change-Id: If871035f66631869d1082a557e2639a2766cd1de
2020-05-07 16:25:29 -07:00
Treehugger Robot
1f65d20a39 Merge "sensors:2.0:vts fix functional test for typeAsString field" am: e3fc570d6d
Change-Id: Iec84bed4fe462001a577b382e4934b59b765017b
2020-05-07 16:50:25 +00:00
Treehugger Robot
e3fc570d6d Merge "sensors:2.0:vts fix functional test for typeAsString field" 2020-05-07 16:34:31 +00:00
Stan Rokita
f26ba8c59f Search for subhal .so files in additional directories am: b42bde95cb
Change-Id: I1fb0ce977406e07a26278a2be0e2380ee7d677f4
2020-05-06 23:00:18 +00:00
Stan Rokita
b42bde95cb Search for subhal .so files in additional directories
Fixes: 154634207
Test: Load onto flame and confirm that subhal .so
android.hardware.sensors@2.X-fakesubhal-config3.so loads when it is
living in the /vendor/lib64/hw directory using
adb shell lshal debug android.hardware.sensors@2.0::ISensors/default

Change-Id: I8a676b97f6f6992e8937ecf31c3b7af06e676ebb
Merged-In: I8a676b97f6f6992e8937ecf31c3b7af06e676ebb
2020-05-06 15:02:42 -07:00
Denis Ciocca
8ab752617f sensors:2.0:vts fix functional test for typeAsString field
For sensors of known type defined in SensorType (value <
DEVICE_PRIVATE_BASE), typeAsString field can be an empty string since
framework overrides it anyways.
The empty string test should fails only if type is >=
DEVICE_PRIVATE_BASE.
The matching type with typeAsString test is instead executed only if
the string is not empty (if it's not an empty string let's check that
at least is set to the right value).

Bug: 155514483
Test: atest VtsHalSensorsV2_0TargetTest
Signed-off-by: Denis Ciocca <denis.ciocca@gmail.com>
Merged-In: Ib5f8fd513313670e88c2b973c1ff724658914eb2
Change-Id: I4267ff6a158a571ff43122bdb7a38c9fa38f5900
2020-05-05 16:10:46 +00:00
Denis Ciocca
d3c27ec3f7 Include VtsHalSensorsV2_0TargetTest into the vts test suites
Without adding the test into vts test suite the testcases are not
available within the vts-tradefed.

Test: manual - build vts using 'make vts' with arm64 target selected,
               verifying that the test is then available under:
               out/host/linux-x86/vts/android-vts/testcases/VtsHalSensorsV2_0TargetTest

Signed-off-by: Denis Ciocca <denis.ciocca@gmail.com>
Change-Id: I34a89bef09832e5fa8295340f52dafd91fa33c96
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-23 10:24:43 -07:00
Roman Kiryanov
226761ce9d 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: I3017afe670e5a53d0d7444b3d5b34ba34f3567e3
Merged-In: Id7fb72c42dc67f89ceef93d937241e1584b853e7
2020-04-15 12:12:46 -07:00
Automerger Merge Worker
e1d8fbe4fd Merge "HalProxy unit test to expose incorrect numEventsOnPendingQueue" am: 4ce37f131d
Change-Id: I88f427ba574f7e2349dc20d979ba698b00edc438
2020-02-27 20:53:20 +00:00
Automerger Merge Worker
3e2dc4396a Merge "Build HalProxy unit tests with a test library ScopedWakelock" am: 43e05713c5
Change-Id: I3bb1cc38cc9761b3b0c9f31e3f817b5347c834b6
2020-02-27 20:53:12 +00:00
Stan Rokita
2f4ac1599a HalProxy unit test to expose incorrect numEventsOnPendingQueue
Bug: 147912609
Test: run unit test
Change-Id: Ia6fe3cafc1c2adb02463c28481bcf4c723551860
2020-02-26 15:19:17 -08:00
Stan Rokita
8c51fca223 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.

Test: Build and run atest android.hardware.sensors@2.0-halproxy-unit-tests
Change-Id: Ie8d3eb606ccba3825be2c8102b9a7bc6ea033f65
2020-02-26 10:42:14 -08: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
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
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
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
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
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
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
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
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
Stan Rokita
ac564f2899 Merge "Bound pending write events queue to avoid OOM" am: 6cbd36f357
am: 797b06e220

Change-Id: Ie8121004cc113714e4a9ad6085a551f832fc847a
2019-11-05 01:35:34 -08:00
Stan Rokita
5098f0a9ca Bound pending write events queue to avoid OOM
Bound the pending write events queue to a large amount of events in
total (100,000) so that we do not have out of memory crashes when the
sensors framework locks up. Events are 80B of memory each. So this
change caps are pending writes event queue to 8MB of memory.

Bug: 143302327
Test: atest android.hardware.sensors@2.0-halproxy-unit-tests &&
vts-tradefed run commandAndExit vts --skip-all-system-status-check
--primary-abi-only --skip-preconditions --module VtsHalSensorsV2_0Target

Change-Id: I5d0a7f382e3f61fbbe2c74b5c9cf13560432b84c
2019-11-04 14:33:06 -08:00
Stan Rokita
4950a9dc21 Merge "Add Sensors Multihal support for Hal 2.0" am: 2f27f7137e
am: 2d399b5af0

Change-Id: Iad679b84b91e62c03d8466a98fdff11163317578
2019-10-31 09:09:04 -07:00
Treehugger Robot
2f27f7137e Merge "Add Sensors Multihal support for Hal 2.0" 2019-10-31 15:32:44 +00:00
Stan Rokita
2e37ec4475 Add Sensors Multihal support for Hal 2.0
The multihal framework is a HAL interface for the sensors framework that
allows multiple vendors to package their HAL implementation into a
subHAL dynamic library that will be loaded and used to pass on method
calls to the appropriate subHAL. The HalProxy object, that will act as
the main proxy sensors wrapper for the multiHAL handles writing sensor
events to the event FMQ and wakelock acquisition and releasing via a
callback object it passes to the subHALs.

In order to turn your HAL 2.0 executable into a subHAL to be used by the
multiHAL, implement the Return<Result> initialize(sp<HalProxyCallback>&
callback) method of the ISensorsSubHal derived class. Implement the
ISensorsSubHal* sensorsHalGetSubHal(uint32_t* version)method and have it
return a pointer to your subHAL object. Build this into a dynamic
library and list its filename under /vendor/etc/sensors/hals.conf.

Squashed commits:

07b442e96 (refs/published/mh2_2) MH2 | Write processedEvents instead of
original events.
b38f2e251 Merge "MH2 | Check that subhal index is in range"
d38f99474 Merge "MH2 | Implement debug method of HalProxy"
bf46132fe (refs/published/mh2_4, mh2_4) MH2 | Implement debug method of
HalProxy
1de5bb334 MH2 | Fix wakelock name
e07215347 (refs/published/mh2_3, mh2_3) MH2 | Check that subhal index is
in range
336c1c71e MH2 | Add restart logic in HalProxy::initialize method.
731d7125b MH2 | Change rc file to more appropriate settings
f09465d11 MH2 | Add makeFMQ helpers to HalProxy_test
75cc7bf2f MH2 | Implement wakelock processing thread
e93fdf9a4 MH2 | Implement dynamic sensors callbacks on HalProxy
82b84148c Remove libhwbinder/libhidltransport deps
d45e49b4b Merge "MH2 | Implement pending writes thread"
597142692 MH2 | Implement pending writes thread
db23aa825 MH2 | Implement direct channel and direct report methods
83e4370ae MH2 | Implement injectSensorData method of HalProxy
d0cd57d4c MH2 | Implement ScopeWakelock ctor and dtor
537c0274b MH2 | Add rough proxy callback postEvents method
f97a3f357 Multihal 2.0 - Small tweaks to sensorHandle handling
7a7235461 MultiHal 2.0 - setOperationMode and init direct channel flags
dc7a8e789 MultiHal 2.0 - Get sensors list from subhals
4b4c7b744 MultiHal 2.0 - activate, batch, flush methods of HalProxy
1638531df MultiHal 2.0 - proxying api calls helper methods
aacbf9485 Set up shell to use for unit tests
2879067dd Multihal 2.0 - Implement SubHal discovery
c34e6683b Add a sub-HAL implementation for testing multi-HAL
a689f8a65 Add skeleton for multihal 2.0

Bug: 136511617
Test: atest android.hardware.sensors@2.0-halproxy-unit-tests &&
vts-tradefed run commandAndExit vts --skip-all-system-status-check
--primary-abi-only --skip-preconditions --module VtsHalSensorsV2_0Target

Change-Id: Ibe92d40c92b70848526b0e941bbcffbaf81ffaf2
2019-10-29 11:08:38 -07:00
Brian Duddie
f4a503a101 Add sensors 1.0 default HAL to uhid group
am: 82299438b5

Change-Id: I4b9fbba3e85873763211b1bb36a2bf5d80fb39a1
2019-10-08 12:54:21 -07:00
Brian Duddie
82299438b5 Add sensors 1.0 default HAL to uhid group
Ensures it can access /dev/uinput in Android Q, sepolicy permitting.

Bug: 142105193
Test: confirm hall sensor works again on marlin
Change-Id: I585c32d4da4bdc0917068e4d81adeca43d257e56
2019-10-07 15:53:27 -07:00
Xin Li
15be13ea71 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: Ia07db5c8afeed7fe22a2b18d867a38390f910a81
Merged-In: Ibbd540dbb5baee46360d3fe9469212cfd8f550ba
2019-09-08 13:06:54 -07:00
Steven Moreland
6684ee8c36 Merge "Remove libhwbinder/libhidltransport deps" am: 6b62c58a9a
am: 8c22c3862f

Change-Id: Iaedfceb49f81387f7deaad434613b7c9f1c502a0
2019-09-06 14:28:04 -07:00
Steven Moreland
b3a4d3832e Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
2019-09-06 01:07:02 +00:00
Brian Duddie
bab0c7efe3 Merge changes from topic "c2f2_sensors_vts" into qt-r1-dev
am: 8813be6341

Change-Id: Ie652236cdbd4734dc723fac8c27ca876161f623d
2019-08-02 19:40:55 -07:00
Anthony Stange
86063dc8da Change expected return type in direct report VTS
am: 4bdd8fc774

Change-Id: I7b313096992aa15f34a408fbed67b02e74060d5f
2019-08-02 19:40:49 -07:00