cancel rumble on disconnect

hide system bar in StreamScreen.kt
This commit is contained in:
2026-06-18 17:20:57 +02:00
parent 73595bdf5f
commit 9e33e1adfd
2 changed files with 17 additions and 2 deletions
@@ -78,9 +78,11 @@ class GamepadFeedback(private val handle: Long) {
/** Idempotent. Stops + joins the poll threads (must complete before the session handle is freed). */
fun stop() {
running = false
rumbleThread?.interrupt()
hidoutThread?.interrupt()
runCatching { vm?.cancel() } // drop any held rumble immediately
runCatching { rumbleThread?.join(500) }
runCatching { hidoutThread?.join(500) }
runCatching { rumbleThread?.join(200) }
runCatching { hidoutThread?.join(200) }
rumbleThread = null
hidoutThread = null
runCatching { lightsSession?.close() }