1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 18:15:49 +01:00

Make DeviceSupportFactory recognize device names starting with MI

This commit is contained in:
Sergey Trofimov 2015-10-18 09:20:18 +03:00
parent f0a1d5f8a0
commit 1c1f8e8535

View File

@ -79,7 +79,7 @@ public class DeviceSupportFactory {
try {
BluetoothDevice btDevice = mBtAdapter.getRemoteDevice(deviceAddress);
if (btDevice.getName() == null || btDevice.getName().equals("MI")) { //FIXME: workaround for Miband not being paired
if (btDevice.getName() == null || btDevice.getName().startsWith("MI")) { //FIXME: workaround for Miband not being paired
gbDevice = new GBDevice(deviceAddress, "MI", DeviceType.MIBAND);
deviceSupport = new ServiceDeviceSupport(new MiBandSupport(), EnumSet.of(ServiceDeviceSupport.Flags.THROTTLING, ServiceDeviceSupport.Flags.BUSY_CHECKING));
} else if (btDevice.getName().indexOf("Pebble") == 0) {