Apply only RING_VIBRATION_INTENSITY to ringtone vibrations

Ignore the VIBRATE_WHEN_RINGING deprecated settings for ring vibrations.
Old behavior applied this settings only to ringer-mode normal, but never
to vibrate-only ringer mode.

This is being deprecated in favor of the INTENSITY_OFF value in
RING_VIBRATION_INTENSITY.

Fix: 222697191
Test: RingVibrationIntensityPreferenceControllerTest
Change-Id: Ic05f06c6a1df392ced1bf91f67380c0c65257aea
This commit is contained in:
Lais Andrade
2022-03-29 19:20:07 +01:00
parent 03ecb4f4a6
commit 7ee344ab54
3 changed files with 10 additions and 23 deletions

View File

@@ -41,21 +41,6 @@ public class RingVibrationPreferenceConfig extends VibrationPreferenceConfig {
return true;
}
@Override
public int readIntensity() {
final int vibrateWhenRinging = Settings.System.getInt(mContentResolver,
Settings.System.VIBRATE_WHEN_RINGING, ON);
if ((vibrateWhenRinging == OFF)
&& !mAudioManager.isRampingRingerEnabled()) {
// VIBRATE_WHEN_RINGING is deprecated but should still be applied if the user has
// turned it off and has not enabled the ramping ringer (old three-state setting).
return Vibrator.VIBRATION_INTENSITY_OFF;
}
return super.readIntensity();
}
@Override
public boolean updateIntensity(int intensity) {
final boolean success = super.updateIntensity(intensity);