Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8628e3a4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Updating BIOMETRIC_* vibration attributes to USAGE_HARDWARE_FEEDBACK" into main

parents 9ce8bca5 18da4ad8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ public final class HapticFeedbackVibrationProvider {
                break;
            case HapticFeedbackConstants.BIOMETRIC_CONFIRM:
            case HapticFeedbackConstants.BIOMETRIC_REJECT:
                attrs = COMMUNICATION_REQUEST_VIBRATION_ATTRIBUTES;
                attrs = HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES;
                break;
            default:
                attrs = TOUCH_VIBRATION_ATTRIBUTES;
+2 −2
Original line number Diff line number Diff line
@@ -402,13 +402,13 @@ public class HapticFeedbackVibrationProviderTest {
    }

    @Test
    public void testVibrationAttribute_biometricConstants_defaultsToCommunicationRequestUsage() {
    public void testVibrationAttribute_biometricConstants_defaultsToHardwareUsage() {
        HapticFeedbackVibrationProvider provider = createProviderWithoutCustomizations();

        for (int effectId : BIOMETRIC_FEEDBACK_CONSTANTS) {
            VibrationAttributes attrs = provider.getVibrationAttributes(
                    effectId, USAGE_UNKNOWN, /* flags */ 0, /* privFlags */ 0);
            assertThat(attrs.getUsage()).isEqualTo(VibrationAttributes.USAGE_COMMUNICATION_REQUEST);
            assertThat(attrs.getUsage()).isEqualTo(VibrationAttributes.USAGE_HARDWARE_FEEDBACK);
        }
    }