Commit graph

518 commits

Author SHA1 Message Date
Hsin-Yi Chen
1909098d4a Increase min delay of default gyro sensor
The gyro sensor is simulated by CPU. The min delay was too short in
comparison with CPU time slice, which might result in CTS failure.
This commit increases the min delay so as to decrease the relative error
of time intervals.

Test: atest CtsSensorTestCases:android.hardware.cts.SingleSensorTests#testGyroscope_fastest
Bug: 177871363
Change-Id: I58bc08d30633250cacc5f7dddc6cd836c796475b
2021-02-01 15:20:11 +08:00
Hsin-Yi Chen
012ae9cccc Merge "Adjust the parameters of accelerometer and hinge angle sensor" am: 3f4034f02b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1517637

Change-Id: If9e9fe78d17d354e3afc1d3db301a8247993d1ef
2020-12-07 02:37:58 +00:00
Hsin-Yi Chen
92f8f4847a Adjust the parameters of accelerometer and hinge angle sensor
This commit fixes the following CTS failures:
CtsSensorTestCases:android.hardware.cts.SingleSensorTests#testSensorProperties
CtsSensorTestCases:android.hardware.cts.SensorTest#testSensorOperations

Test: atest VtsHalSensorsV2_0TargetTest
Test: atest VtsHalSensorsV2_1TargetTest
Test: atest CtsSensorTestCases
Bug: 169548171
Change-Id: Ie295a06a539ed6788bdff0f9c936a4186e5f1d0f
2020-12-04 09:55:51 +00:00
Hsin-Yi Chen
d9477a4554 Merge "Set default value for pressure sensor" am: e07fd9fce2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1515727

Change-Id: I6f9489297d70940b9cfe8650ced59999e152b0a5
2020-12-04 04:12:17 +00:00
Hsin-Yi Chen
eac1775c01 Set default value for pressure sensor
This commit fixes the following CTS failures:
CtsSensorTestCases:android.hardware.cts.SensorBatchingTests#testPressure*
CtsSensorTestCases:android.hardware.cts.SingleSensorTests#testPressure*

Test: atest VtsHalSensorsV2_0TargetTest
Test: atest VtsHalSensorsV2_1TargetTest
Test: atest CtsSensorTestCases
Bug: 169548171
Change-Id: I2e8ab93d6174c6191497436bf7e7c6a43d34de3f
2020-12-03 18:45:56 +08:00
Xin Li
c026d3a0b6 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: If5afd00334e8b09250df1ae97dec9285e39ad930
Change-Id: Ic66bb1389f1bbecfdaa641e1fcdbf79044f55d23
2020-12-02 00:32:27 -08:00
karthik bharadwaj
c8fd7b31e0 Strip hinge angle sensor when running a 2.1 HAL as 2.0
VTS ensures that  2.0 HALs don't expose the hinge angle sensor,
but the 2.1 HALs must run 2.0 VTS tests. This CL ensures that
we don't expose the hinge angle sensor on the 2.0 HAL, to avoid
failing those VTS tests.

Bug: 173135479
Test: run vts -a x86 -m VtsHalSensorsV2_0TargetTest
Change-Id: I944bfb0b01be0831e45cfd3d6ed7dab6770d1b80
2020-11-16 05:21:25 +00:00
Karthik Bharadwaj
534d9358af Fix VTS SensorsHidl Test Failures
This CL fixes test failures by:
- Remove the deprecated 'Device Temperature' sensor from
the sensor list
- Ignoring the deprecated 'Device Temperature' sensor type
for tests
- Only accessing shared memory buffer if the shared memory
type is supported
- Return a default z-axis data value for the accel sensor type.
- Update the batch() functions argument to take an int64 timestamp
to adhere to the interface

Bug: 171940270
Test: run vts -a x86 -m VtsHalSensorsV2_0TargetTest
Change-Id: I88fe8746030f42edd620f9891aa44bc228a73426
2020-11-13 00:19:24 +00:00
Eric Hefner
812d9b50f6 Modify VTS NoStaleEvents test to omit on-change sensors
- add utility function to select non one-shot, non on-change and
  non special-report sensors
- apply to NoStaleEvents test case
- remove unnecessary checks related to on-change sensors

b/170315229

