summaryrefslogtreecommitdiff
path: root/services/vibratorservice
AgeCommit message (Collapse)Author
2025-03-17Simplify libvibratorservice after HIDL support removal Lais Andrade
Introduce a simplified VibratorController class to the libvibratorservice module that only handles AIDL vibrator HAL versions and reuse the binder ndk objects. This removes all wrapper classes introduced to handle both AIDL and HIDL objects seamlesly, reducing complexity for the library. The connect/reconnect logic on transcation falure remains, with most HAL operations working with a retry logic. This first change introduced the core for the VibratorController with basic APIs like off / setAmplitude / setExternalControl. Following changes will introduce the remaining IVibrator API support. Bug: 308452413 Test: libvibratorservice_test Flag: android.os.vibrator.remove_hidl_support Change-Id: Ie76168eaf9fd5cd0ce9719499d4ef9b086b2fca6
2025-02-28Removing Vibrator HIDL HAL support from frameworks Lais Andrade
Android Q is now no longer supported for launching or upgrading devices in Android V so the vibrator HIDL HAL versions no longer needs to be supported by the platform. Bug: 308452413 Test: manually using the command line Flag: EXEMPT updating Android.bp and removing dependencies Change-Id: I6ba36f7c153f39afa9cf1a3c6dd679885da49ce7
2025-01-20Fix PWLE v2 effect durations Ahmad Khalil
The `VibratorHalWrapper` now calculates and returns the total duration of the PWLE vibrations by summing the durations of all PWLE primitives. Bug: 390701627 Flag: android.os.vibrator.normalized_pwle_effects Test: atest libvibratorservice_test Change-Id: I38c64d334939e8963b194cca956f290a81c06e8f
2024-11-01Implement vibration session support Lais Andrade
Introduce support to start and end vibration sessions in IVibratorManager HAL, adding support to libvibratorservice. Test: libvibratorservice_test Flag: android.os.vibrator.vendor_vibration_effects Bug: 345414356 Change-Id: Ie2121554c856ba7e45a6a5208402b0c32fa34d40
2024-10-09Modify composePwleV2 parameters Ahmad Khalil
Update composePwleV2 API to take a CompositePwleV2 paramter. Bug: 347034419 Flag: android.os.vibrator.normalized_pwle_effects Test: libvibratorservice_test Change-Id: I05a1856e908f947c90a6704b275fdb3756b135f6
2024-10-09Merge "Integrate the new frequency profile APIs with the vibrator HAL." into ↵ Ahmad Khalil
main
2024-10-03Merge "Add mocks for vibration session HAL APIs" into main Lais Andrade
2024-10-02Add mocks for vibration session HAL APIs Lais Andrade
Bug: 345417514 Test: libvibratorservice_test Flag: EXEMPT HAL API changes Change-Id: I21257930f9ff9132c9588df0ec89673070602307
2024-09-26Integrate the new frequency profile APIs with the vibrator HAL. Ahmad Khalil
Bug: 347034419 Flag: android.os.vibrator.normalized_pwle_effects Test: libvibratorservice_test Change-Id: I59b280e4b22863daa62d5e32c6b1c566845fc786
2024-09-24Add libvibrator_test to presubmit Lais Andrade
Bug: 356144312 Change-Id: I19f72f9f5c69cde91079aac8e994c16f03e0532e Test: libvibrator_test Flag: EXEMPT test only
2024-09-10Implement Envelope Effect Limitations APIs Ahmad Khalil
Implement APIs to support envelope effect limits in VibratorHalWrapper. Bug: 347034419 Flag: android.os.vibrator.normalized_pwle_effects Test: libvibratorservice_test Change-Id: I3d45f09740754b5e120bae2ecffa9d150e66e85d
2024-08-13Add support to PWLE V2 APIs Ahmad Khalil
Support new APIs for PWLE V2 effects. Bug: 347034419 Flag: EXEMPT HAL interface change Test: libvibratorservice_test Change-Id: I0016869787c40f75db3d57527105b864e54572b6
2024-07-22Add support for IVibration.performVendorEffect Lais Andrade
Support new @SystemApi for vendor-specific vibration effects. Fix: 345405987 Flag: android.os.vibrator.vendor_vibration_effects Test: libvibratorservice_test Change-Id: I53d8e7dfa5430d098037aa97c3e2de6c8c95861d
2024-07-01Use android.hardware.vibrator NDK backend Lais Andrade
Update vibrator HAL dependency to use the NDK backend. Bug: 349595412 Test: libvibratorservice_test Flag: EXEMPT mechanical refactor Change-Id: I1eee7ea86d0535f93ed09d5295b3efbb4d5a1870
2024-04-29Add VibratorCallbackSchedulerTest tests to presubmit Lais Andrade
Remove the exclude-filter entries for fixed tests from VibratorCallbackSchedulerTest. Tests are now consistently passing in post-submit runs. Change-Id: Ide9404e3b1cf15c1aa2c70dc8fefae31d36919a8 Test: atest VibratorCallbackSchedulerTest Fix: 293623689 Fix: 293603710
2024-04-26Fix VibratorCallbackScheduler destructor lock Lais Andrade
The VibratorCallbackScheduler destructor joins on the scheduler thread to wait for the main loop to finish, but the conditional variable is waiting indefinitely without a predicate, which can cause it sometimes to miss the notify call from the destructor and get stuck. Adding a predicate condition fixes the VibratorCallbackSchedulerTest flakiness for the timeout "No test results." failures. Bug: 293603710 Bug: 293623689 Test: atest --rerun-until-failure 1000 VibratorCallbackSchedulerTest Change-Id: Id9501c10fe5209003d9b74b0f39f2bcf87de05c2
2024-04-17Merge "Fix flaky VibratorCallbackSchedulerTest" into main Treehugger Robot
2024-04-17Fix flaky VibratorCallbackSchedulerTest Lais Andrade
Use TestCounter to wait on scheduled callbacks with a timeout. Increase time delta in ordered callback test to have at least the test timeout as buffer before asserting on callback trigger order. Bug: 293603710 Bug: 293623689 Test: atest VibratorCallbackSchedulerTest Change-Id: Ib519c3e91608c7373b2999fc596dab3413226a1e
2024-04-17Fix flaky libvibratorservice benchmarks Lais Andrade
Add lock around HAL completion callbacks to avoid race conditions with the test execution. Bug: 329175148 Test: atest libvibratorservice_benchmarks Change-Id: I9e9461a37a601e48df8217669c642ad83efac948
2024-04-08Merge "VibratorHalControllerTest: fix flaky test" into main Treehugger Robot
2024-04-08VibratorHalControllerTest: fix flaky test Adrian Roos
Fixes a flaky test that was caused by sleeping instead of explicitly waiting for the condition to become true. Fixes: 332278497 Test: atest 'libvibratorservice_test:VibratorHalControllerTest#TestScheduledCallbackSurvivesReconnection' Change-Id: Id34a6237ca2deb3653a7336a04d181fa9d1ebb08
2024-04-04Merge "Fix timeouts from libvibratorservice_benchmarks" into main Treehugger Robot
2024-03-28Fix timeouts from libvibratorservice_benchmarks Lais Andrade
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 max duration value - 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; Bug: 329175148 Test: atest libvibratorservice_benchmarks Change-Id: I93a39604b661152ebd60cee38bfc7ccd9ff832b6
2024-03-27Exclude flaky TestScheduleMultipleCallbacksRunsInDelayOrder from presubmit Lais Andrade
Keep test running in postsubmit until it's fixed, but exclude it from presubmit target to avoid demoting the entire module. Change-Id: I8f244902f1b1dd11ba510fd87cf597ea49da2b5f Fix: 331559255 Bug: 293623689 Test: N/A
2024-02-16Fix retry logic for vibrator HAL requests Lais Andrade
Update VibratorHalController to only reconnect with the IVibrator HAL service and retry the operation if a transaction error or dead object code is received. This will avoid retrying vibrator calls with bad values when the error code is illegal argument, for example, or when the vibrator is returning illegal state. Bug: 325204954 Test: atest libvibratorservice_test Change-Id: I6764c736a64745ada5233329372d5c22f4e8aa74
2024-02-13Merge "[DON'T BLOCK] Test ownership migration rules" into main am: ↵ Ronish Kalia
f86d02b37e am: 3d189ae199 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2950507 Change-Id: I33c76a6b49e610097f394b68f90aef71813cd252 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-13Merge "[DON'T BLOCK] Test ownership migration rules" into main am: f86d02b37e Ronish Kalia
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2950507 Change-Id: If8016d182099581fcb9bd65e7672d8be8d72f2b3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-09vibratorservice: Fix broken benchmarks Adrian Roos
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: 279134938 Test: adb shell /tmp/VibratorHalControllerBenchmarks --v=2 Change-Id: If7f92816133bf3d03a5915b6f077eb961d55cf75
2024-02-05[DON'T BLOCK] Test ownership migration rules Aditya Choudhary
This CL is created as a best effort to migrate test targets to the new android ownership model. If you find incorrect or unnecessary attribution in this CL, please create a separate CL to fix that. For more details please refer to the link below, go/new-android-ownership-model Bug: 304529413 Test: N/A Change-Id: I807c0e2743bb74820f05a2a3639f74c62868216e
2024-01-31[DON'T BLOCK] Test ownership migration rules Aditya Choudhary
This CL is created as a best effort to migrate test targets to the new android ownership model. If you find incorrect or unnecessary attribution in this CL, please create a separate CL to fix that. For more details please refer to the link below, <add g3 doc link> Bug: 304529413 Test: N/A (cherry picked from aosp/2939759) Change-Id: Ia29683d8fd857ca136d39166346e921473578ca3
2023-11-27Merge "TEST_MAPPING: re-enable fixed scheduler test" into main Lucas Henneman
2023-11-21TEST_MAPPING: re-enable fixed scheduler test Lucas Henneman
Turning up VibratorCallbackSchedulerTest#TestScheduleMultipleCallbacksRunsInDelayOrder as it has been fixed and passing in post-submit runs. Test: atest VibratorCallbackSchedulerTest Bug: 293623689 Change-Id: I33aa73927a5b64fdf7de2e1a8ed897bd278c3ba4 Signed-off-by: Lucas Henneman <henneman@google.com>
2023-11-21Merge "Re-enable LTO for libviabratorservice" into main am: 70127e5402 am: ↵ Treehugger Robot
880e1bad76 am: 08996c8e9f Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2838749 Change-Id: I99e30f5aa17d941ddc883ffd6af6f2b816bc5316 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21Merge "Re-enable LTO for libviabratorservice" into main am: 70127e5402 am: ↵ Treehugger Robot
880e1bad76 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2838749 Change-Id: Ia9535a05268ddd59f70360be44046118ca65bba0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21Re-enable LTO for libviabratorservice Yi Kong
The breakage was fixed in the current stable Clang. Test: presubmit Bug: 241699694 Change-Id: I2dad60fa5a552bc6d16d1ef60d99ef319ff4be5c
2023-11-14Removing test TestScheduleInParallelRunsInDelayOrder. am: d5c3a129ad Ahmad Khalil
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/25310923 Change-Id: I5778ef692a29a5dd67d5ead5cef821f7601f753f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-09Removing test TestScheduleInParallelRunsInDelayOrder. Ahmad Khalil
It should be fine to remove this test since there's no need for ordering of different threads using relative time, and we do not offer ordering guarantees for relative timings across different threads. Ordering on a single thread is guaranteed and is still tested. Fix: 237099553 Test: We are just removing a test. Change-Id: Ie798ef62acce0e904293c7a856602ab7c9b8e5b0 (cherry picked from commit 66fad0ecb6406feab9bda7b8511dd228b4222c53)
2023-08-25Merge Android U (ab/10368041) Xin Li
Bug: 291102124 Merged-In: I9b175092d433fc6d7b22b437a09d76d3d2e0ce14 Change-Id: If8a2897a99b111ba107f33c19537d40bcbdc802e
2023-08-16Fix flaky VibratorCallbackSchedulerTest Lais Andrade
The test is sometimes timing out while asserting the scheduled callbacks are triggered within the required test timeout. Update CallbackScheduler to use std::condition_variable_any::wait_for with calculated durations from using std::chrono::steady_clock, instead of relying on the timestamps via wait_until. Update the VibratorCallbackSchedulerTest to also use wait_for. Bug: 293603710 Test: VibratorCallbackSchedulerTest Change-Id: Ie84147a9ff686d666d8525a35914571f32d72719
2023-08-04Fix VibratorCallbackSchedulerTest flakiness Lais Andrade
Add test timeout to wait for scheduler to trigger callbacks before failing. Also update scheduled callback durations to reduce flakiness. Bug: 293623689 Test: atest VibratorCallbackSchedulerTest Change-Id: I49a9cae3f1622a4902ae9e56b37892060eba5c91
2023-07-28Exclude flaky test from libvibratorservice_test presubmit Lais Andrade
Bug: 293623689 Change-Id: Ia23932155ca8709cdb6456d8dc68ee5159a8103f Test: atest --test-mapping services/vibratorservice:presubmit
2023-07-28Merge "Exclude flaky test from libvibratorservice_test presubmit" into main Treehugger Robot
2023-07-28Exclude flaky test from libvibratorservice_test presubmit Lais Andrade
Also add postsubmit mapping to the excluded tests can be monitored and returned to presubmit. Bug: 293603710 Test: atest --test-mapping services/vibratorservice:presubmit Change-Id: I4cc55a58b4b0e9f5482e300e04f8c583e62e0555
2023-07-25Extract vibrator cts tests from CtsOsTestCases Ahmad Khalil
Trigger the vibrator cts tests from vibratorservice TEST_MAPPING file. Fix: 290746931 Test: atest CtsVibratorTestCases Change-Id: Ie161c9a2a6591118beb6b7f9e80d42151104d91a
2023-07-20Merge "Add bug component to services/vibratorservice" into main am: ↵ Lais Andrade
1411c396f0 am: e5121545a0 am: 523c8aa88f am: 96494f6633 am: 96d0d965a2 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2665875 Change-Id: Ic6efc02a481f4e12474ed476bedc326e7c46e541 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-20Merge "Add bug component to services/vibratorservice" into main am: ↵ Lais Andrade
1411c396f0 am: e5121545a0 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2665875 Change-Id: Ib969437ba0e77cb864df39285adc4e82534055b3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19Add bug component to services/vibratorservice Lais Andrade
Change-Id: I4add2fe2bada0be788a436f5431129a03faef58c Fix: 290748221 Test: N/A
2023-04-24Merge "Update LOG_TAG and setAmplitudeCached timeout" into udc-dev am: ↵ TreeHugger Robot
3c0c57fe6e am: fcf5cb4aad Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/22766052 Change-Id: I7619e547d569d0dc0c4448fa55fb2f6beed7fd00 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-21Update LOG_TAG and setAmplitudeCached timeout Tai Kuo
To support the force-feedback vibrator, the type of ff_replay length is __u16 (i.e. 65535). 6000000 is out of the bound. Reference: Kernel header file include/uapi/linux/input.h Bug: 279134938 Test: atest \ libvibratorservice_benchmarks:VibratorBench/setAmplitudeCached Change-Id: I59d7776c1a24f0695bd7ce06d334a07b7d3ecf72
2023-03-30Removing test TestScheduleInParallelRunsInDelayOrder. Ahmad Khalil
It should be fine to remove this test since there's no need for ordering of different threads using relative time, and we do not offer ordering guarantees for relative timings across different threads. Ordering on a single thread is guaranteed and is still tested. Fix: 237099553 Test: We are just removing a test. Change-Id: Ie798ef62acce0e904293c7a856602ab7c9b8e5b0