Split ring and notification vibration settings
Synchronize settings between sound and accessibility menus Bug: 116172311 Test: See accessibility vibration settings - ring and notification settings sould be separate. Try changing vibration settings in sound and accessibility menus - the settings should stay in sync. Change-Id: I515a7188cdf5a26a229ac8f08c6fcfe98e2f91a0
This commit is contained in:
@@ -44,6 +44,11 @@ public class TouchVibrationPreferenceFragment extends VibrationPreferenceFragmen
|
||||
return Settings.System.HAPTIC_FEEDBACK_INTENSITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getVibrationEnabledSetting() {
|
||||
return Settings.System.HAPTIC_FEEDBACK_ENABLED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultVibrationIntensity() {
|
||||
Vibrator vibrator = getContext().getSystemService(Vibrator.class);
|
||||
@@ -54,13 +59,4 @@ public class TouchVibrationPreferenceFragment extends VibrationPreferenceFragmen
|
||||
protected int getPreviewVibrationAudioAttributesUsage() {
|
||||
return AudioAttributes.USAGE_ASSISTANCE_SONIFICATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVibrationIntensitySelected(int intensity) {
|
||||
// We want to keep HAPTIC_FEEDBACK_ENABLED consistent with this setting since some
|
||||
// applications check it directly before triggering their own haptic feedback.
|
||||
final boolean hapticFeedbackEnabled = !(intensity == Vibrator.VIBRATION_INTENSITY_OFF);
|
||||
Settings.System.putInt(getContext().getContentResolver(),
|
||||
Settings.System.HAPTIC_FEEDBACK_ENABLED, hapticFeedbackEnabled ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user