Change-Id: I349fe8be35fd1fa6f9ff1e0844b09815006a18b8
2020-10-19 13:34:16 -05:00
Dan Shi
8d5281da2e Rename vts-core to vts
Bug: 151896491
Test: none
Change-Id: If74547c56b46ebc7fd728c1bf52fe9dedac65ffa
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-09-29 06:52:57 +00:00
Dan Shi
f2b950f470 Rename vts-core to vts
Bug: 151896491
Test: none
Change-Id: If74547c56b46ebc7fd728c1bf52fe9dedac65ffa
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-09-26 04:11:28 +00:00
Xin Li
36dcf1a404 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I6502829205ede2de914b27e6c2c5c42916af2b39
Change-Id: I7cb06511e43bd1fffd5f80a11dbdf5b1314cfe8e
2020-08-28 13:05:04 -07:00
Treehugger Robot
1d18ec8d96 Merge "Remove unnecessary type and dup for fd" am: 5428551ba9 am: f8f2391f8e am: 667ef2c4c7 am: 6f25e95bc8
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12346313

Change-Id: Ib984a5a049ff3cabbf7ae7b03b5a40ceab4d973c
2020-08-26 00:52:10 +00:00
Treehugger Robot
667ef2c4c7 Merge "Remove unnecessary type and dup for fd" am: 5428551ba9 am: f8f2391f8e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1374049

Change-Id: I4151bc9aa650bbdb5545875d14760455efe62fe7
2020-08-25 22:04:45 +00:00
TreeHugger Robot
81259af583 Merge "Fix double release of ScopedWakelock" into rvc-qpr-dev am: 74896bed49
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12351750

Change-Id: I2478bae593f72eec1f9722675226c39712aa306a
2020-08-12 14:40:42 +00:00
Anthony Stange
55a4f59fb8 Fix double release of ScopedWakelock
Today, when a ScopedWakelock is moved, the default move constructor
doesn't unlock the old wakelock instance. This results in the moved
ScopedWakelock instance decrementing the wakelock ref count which leaves
the multi-HAL out of sync from the sensor service.

Fix this by adding a custom move constructor / operator to ensure old
state is cleared on the moved instance.

Bug: 163468874
Test: Load multi-HAL and verify that it properly waits to release the
wakelock until the sensor service notifies that it has a lock held.
Test: Run unit tests

Change-Id: Ifd5a3c7596f78d7a756c4472f30efb625d670791
2020-08-11 21:43:09 +00:00
Stan Rokita
582d62b67f Remove unnecessary type and dup for fd
Test: Compile
Change-Id: Iab4502a03090e0c99af73fded270c537b2909591
2020-07-30 00:07:56 +00:00
Dan Shi
e5c9b5e722 Suppress gtest error for tests without any instance am: ba4d532fee am: 73122cd284
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1374050

Change-Id: Ie5e956d4613f5e947c36ba4f1048f0c3aa8944ba
2020-07-29 05:45:58 +00:00
Dan Shi
ba4d532fee Suppress gtest error for tests without any instance
Bug: 162052785
Test: m -j vts
Change-Id: I8c1a48e6fbd7c8161137902b5332911fa0d7b8b3
2020-07-28 15:12:32 -07:00
Jooyung Han
d610435ac4 update hidl .bp
HIDL libs are not necessarily part of VNDK now. Because some are
used by VNDK libs, they are still VNDK. But rest are now just
vendor-available.

.hidl_for_test files are also removed because they are used to exclude
test-purpose hidl libs from VNDK libs.

Instead, .hidl_for_system_ext files are added to tests/lazy to
distinguish them from others which are installed /system.

Bug: 143933769
Test: update-makefiles.sh && m com.android.vndk.current
Merged-In: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
Change-Id: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
(cherry picked from commit b0907a6bb8)
2020-07-07 16:22:36 +09:00
Jooyung Han
d18cba85fe update hidl .bp
HIDL libs are not necessarily part of VNDK now. Because some are
used by VNDK libs, they are still VNDK. But rest are now just
vendor-available.

.hidl_for_test files are also removed because they are used to exclude
test-purpose hidl libs from VNDK libs.

Instead, .hidl_for_system_ext files are added to tests/lazy to
distinguish them from others which are installed /system.

Bug: 143933769
Test: update-makefiles.sh && m com.android.vndk.current
Merged-In: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
Change-Id: Ia81312dda340b6b5cbdd7a3c21e1d323bda39a4a
(cherry picked from commit b0907a6bb8)
2020-07-02 12:26:37 +09:00
Brian Duddie
35a1cb8e00 Add support for IAllocator/IMapper v4.0 in sensors VTS am: 97f1a3aeaa
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/11744993

Change-Id: Ia66309472684ff6552884ddd2ef0de8d1bd9a1bd
2020-06-05 14:38:42 +00:00
Brian Duddie
97f1a3aeaa Add support for IAllocator/IMapper v4.0 in sensors VTS
Also, pull in the static libs associated with the graphics HALs to
VtsHalSensorsTargetTestUtils so that the VTS binaries that depend on it
don't need to all pull them in themselves.

