Create View.performHapticFeedback API that takes vibration usage
The preexisting haptic feedback APIs statically derived the vibration usage for each feedback constants. This meant that a given constant could only be played with that statically defined usage. To enable a more dynamic usage of haptic feedback, we are adding a performHapticFeedback API that allows specifying the vibration usage for the feedback. This usage should be of USAGE_CLASS_FEEDBACK. Other than this difference, this new API works the same way as the existing haptic feedback APIs. Bug: 397602072 Bug: 408393305 Test: atest VibratorManagerServiceTest Test: atest ViewTest Test: atest HapticFeedbackVibrationProviderTest Flag: android.os.vibrator.haptic_feedback_with_custom_usage Test: adb shell cmd vibrator_manager feedback -u 50 0 Change-Id: I7fdeeef0b80c978cacda06cc3d090c5fc827cbd8
Loading
Please register or sign in to comment