prevent NPE

This commit is contained in:
Milos Kozak 2021-01-15 13:37:30 +01:00
parent 534b27cb71
commit d300a95e39

View file

@ -81,11 +81,13 @@ public class QueueThread extends Thread {
pump.stopConnecting();
pump.disconnect("watchdog");
SystemClock.sleep(1000);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.disable();
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter != null) {
bluetoothAdapter.disable();
SystemClock.sleep(1000);
mBluetoothAdapter.enable();
bluetoothAdapter.enable();
SystemClock.sleep(1000);
}
//start over again once after watchdog barked
//Notification notification = new Notification(Notification.OLD_NSCLIENT, "Watchdog", Notification.URGENT);
//rxBus.send(new EventNewNotification(notification));