X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTelemetryService.java;h=ed7b75a1ef1ab470ad4ecc39ed5cdeb25aa635f9;hp=82c546c52377a302ad5f493909e9b94365d5cb50;hb=bca342577740a9d04b8419ecadcff582e77f1e61;hpb=7975d088a4ac44c0943134fa41d0e3b88f50b98f;ds=sidebyside diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java index 82c546c5..ed7b75a1 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java @@ -341,12 +341,6 @@ public class TelemetryService extends Service implements LocationListener { BluetoothDevice device = bluetooth_adapter.getRemoteDevice(address.address); disconnect(false); - if (pause) { - try { - Thread.sleep(4000); - } catch (InterruptedException e) { - } - } this.address = address; if (D) Log.d(TAG, String.format("start_altos_bluetooth(): Connecting to %s (%s)", device.getName(), device.getAddress())); altos_link = new AltosBluetooth(device, handler); @@ -450,12 +444,14 @@ public class TelemetryService extends Service implements LocationListener { // Move us into the foreground. startForeground(NOTIFICATION, notification); - String action = intent.getAction(); + if (intent != null) { + String action = intent.getAction(); - if (action.equals(AltosDroid.ACTION_BLUETOOTH)) { - DeviceAddress address = AltosDroidPreferences.active_device(); - if (address != null && !address.address.startsWith("USB")) - start_altos_bluetooth(address, false); + if (action.equals(AltosDroid.ACTION_BLUETOOTH)) { + DeviceAddress address = AltosDroidPreferences.active_device(); + if (address != null && !address.address.startsWith("USB")) + start_altos_bluetooth(address, false); + } } // We want this service to continue running until it is explicitly