Introduce alarm and media vibration intensity settings

Introduce toggles and sliders to configure the alarm and media
vibrations in the "Vibration & haptics" settings app.

Also update the multiple intensities configuration flag into a integer,
where the device can specify how many distinct levels are supported.
Follow existing implementation to map the intensities to higher setting
values.

Bug: 198346559
Bug: 207477604
Test: [Alarm|Media]Vibration[Intensity|Toggle]PreferenceControllerTest
Change-Id: Ie3d570b72ba1229e613ecf0c45fac81233529e32
This commit is contained in:
Lais Andrade
2022-01-07 20:12:19 +00:00
parent 8e7a57e8fa
commit eaaf5331d6
26 changed files with 1102 additions and 146 deletions

View File

@@ -74,6 +74,12 @@ public class HapticFeedbackIntensityPreferenceController
super(context, preferenceKey, new HapticFeedbackVibrationPreferenceConfig(context));
}
protected HapticFeedbackIntensityPreferenceController(Context context, String preferenceKey,
int supportedIntensityLevels) {
super(context, preferenceKey, new HapticFeedbackVibrationPreferenceConfig(context),
supportedIntensityLevels);
}
@Override
public int getAvailabilityStatus() {
return AVAILABLE;