Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2a9d5d3c authored by Lais Andrade's avatar Lais Andrade
Browse files

Fix VibrationThread handling old HAL callbacks

The VibrationThread does not differentiate between HAL callbacks from
different IVibrator calls, causing older callbacks to affect the
vibration playback. This can be seen when the VibrationThread or
Vibrator HAL are slower to schedule the steps / callbacks execution,
breaking the execution of pattern waveforms that depends on strict
timings.

This fix adds an extra id to the vibrate calls, which will be sent back
by the HAL callback once complete. The VibrationThread can use this to
control which callbacks should be ignored during the vibration playback.

A regression test was introduced where a latency is set to the fake HAL
implementation to check the vibration is executed as expected. This test
replicates the flaky failure caught by a separate test.

Fix: 395005081
Test: VibrationThreadTest
Flag: android.os.vibrator.fix_vibration_thread_callback_handling
Change-Id: I1d2bc2d15698e71127e87c164d9b147135cff1a1
parent 703ee5ae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment