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

Commit 18da4ad8 authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Updating BIOMETRIC_* vibration attributes to USAGE_HARDWARE_FEEDBACK

The haptic feedback constants for biometric confirm and reject are
updated to use USAGE_HARDWARE_FEEDBACK vibration attributes. This makes
them consistent with the authentication feedback provided by the system.

Test: Modified Unit tests
Flag: EXEMPT consistency change to vibration attributes
Bug: 436157447
Change-Id: I93b077496774ab9978b5f5e3d7be3a385e5fd2cc
parent cda0f42f
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);
        }
    }