Remove VibrationAttributes#CATEGORY_KEYBOARD (in Settings)

Since CL[1], [2] introduced USAGE_IME_FEEDBACK in VibrationAttributes
to be able to specify default / current vibration in VibrationSettings
according to the vibration usage naturally without using this category
attribute + a bypass flag to only support a fixed vibration scaling.

Remove CATEGORY_KEYBOARD attribute and replacing with USAGE_IME_FEEDBACK
in Settings for cleaning up logic.

[1]: I6256c4f47a8bbee4b649d35eabfbc0c94215c0d7
[2]: I764aa8bd72889d4af62b30bff75af9033f22052b

Flag: EXEMPT refactor
Bug: 332661766
Test: atest KeyboardVibrationTogglePreferenceControllerTest
Change-Id: I532e7d184d235bfa266fb590e60802c4e2fa7df2
This commit is contained in:
Ming-Shin Lu
2024-07-31 18:09:46 +00:00
parent e3702e9b14
commit 8ec4d71630
2 changed files with 6 additions and 23 deletions

View File

@@ -68,19 +68,8 @@ public abstract class VibrationPreferenceConfig {
/** Play a vibration effect with intensity just selected by the user. */
public static void playVibrationPreview(Vibrator vibrator,
@VibrationAttributes.Usage int vibrationUsage) {
playVibrationPreview(vibrator, createPreviewVibrationAttributes(vibrationUsage));
}
/**
* Play a vibration effect with intensity just selected by the user.
*
* @param vibrator The {@link Vibrator} used to play the vibration.
* @param vibrationAttributes The {@link VibrationAttributes} to indicate the
* vibration information.
*/
public static void playVibrationPreview(Vibrator vibrator,
VibrationAttributes vibrationAttributes) {
vibrator.vibrate(PREVIEW_VIBRATION_EFFECT, vibrationAttributes);
vibrator.vibrate(PREVIEW_VIBRATION_EFFECT,
createPreviewVibrationAttributes(vibrationUsage));
}
public VibrationPreferenceConfig(Context context, String settingKey,