prevent NPE
This commit is contained in:
parent
534b27cb71
commit
d300a95e39
1 changed files with 7 additions and 5 deletions
|
@ -81,11 +81,13 @@ public class QueueThread extends Thread {
|
||||||
pump.stopConnecting();
|
pump.stopConnecting();
|
||||||
pump.disconnect("watchdog");
|
pump.disconnect("watchdog");
|
||||||
SystemClock.sleep(1000);
|
SystemClock.sleep(1000);
|
||||||
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||||
mBluetoothAdapter.disable();
|
if (bluetoothAdapter != null) {
|
||||||
|
bluetoothAdapter.disable();
|
||||||
SystemClock.sleep(1000);
|
SystemClock.sleep(1000);
|
||||||
mBluetoothAdapter.enable();
|
bluetoothAdapter.enable();
|
||||||
SystemClock.sleep(1000);
|
SystemClock.sleep(1000);
|
||||||
|
}
|
||||||
//start over again once after watchdog barked
|
//start over again once after watchdog barked
|
||||||
//Notification notification = new Notification(Notification.OLD_NSCLIENT, "Watchdog", Notification.URGENT);
|
//Notification notification = new Notification(Notification.OLD_NSCLIENT, "Watchdog", Notification.URGENT);
|
||||||
//rxBus.send(new EventNewNotification(notification));
|
//rxBus.send(new EventNewNotification(notification));
|
||||||
|
|
Loading…
Reference in a new issue