Merge "Fix vibration patterns with zero duration steps." into main am: f02ed4e522
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2653965 Change-Id: Ifdde4463a792982315ea36a0e6aae3483ae230e7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user