forked from upstream-mirrors/OpenTracks
BLE sensors: faster connection.
This commit is contained in:
@@ -136,9 +136,9 @@ public abstract class BluetoothConnectionManager<DataType> {
|
|||||||
Log.d(TAG, "Connecting to: " + device);
|
Log.d(TAG, "Connecting to: " + device);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
bluetoothGatt = device.connectGatt(context, true, connectCallback, BluetoothDevice.TRANSPORT_AUTO, 0, this.observer.getHandler());
|
bluetoothGatt = device.connectGatt(context, false, connectCallback, BluetoothDevice.TRANSPORT_AUTO, 0, this.observer.getHandler());
|
||||||
} else {
|
} else {
|
||||||
bluetoothGatt = device.connectGatt(context, true, connectCallback);
|
bluetoothGatt = device.connectGatt(context, false, connectCallback);
|
||||||
}
|
}
|
||||||
SensorData<?> sensorData = createEmptySensorData(bluetoothGatt.getDevice().getAddress());
|
SensorData<?> sensorData = createEmptySensorData(bluetoothGatt.getDevice().getAddress());
|
||||||
observer.onChanged(sensorData);
|
observer.onChanged(sensorData);
|
||||||
|
|||||||
Reference in New Issue
Block a user