mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 02:25:50 +01:00
Small improvement to connect()
This commit is contained in:
parent
3b94a96060
commit
ac120dc7d6
@ -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();
|
||||
}
|
||||
if (result) {
|
||||
setDeviceConnectionState(State.CONNECTING);
|
||||
return true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void setDeviceConnectionState(State newState) {
|
||||
|
Loading…
Reference in New Issue
Block a user