Merge "Fix notification vibration demos in settings" into main

This commit is contained in:
Ahmad Khalil
2024-02-01 13:59:24 +00:00
committed by Android (Google) Code Review

View File

@@ -150,9 +150,13 @@ public abstract class VibrationPreferenceConfig {
@VibrationAttributes.Usage int vibrationUsage) {
return new VibrationAttributes.Builder()
.setUsage(vibrationUsage)
.setFlags(
// Enforce fresh settings to be applied for the preview vibration, as they
// are played immediately after the new user values are set.
.setFlags(VibrationAttributes.FLAG_INVALIDATE_SETTINGS_CACHE)
VibrationAttributes.FLAG_INVALIDATE_SETTINGS_CACHE
// Bypass user settings to allow vibration previews to be played while in
// limited interruptions' mode, e.g. zen mode.
| VibrationAttributes.FLAG_BYPASS_INTERRUPTION_POLICY)
.build();
}