summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lais Andrade <lsandrade@google.com> 2024-06-10 10:30:19 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-06-10 10:30:19 +0000
commitd5adf387afc79039c536b30e059103df423f1f17 (patch)
treeb9f6f7db6b7206aced2b95f869b858e0e0ce0a1c
parent1b2e31dd9ba9c2a69c6c087d8427a8f3f17f8620 (diff)
parent2760a7804c467f767d691fab3c8d440f9be7c2cd (diff)
Merge "Fix flaky VibrationThread test with multiple vibrations." into main
-rw-r--r--services/tests/vibrator/src/com/android/server/vibrator/VibrationThreadTest.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/tests/vibrator/src/com/android/server/vibrator/VibrationThreadTest.java b/services/tests/vibrator/src/com/android/server/vibrator/VibrationThreadTest.java
index 19ce217e581c..9dac23f075e6 100644
--- a/services/tests/vibrator/src/com/android/server/vibrator/VibrationThreadTest.java
+++ b/services/tests/vibrator/src/com/android/server/vibrator/VibrationThreadTest.java
@@ -1681,7 +1681,7 @@ public class VibrationThreadTest {
.addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
.compose();
VibrationEffect effect4 = VibrationEffect.createOneShot(8000, 100);
- VibrationEffect effect5 = VibrationEffect.createOneShot(20, 222);
+ VibrationEffect effect5 = VibrationEffect.get(VibrationEffect.EFFECT_CLICK);
long vibrationId1 = startThreadAndDispatcher(effect1);
waitForCompletion();
@@ -1745,13 +1745,12 @@ public class VibrationThreadTest {
verifyCallbacksTriggered(vibrationId4, Vibration.Status.CANCELLED_BY_SCREEN_OFF);
assertTrue("Tested duration=" + duration4, duration4 < 2000);
- // Effect5: normal oneshot. Don't worry about amplitude, as effect4 may or may not have
- // started.
+ // Effect5: played normally after effect4, which may or may not have played.
verify(mControllerCallbacks).onComplete(eq(VIBRATOR_ID), eq(vibrationId5));
verifyCallbacksTriggered(vibrationId5, Vibration.Status.FINISHED);
- assertEquals(Arrays.asList(expectedOneShot(20)),
+ assertEquals(Arrays.asList(expectedPrebaked(VibrationEffect.EFFECT_CLICK)),
fakeVibrator.getEffectSegments(vibrationId5));
}