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

Commit 9afbd46d authored by Ahmad Khalil's avatar Ahmad Khalil Committed by Android (Google) Code Review
Browse files

Merge "Update envelope effects dependencies" into main

parents 924fd9ad 4bd85691
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -316,9 +316,7 @@ public class VibratorInfo implements Parcelable {
     * @return True if the hardware can control the frequency of the vibrations, otherwise false.
     */
    public boolean hasFrequencyControl() {
        // We currently can only control frequency of the vibration using the compose PWLE method.
        return hasCapability(
                IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS);
        return hasCapability(IVibrator.CAP_FREQUENCY_CONTROL);
    }

    /**
@@ -481,7 +479,8 @@ public class VibratorInfo implements Parcelable {
     * @return True if the hardware supports creating envelope effects, false otherwise.
     */
    public boolean areEnvelopeEffectsSupported() {
        return hasCapability(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2);
        return hasCapability(
                IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2);
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -71,8 +71,7 @@ public class VibratorInfoTest {
        VibratorInfo noCapabilities = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
        assertFalse(noCapabilities.hasFrequencyControl());
        VibratorInfo composeAndFrequencyControl = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
                .setCapabilities(
                        IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS)
                .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
                .build();
        assertTrue(composeAndFrequencyControl.hasFrequencyControl());
    }
@@ -153,7 +152,8 @@ public class VibratorInfoTest {
        VibratorInfo noCapabilities = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
        assertFalse(noCapabilities.areEnvelopeEffectsSupported());
        VibratorInfo envelopeEffectCapability = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
                .setCapabilities(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2)
                .setCapabilities(
                        IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2)
                .build();
        assertTrue(envelopeEffectCapability.areEnvelopeEffectsSupported());
    }