From 0d63e5b77028a6a94af157aeea6abe714dd45649 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Tue, 8 Dec 2015 21:48:25 +0100 Subject: [PATCH] User Info is probably the same for MI 1A and 1S #178 Can you please test whether this fixes the connection problems? --- .../gadgetbridge/devices/miband/UserInfo.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/UserInfo.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/UserInfo.java index cccb2d7ba6..48439da7de 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/UserInfo.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/UserInfo.java @@ -5,9 +5,6 @@ import java.util.Arrays; -/** - * Created by UgoRaffaele on 30/01/2015. - */ public class UserInfo { private final String btAddress; @@ -62,7 +59,7 @@ private UserInfo(String address, String alias, int gender, int age, int height, } private int calculateUidFrom(String alias) { - int uid = 0; + int uid; try { uid = Integer.parseInt(alias); } catch (NumberFormatException ex) { @@ -87,7 +84,7 @@ public byte[] getData(DeviceInfo mDeviceInfo) { sequence[8] = (byte) (type & 0xff); int aliasFrom = 9; - if (mDeviceInfo.isMili1A()) { + if (mDeviceInfo.isMili1A() || mDeviceInfo.isMilli1S()) { sequence[9] = (byte) (mDeviceInfo.feature & 255); sequence[10] = (byte) (mDeviceInfo.appearance & 255); aliasFrom = 11;