From 11e3bb7af7813548a0e2cfa3a80f44a00ce0b4cf Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Wed, 26 May 2021 13:32:05 +0100 Subject: Use PWLE for waveforms and add ramp down to zero Add new configuration for ramp down duration (defaults to zero) to be used by devices that require a soft ramp down to zero amplitude between two segments when the change is abrupt to zero. The waveform timings will be respected, so the ramp down duration might be reduced if the waveform segment with zero amplitude is shorter than the configured ramp duration. This does not add a ramp at the end of vibrations. This will be done in a follow up. Bug: 188431691 Test: StepToRampAdapterTest Change-Id: I9af8c653462defaa1fc26a4fe60077a63831f3fe --- core/res/res/values/config.xml | 9 + core/res/res/values/symbols.xml | 2 + .../vibrator/DeviceVibrationEffectAdapter.java | 12 +- .../android/server/vibrator/RampToStepAdapter.java | 2 +- .../android/server/vibrator/StepToRampAdapter.java | 196 ++++++++++++- .../android/server/vibrator/VibrationThread.java | 10 +- .../server/vibrator/VibratorManagerService.java | 6 +- .../vibrator/DeviceVibrationEffectAdapterTest.java | 62 +--- .../server/vibrator/RampToStepAdapterTest.java | 122 ++++++++ .../server/vibrator/StepToRampAdapterTest.java | 312 +++++++++++++++++++++ .../server/vibrator/VibrationThreadTest.java | 11 +- 11 files changed, 673 insertions(+), 71 deletions(-) create mode 100644 services/tests/servicestests/src/com/android/server/vibrator/RampToStepAdapterTest.java create mode 100644 services/tests/servicestests/src/com/android/server/vibrator/StepToRampAdapterTest.java diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 5ac23365eaee..ee33d48768c5 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3354,6 +3354,15 @@ (e.g. accessibility, alarms). This is mainly for Wear devices that don't have speakers. --> false + + 5 + + + 0 +