From 9da5a93b9a21122ca86c323772f6d2291c3525f2 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 9 Feb 2018 18:43:22 +0000 Subject: [PATCH] Register for fallback vibration's death If we don't link the fallback vibration's death then when we go to unlink the vibration when it's done we crash with a NoSuchElement exception. This way if the process that sent us the vibration dies then the vibration also stops. Bug: 73134668 Test: Trigger fallback vibration, doesn't crash Change-Id: I8d8987773eaf45d7989ae46305a9f1558a73c5da --- services/core/java/com/android/server/VibratorService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java index af577c48d496..dac1f4ffff68 100644 --- a/services/core/java/com/android/server/VibratorService.java +++ b/services/core/java/com/android/server/VibratorService.java @@ -905,6 +905,7 @@ public class VibratorService extends IVibratorService.Stub Vibration fallbackVib = new Vibration(vib.token, effect, vib.usageHint, vib.uid, vib.opPkg); final int intensity = getCurrentIntensityLocked(fallbackVib); + linkVibration(fallbackVib); applyVibrationIntensityScalingLocked(fallbackVib, intensity); startVibrationInnerLocked(fallbackVib); return 0; -- 2.11.0