Add vibration preview
Test: Open vibration intensity settings, tap on any option. The preview effect of selected intensity should be played back. Bug: 74504389 Merged-In: Ie22ecb830752edb7a7515a3a6475587e72274e51 Change-Id: Ie22ecb830752edb7a7515a3a6475587e72274e51
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
*/
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import android.media.AudioAttributes;
|
||||
import android.os.Vibrator;
|
||||
import android.os.VibrationEffect;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
@@ -43,6 +45,11 @@ public class NotificationVibrationPreferenceFragment extends VibrationPreference
|
||||
return Settings.System.NOTIFICATION_VIBRATION_INTENSITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreviewVibrationAudioAttributesUsage() {
|
||||
return AudioAttributes.USAGE_NOTIFICATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultVibrationIntensity() {
|
||||
Vibrator vibrator = getContext().getSystemService(Vibrator.class);
|
||||
|
||||
Reference in New Issue
Block a user