add support for reconnecting if bluetooth gets disabled

1.2-legacy
Kevin Hester 2020-03-02 08:05:43 -08:00
rodzic 9a2c22d0f6
commit 90cee2f202
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -355,7 +355,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
// more info.
// Otherwise if you pass in false, it will try to connect now and will timeout and fail in 30 seconds.
private fun queueConnect(autoConnect: Boolean = false, cont: Continuation<Unit>) {
assert(gatt == null);
// assert(gatt == null) this now might be !null with our new reconnect support
queueWork("connect", cont) {
val g = device.connectGatt(context, autoConnect, gattCallback)
if (g != null)