Introduce USAGE_IME_FEEDBACK & default keyboard vibration intensity config
The CL is to prepare clean-up FLAG_BYPASS_USER_VIBRATION_INTENSITY_SCALE
check for keyboard vibration in VibratorManagerService (VMS).
With USAGE_IME_FEEDBACK hint, the keyboard vibration can be allowed to get
the current / default vibration intensity in VMS more natually through
config_defaultKeyboardVibrationIntensity in config.xml.
Note that in VibrationSettings#{getDefaultIntensity, getCurrentIntensity}
will apply the default keyboard vibration intensity when enabling keyboard
vibration settings support, otherwise will fallback to USAGE_TOUCH default
intensity.
Also ensure in VibrationAttriribute#getAudioUsage(usageHint) to return
the corresponding audio attribute USAGE_ASSISTANCE_SONIFICATION as
usage_touch for IME feedback hint.
In the next CL, we will apply this new usage hint so keyboard vibrations
can be handled by the scale logic in VibratorScaler vs. bypassing it.
Flag: android.os.vibrator.vibration_attribute_ime_usage_api
Bug: 332661766
Test: atest VibratorManagerServiceTest
Test: atest VibrationSettingsTest
Change-Id: I6256c4f47a8bbee4b649d35eabfbc0c94215c0d7
Loading
Please register or sign in to comment