From 3c729321dc64bbeb5b60d51c25491baf06ea8a80 Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Wed, 30 Jun 2021 12:18:00 +0100 Subject: [PATCH] Add support to slowly bring the vibrator down in VibrationThread Add support to slowly bring down the vibrator amplitude when a vibration ends at a positive amplitude or when it is cancelled while playing at a positive amplitude. This uses the same duration configured to ramp down PWLE and step waveforms, and the duration is not considered part of the user defined vibration. Bug: 188431691 Test: VibrationThreadTest Change-Id: I642e898c3b13b2c841543e870275e40df4d00b81 --- core/res/res/values/config.xml | 3 +- .../server/vibrator/VibrationSettings.java | 16 +- .../server/vibrator/VibrationThread.java | 443 +++++++++++++++--- .../server/vibrator/VibratorController.java | 44 +- .../vibrator/VibratorManagerService.java | 33 +- .../server/vibrator/VibrationThreadTest.java | 250 ++++++++-- .../vibrator/VibratorManagerServiceTest.java | 40 +- 7 files changed, 686 insertions(+), 143 deletions(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 8dfbdccf5706e..2770cbef6dfc7 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3370,8 +3370,7 @@ 5 + non-zero amplitudes, to bring the vibrator amplitude down to zero using this timing. --> 0