From 96c18962f339730d0f61fe915e26fd17f80e397f Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Tue, 17 Nov 2020 13:56:10 +0000 Subject: [PATCH] Turn vibrator off explicitly on waveforms when amplitude is zero This makes sure the drive will be off for the period of time described in the waveform pattern with amplitude = 0. Bug: 172492945 Test: manual Change-Id: I604fea474b6b0b56ee6d16cacb4c4fc97cb7516a Merged-In: I753e4846fce3066b78e818afa5c794b113244ab0 --- services/core/java/com/android/server/VibratorService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java index 0ee30f9ca289b..9340be10060cf 100644 --- a/services/core/java/com/android/server/VibratorService.java +++ b/services/core/java/com/android/server/VibratorService.java @@ -1662,6 +1662,10 @@ public class VibratorService extends IVibratorService.Stub // Vibrator is already ON, so just change its amplitude. doVibratorSetAmplitude(amplitude); } + } else { + // Previous vibration should have already finished, but we make sure + // the vibrator will be off for the next step when amplitude is 0. + doVibratorOff(); } // We wait until the time this waveform step was supposed to end,