From 83aaae41365f2eea523c8ca4ad7331af8f0fc1d3 Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 22 May 2018 13:02:15 -0400 Subject: [PATCH] Vibrate when ringer changes to vibrate Test: manual Change-Id: Icf7bf0d1dfa632d674b9e6aaff0c98099a4b2eb3 Fixes: 78665512 --- .../src/com/android/systemui/volume/VolumeDialogImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java index d76b7f0918709..03474a8c3385a 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java @@ -727,6 +727,12 @@ public class VolumeDialogImpl implements VolumeDialog { } protected void onStateChangedH(State state) { + if (mState != null && state != null + && mState.ringerModeInternal != state.ringerModeInternal + && state.ringerModeInternal == AudioManager.RINGER_MODE_VIBRATE) { + mController.vibrate(VibrationEffect.get(VibrationEffect.EFFECT_HEAVY_CLICK)); + } + mState = state; mDynamic.clear(); // add any new dynamic rows