Small improvement to connect()

here
cpfeiffer 2015-10-22 00:32:16 +02:00
parent 3b94a96060
commit ac120dc7d6
1 changed files with 6 additions and 3 deletions

View File

@ -155,12 +155,15 @@ public final class BtLEQueue {
}
LOG.info("Attempting to connect to " + mGbDevice.getName());
BluetoothDevice remoteDevice = mBluetoothAdapter.getRemoteDevice(mGbDevice.getAddress());
boolean result;
synchronized (mGattMonitor) {
mBluetoothGatt = remoteDevice.connectGatt(mContext, true, internalGattCallback);
mBluetoothGatt.connect();
result = mBluetoothGatt.connect();
}
setDeviceConnectionState(State.CONNECTING);
return true;
if (result) {
setDeviceConnectionState(State.CONNECTING);
}
return result;
}
private void setDeviceConnectionState(State newState) {