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

Commit 61f0d188 authored by Ahmad Khalil's avatar Ahmad Khalil Committed by Automerger Merge Worker
Browse files

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

parents 7ff75ffe f02ed4e5
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();