fix(input): stop controller rumble when the device sleeps (#1668)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-27 13:14:23 -04:00
1 parent f07dd5eb97
commit ef9866e423
3 files changed
+26 -1

No files matched your search

@@ -115,6 +115,22 @@ class RumbleComponentTest {
assertFalse(pad.vibrating)
}
@Test fun quietingStopsAHeldEffectAndDropsEffectsUntilLifted() {
val pad = FakeMotors()
rumble.controllerMotors = { pad }
activeController(PAD_ID)
effect(strong = 40000, weak = 20000, ms = RumbleComponent.HOLD_MS)
rumble.quiet(true)
assertFalse(pad.vibrating)
idle(RumbleComponent.KEEPALIVE_MS * 4 + 100)
assertEquals("the keepalive restarted the motors while quiet", 1, pad.played.size)
effect(strong = 40000, weak = 20000)
assertFalse("an effect played while quiet", pad.vibrating)
rumble.quiet(false)
effect(strong = 40000, weak = 20000)
assertTrue(pad.vibrating)
}
@Test fun aHeldEffectFollowsTheGamesNewStrength() {
val pad = FakeMotors()
rumble.controllerMotors = { pad }