Attempt to fix reconnection problems after being away from the Mi Band
*untested*
This commit is contained in:
parent
c407ed1a76
commit
bdc9e70e6e
|
@ -147,13 +147,11 @@ public final class BtLEQueue {
|
||||||
}
|
}
|
||||||
LOG.info("Attempting to connect to " + mGbDevice.getName());
|
LOG.info("Attempting to connect to " + mGbDevice.getName());
|
||||||
BluetoothDevice remoteDevice = mBluetoothAdapter.getRemoteDevice(mGbDevice.getAddress());
|
BluetoothDevice remoteDevice = mBluetoothAdapter.getRemoteDevice(mGbDevice.getAddress());
|
||||||
boolean result = false;
|
|
||||||
synchronized (mGattMonitor) {
|
synchronized (mGattMonitor) {
|
||||||
mBluetoothGatt = remoteDevice.connectGatt(mContext, false, internalGattCallback);
|
mBluetoothGatt = remoteDevice.connectGatt(mContext, true, internalGattCallback);
|
||||||
result = mBluetoothGatt.connect();
|
|
||||||
}
|
}
|
||||||
setDeviceConnectionState(result ? State.CONNECTING : State.NOT_CONNECTED);
|
setDeviceConnectionState(State.CONNECTING);
|
||||||
return result;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDeviceConnectionState(State newState) {
|
private void setDeviceConnectionState(State newState) {
|
||||||
|
|
Loading…
Reference in New Issue