Apply USAGE_IME_FEEDBACK to HapticFeedbackVibrationProvider
Also Remove FLAG_BYPASS_USER_VIBRATION_INTENSITY_SCALE check logic in HapticFeedbackVibrationProvider and the flag itself introduced from CL[1] for clean-up. Since the current vibration and default vibration for IME feedback are both medium level currently, means there is no additional scaling from current settings for the keyboard vibration effect in VibrationScaler, so scale behavior can keep applying the fixed vibration amplititude (0.62) as before. In the next CL, we will remove VibrationAttritubute#CATEGORY_KEYBOARD and its logic in framework and Settings, since USAGE_IME_FEEDBACK can fully replace the behavior with preserving scaling keyboard vibration from settings flexibility. [1]: I67c95718d11fb429083e1bc9dcab6e1bc85249fc Flag: android.os.vibrator.vibration_attribute_ime_usage_api Bug: 332661766 Test: manual as below steps 0) Enable "Keyboard vibration" in Vibration & haptics Settings 1) In launcher, tap google search box to show IME. 2) typing charactors & verify keyboard is vibrating 3) use adb command: adb dumpsys vibrator_manager, verify the vibration effect history shows as below scale: NONE (adaptive=1.00) |flags: 0 <-- no bypass flag usage: IME | category=KEYBOARD ...\ reason: performHapticFeedback(constant=3): \ View#performHapticFeedback | \ played: Primitive=CLICK(scale=0.62, delay=0ms) <-- same amplitudue Test: atest VibrationSettingsTest, VibrationScalerTest Test: atest HapticFeedbackVibrationProviderTest Change-Id: I764aa8bd72889d4af62b30bff75af9033f22052b
Loading
Please register or sign in to comment