Make sure vibration previews in Settings apply latest intensities

Update the Settings app to enforce fresh settings are applied to preview
vibrations triggered after the intensity is updated.

Add preview haptics to main switch, only when touch feedback is enabled,
and to the "apply ramping ringer" toggle for consistency with the rest
of the screen, using ringtone intensity for preview.

Bug: 219693646
Bug: 219695212
Bug: 157533521
Test: manual
Change-Id: I872a75d6b00dffae943b0f403185a39047909884
This commit is contained in:
Lais Andrade
2022-03-18 16:41:33 +00:00
parent e7b38f27a3
commit b827221ed3
4 changed files with 46 additions and 11 deletions

View File

@@ -124,6 +124,12 @@ public class VibrationRampingRingerTogglePreferenceController
if (isRingVibrationEnabled()) {
// Don't update ramping ringer setting value if ring vibration is disabled.
mAudioManager.setRampingRingerEnabled(isChecked);
if (isChecked) {
// Vibrate when toggle is enabled for consistency with all the other toggle/slides
// in the same screen.
mRingVibrationPreferenceConfig.playVibrationPreview();
}
}
return true;
}