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

Commit fc55bb9a 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:...

Merge "Fix vibration patterns with zero duration steps." into main am: f02ed4e5 am: 61f0d188 am: eea99a3d am: 57581fa7 am: 86304c42

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2653965



Change-Id: Ib693b11c54518a9f676c3dfcb9abdfbf80cb3786
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f64044c7 86304c42
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -179,7 +179,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();