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

Commit f02ed4e5 authored by Ahmad Khalil's avatar Ahmad Khalil Committed by Gerrit Code Review
Browse files

Merge "Fix vibration patterns with zero duration steps." into main

parents c2e02586 de483500
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -167,7 +167,9 @@ final class SetAmplitudeVibratorStep extends AbstractVibratorStep {
        while (i < segmentCount) {
            VibrationEffectSegment segment = segments.get(i);
            if (!(segment instanceof StepSegment)
                    || ((StepSegment) segment).getAmplitude() == 0) {
                    // play() will ignore segments with zero duration, so it's important that
                    // zero-duration segments don't affect this method.
                    || (segment.getDuration() > 0 && ((StepSegment) segment).getAmplitude() == 0)) {
                break;
            }
            timing += segment.getDuration();