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

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

Merge "Fix VibrationThreadTest for unsupported primitives" into main

parents a3728173 721b28d0
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -747,6 +747,23 @@ public class VibrationThreadTest {
    }

    @Test
    @DisableFlags(Flags.FLAG_PRIMITIVE_COMPOSITION_ABSOLUTE_DELAY)
    public void vibrate_singleVibratorComposedAndNoCapability_triggersHalAndReturnsUnsupported() {
        VibrationEffect effect = VibrationEffect.startComposition()
                .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 1f)
                .compose();
        HalVibration vibration = startThreadAndDispatcher(effect);
        waitForCompletion();

        verify(mManagerHooks).noteVibratorOn(eq(UID), eq(0L));
        verify(mManagerHooks, never()).noteVibratorOff(eq(UID));
        verify(mControllerCallbacks, never()).onComplete(eq(VIBRATOR_ID), eq(vibration.id));
        verifyCallbacksTriggered(vibration, Status.IGNORED_UNSUPPORTED);
        assertTrue(mVibratorProviders.get(VIBRATOR_ID).getEffectSegments(vibration.id).isEmpty());
    }

    @Test
    @EnableFlags(Flags.FLAG_PRIMITIVE_COMPOSITION_ABSOLUTE_DELAY)
    public void vibrate_singleVibratorComposedAndNoCapability_ignoresVibration() {
        VibrationEffect effect = VibrationEffect.startComposition()
                .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 1f)