1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-25 17:42:29 +02:00

catch all exceptions on Bluetooth scan stop

This commit is contained in:
oliexdev
2019-10-13 09:47:50 +02:00
parent c22532e44b
commit bad06f227d

View File

@@ -232,7 +232,12 @@ public abstract class BluetoothCommunication {
public void disconnect() {
Timber.d("Bluetooth disconnect");
setBluetoothStatus(BT_STATUS.CONNECTION_DISCONNECT);
central.stopScan();
try {
central.stopScan();
} catch (Exception ex) {
Timber.e("Error on Bluetooth disconnecting " + ex.getMessage());
}
if (btPeripheral != null) {
central.cancelConnection(btPeripheral);
}