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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user