Merge "Fix vibration patterns with zero duration steps." into main am: f02ed4e522 am: 61f0d18896
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2653965 Change-Id: I4e23c5cb3dc4d0fe20653ed7648acc2bd34c4cff 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) {
|
while (i < segmentCount) {
|
||||||
VibrationEffectSegment segment = segments.get(i);
|
VibrationEffectSegment segment = segments.get(i);
|
||||||
if (!(segment instanceof StepSegment)
|
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;
|
break;
|
||||||
}
|
}
|
||||||
timing += segment.getDuration();
|
timing += segment.getDuration();
|
||||||
|
|||||||
Reference in New Issue
Block a user