Fixes: 158018963
Test: VtsHalSensorsV2_0TargetTest on a device supporting the v4.0 HALs
Change-Id: Idc47ffb8cacd1ac84d45b979cd45fe630b6808f6
2020-06-04 16:33:09 -07:00
Dan Shi
f2956479e3 Merge "Use StopServicesSetup to stop/start framework." into rvc-dev am: e8f9e0959f
Change-Id: I9b0e7c3c76a33526bd90730b1f775e29134d909e
2020-05-13 23:12:44 +00:00
Dan Shi
e8f9e0959f Merge "Use StopServicesSetup to stop/start framework." into rvc-dev 2020-05-13 22:52:20 +00:00
TreeHugger Robot
2e59c22326 Merge "Use StopServicesSetup to stop/start framework." into rvc-dev 2020-05-13 21:44:19 +00:00
Dan Shi
2d11037a0b Use StopServicesSetup to stop/start framework.
Bug: 155774142
Test: none
Change-Id: I3dfec18df478b0a4ae16c454d110e5c05f33cbca
2020-05-13 14:03:24 -07:00
Dan Shi
1a380f7b5b 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
Merged-In: I83cffadfff15e6352a69641c3227efb63e7a34e4
2020-05-13 14:02:04 -07:00
Dan Shi
3b6534e36d Use StopServicesSetup to stop/start framework. am: 8a648312f8 am: 95d430d6c8
Change-Id: I96a02ab530d4efd386c5f835bbb932e62ea8ea7d
2020-05-13 18:19:37 +00:00
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
Ahmad Rahmati
388e2efecc Merge "Add SCOPED_TRACE to VTS tests that loop over all sensors" into rvc-dev am: 91c5deafc3
Change-Id: I41aeba2fa41e10dad5ad05b6b87b89ea048bf58f
2020-05-07 22:16:17 +00: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
Ahmad Rahmati
8276a3bb02 Add SCOPED_TRACE to VTS tests that loop over all sensors
SCOPED_TRACE enables the error message contains enough detail to
easily narrow down the root cause

Bug: 154357354
Test: atest VtsHalSensorsV2_0Target VtsHalSensorsV2_1Target
Change-Id: Id6dbbe8bd8617776efec383d5276e9e12006f27d
2020-05-07 02:45:30 +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
TreeHugger Robot
f4ebf94103 Merge "Fix Sensors VTS asserts for sensor type strings" into rvc-dev am: abc7986d1a
Change-Id: Iaf3b7fd1de42a5e5665a5bd74bb9f49d7d13c2ec
2020-05-05 15:24:41 +00:00
Anthony Stange
908e4479dd Fix Sensors VTS asserts for sensor type strings
Private sensors are the only sensor types that must define a type
string. For public sensors, a type string can be left empty as it will
be overridden by the sensors frameork.

Bug: 155514483
Test: atest VtsHalSensorsV2_0Target
Change-Id: Ib5f8fd513313670e88c2b973c1ff724658914eb2
2020-05-04 14:54:19 -04:00
TreeHugger Robot
da0ae1cfe4 Merge "Search for subhal .so files in additional directories" into rvc-dev am: 358db3b106
Change-Id: Id04399150e05bcc198ed8f9ccee9448e4a4a1581
2020-05-02 02:48:41 +00:00
Stan Rokita
c786dfc5b1 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
2020-05-02 00:03:27 +00:00
Anthony Stange
6c3ed907d7 V2: Update tests for multihal to test HAL 2.1 am: 7a21c53268
Change-Id: Ic4addb6b376c34390f8afb2b954a2fb163c25d99
2020-04-30 21:51:24 +00:00
Anthony Stange
91b3dced0f V2: Create Multi-HAL 2.1 service am: 199b5ff96a
Change-Id: Ibfd005e49e0754daf757f4db1b6154760a55b04d
2020-04-30 21:51:20 +00:00
Anthony Stange
56f6c459df V2: Set up Multi-HAL for Sensors HAL 2.1 am: 33acf9fb3a
Change-Id: I5de7348d33466bcfb8da450c57472327aafd7772
2020-04-30 21:51:18 +00:00
Anthony Stange
7a21c53268 V2: 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: I7a9d7c1678826bb1956119e8b76f591c7bc213e1
2020-04-30 08:45:19 -04:00
Anthony Stange
199b5ff96a V2: 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: I275274659816b3a00374fb0b7a93f199874afdcd
2020-04-30 08:45:19 -04:00
Anthony Stange
33acf9fb3a V2: 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: Ie73458b3447dab80f6b692e55832ef562636bfdb
2020-04-30 08:45:19 -04:00