mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
workaround for missing Miband pairing (assume Miband when device name is not set)
This commit is contained in:
+6
-5
@@ -256,15 +256,16 @@ public class BluetoothCommunicationService extends Service {
|
||||
BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(btDeviceAddress);
|
||||
if (btDevice != null) {
|
||||
GBDevice.Type deviceType = GBDevice.Type.UNKNOWN;
|
||||
if (btDevice.getName().indexOf("Pebble") == 0) {
|
||||
deviceType = GBDevice.Type.PEBBLE;
|
||||
mGBDeviceProtocol = new PebbleProtocol();
|
||||
mGBDeviceIoThread = new PebbleIoThread(btDeviceAddress);
|
||||
} else if (btDevice.getName().equals("MI")) {
|
||||
if (btDevice.getName() == null || btDevice.getName().equals("MI")) { //FIXME: workaround for Miband not being paired
|
||||
deviceType = GBDevice.Type.MIBAND;
|
||||
mGBDeviceProtocol = new MibandProtocol();
|
||||
mGBDeviceIoThread = new MibandIoThread(btDeviceAddress);
|
||||
}
|
||||
else if (btDevice.getName().indexOf("Pebble") == 0) {
|
||||
deviceType = GBDevice.Type.PEBBLE;
|
||||
mGBDeviceProtocol = new PebbleProtocol();
|
||||
mGBDeviceIoThread = new PebbleIoThread(btDeviceAddress);
|
||||
}
|
||||
if (mGBDeviceProtocol != null) {
|
||||
mGBDevice = new GBDevice(btDeviceAddress, btDevice.getName(), deviceType);
|
||||
mGBDevice.setState(GBDevice.State.CONNECTING);
|
||||
|
||||
Reference in New Issue
Block a user