From 90cee2f20243ce332523506a1171e3a1a499303e Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 2 Mar 2020 08:05:43 -0800 Subject: [PATCH] add support for reconnecting if bluetooth gets disabled --- app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt b/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt index 891aa28f..abd95a1b 100644 --- a/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt +++ b/app/src/main/java/com/geeksville/mesh/service/SafeBluetooth.kt @@ -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) { - 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)