mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
fix(input): a failing BLE disconnect no longer ends the app or the unit test run (#2670)
This commit is contained in:
1 parent
fb14b99d50
commit
605f85b4b9
2 files changed
+13
-5
No files matched your search
@@ -129,8 +129,9 @@ class SteamControllerBle(private val context: Context, router: InputRouter? = nu
|
||||
}
|
||||
}
|
||||
}
|
||||
g.disconnect()
|
||||
g.close()
|
||||
// Android can refuse these (BLUETOOTH_CONNECT revoked); an exception on this thread would end the app.
|
||||
runCatching { g.disconnect() }.onFailure { Log.w(TAG, "disconnect failed", it) }
|
||||
runCatching { g.close() }.onFailure { Log.w(TAG, "close failed", it) }
|
||||
Log.i(TAG, "disconnected: $why")
|
||||
listener?.invoke()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user