Commit Graph

6 Commits

Author SHA1 Message Date
Lais Andrade
28c81f1948 Disable cpp backend for android.hardware.vibrator
Disable CPP backend for vibrator HAL. Dependencies should use the
stable NDK instead.

This is also the recommended choice:

https://source.android.com/docs/core/architecture/aidl/aidl-hals#choosing-runtime

The HAL will be allowed to use ndk-stable types like PersistableBundle
after disabling the legacy CPP backend.

Fix: 349595412
Test: VtsHalVibratorTargetTest & VtsHalVibratorManagerTargetTest
Flag: EXEMPT NDK
Change-Id: Id5736e092afd36e786ecf3978ff6ad81c7a4df56
2024-07-03 15:49:00 +01:00
Lais Andrade
a5131c57de Fix benchmark crash on wait for destroyed callback
Fix benchmark crash error:

`FORTIFY: pthread_mutex_lock called on a destroyed mutex`

Caused by the bench loop trying to wait on the callback promise future
after the callback instance was destroyed.

The fix grabs the promise future before performing the HAL operation, so
it can access the fulfilled value after the promise fulfilled and then
destroyed.

Change-Id: I4504129672a11ad1662ea36c79f522d754535765
Fix: 336977792
Test: atest VibratorHalIntegrationBenchmark
Flag: TEST_ONLY
2024-06-14 10:50:00 +00:00
Lais Andrade
db8ffbb077 Remove cleanup after bench loop from setAmplitude test
Fix error on waiting for long vibration callback that might have been
already cleared by the HAL when vibration finished. Test run crash log:

FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xf5a83bbc)

Keep all test cleanup logic in teardown methods.

Bug: 329899022
Change-Id: If7c13296b870e792063a9ad7b307d57fb5c333aa
Test: atest VibratorHalIntegrationBenchmark
2024-03-26 12:03:10 +00:00
Lais Andrade
59a5d543b0 Fix binder transaction errors on vibrator benchmark tests
Setup binder process thread pool for vibrator HAL benchmark tests to fix
binder transaction errors of the type:

E Vibrator: Failed completion callback: -129

This change also adds checks for HAL results, which will cause them to
fail earlier with a useful error message when the device reaches a bad
state. This should avoid timeout failures for the whole test suite.

Other fixes:

- Fix vibrator.on(ms) tests to use a valid max duration value
  (previously failing with illegal argument);
- Use a smaller fixed # of iterations on tests that iterate on vibrate
  calls, and add wait for vibration to be complete to measure the HAL
  in a more stable state;
- Skip getSupportedAlwaysOnEffects on devices without capability;

Fix: 329239120
Bug: 329899022
Bug: 329203383
Test: atest VibratorHalIntegrationBenchmark
Change-Id: Id541a62745320a601934fd3f176f8ba42b5a7b2d
2024-03-20 13:54:13 +00:00
Adrian Roos
77659428e3 vibrator HAL bench: Fix broken benchmarks
Fixes an issue with the benchmarks, where they would skip unsupported
situations by early returning without reaching the measure loop and
without notifying the framework.

The framework would then retry the exact same scenario indefinitely.

To fix, makes sure every early return also calls SkipWithMessage.

Fixes: 302845046
Test: adb shell /tmp/foobar/VibratorHalIntegrationBenchmark --v=2
Change-Id: Ib52b8c4d94755a0961bcfb40d508482e5c49cb52
2024-02-09 19:49:32 +00:00
Lais Andrade
e29acd8194 Move vibrator HAL benchmarks to interfaces/vibrator
The benchmarks are relying only with the HAL interfaces, so they can be
moved outside the pixel folder and integrated with continuous native
metric tests.

Bug: b/159981541
Test: N/A, just moving tests
Change-Id: I54e7155d12eb844df7f77e8c5d232949426546d2
2020-08-07 13:51:04 +00:00