make sure to only reconnect when device is in "waiting for reconnect state"

here
Andreas Shimokawa 2016-05-29 21:44:43 +02:00
parent af14fb4f90
commit 4533c80c95
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ public class BluetoothConnectReceiver extends BroadcastReceiver {
GBDevice gbDevice = service.getGBDevice();
if (gbDevice != null) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if (device.getAddress().equals(gbDevice.getAddress())) {
if (device.getAddress().equals(gbDevice.getAddress()) && gbDevice.getState() == GBDevice.State.WAITING_FOR_RECONNECT) {
LOG.info("will connect to " + gbDevice.getName());
GBApplication.deviceService().connect();
} else {