Deprecate boolean settings for haptic feedback and vibrate when ringing
Deprecate HAPTIC_FEEDBACK_ENABLED in favor or HAPTIC_FEEDBACK_INTENSITY, and VIBRATE_WHEN_RINGING in favor or RING_VIBRATION_INTENSITY. Introduce hidden flag VibrationAttributes.FLAG_BYPASS_USER_VIBRATION_INTENSITY_OFF to represent HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING in the vibrator service. This is applied by: - PhoneWindowManager, that converts HapticFeedbackConstants into (VibrationEffect, VibrationAttributes). - CellBroadcastAlertAudio, that triggers alerts using AudioAttributes with flags FLAG_BYPASS_INTERRUPTION_POLICY (that translates to same flag in VibratorManager, to bypass DnD) and FLAG_BYPASS_MUTE (that translates to this new flag, to bypass the new alarm intensity settings). The new flag is erased from request that are not from privileged apps, similar to the other bypass flag. The public HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING has also been deprecated in T with a documentation explaining the removal of platform support. Remove SysUI dependencies on the deprecated settings, it should use the USAGE_TOUCH attribute and rely on the vibrator service to apply the user settings. Keep other SysUI dependencies that needs to run in older Android versions (like Launcher3). Bug: 185351540 Test: VibrationSettingsTest + manual Change-Id: I0372e4db19e09523795d7e79b9f7a15ae48a8cd9
Loading
Please register or sign in to comment