don't spam crashlytics with non-bug reports

pull/72/head
geeksville 2020-06-30 12:02:12 -07:00
rodzic 4571eeea2a
commit 0349e823f8
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -169,6 +169,7 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
* this is created in onCreate()
* We do an ugly hack of keeping it in the singleton so we can share it for the rare software update case
*/
@Volatile
var safe: SafeBluetooth? = null
}
@ -332,7 +333,10 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
delay(1000) // Give some nasty time for buggy BLE stacks to shutdown (500ms was not enough)
reconnectJob = null // Any new reconnect requests after this will be allowed to run
warn("Attempting reconnect")
startConnect()
if (safe != null) // check again, because we just slept for 1sec, and someone might have closed our interface
startConnect()
else
warn("Not connecting, because safe==null, someone must have closed us")
} else {
warn("Abandoning reconnect because safe==null, someone must have closed the device")
}