mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 04:46:51 +01:00
Experimental support for #274 (untested yet)
This commit is contained in:
parent
5efe9a5eb8
commit
5963843216
@ -26,6 +26,7 @@ public final class MiBandConst {
|
||||
public static final String MI_1 = "1";
|
||||
public static final String MI_1A = "1A";
|
||||
public static final String MI_1S = "1S";
|
||||
public static final String MI_AMAZFIT = "Amazfit";
|
||||
|
||||
public static int getNotificationPrefIntValue(String pref, String origin, Prefs prefs, int defaultValue) {
|
||||
String key = getNotificationPrefKey(pref, origin);
|
||||
|
@ -85,7 +85,7 @@ public class UserInfo {
|
||||
sequence[8] = (byte) (type & 0xff);
|
||||
|
||||
int aliasFrom = 9;
|
||||
if (mDeviceInfo.isMili1A() || mDeviceInfo.isMili1S()) {
|
||||
if (!mDeviceInfo.isMili1()) {
|
||||
sequence[9] = (byte) (mDeviceInfo.feature & 255);
|
||||
sequence[10] = (byte) (mDeviceInfo.appearance & 255);
|
||||
aliasFrom = 11;
|
||||
|
@ -112,6 +112,10 @@ public class DeviceInfo extends AbstractInfo {
|
||||
return (feature == 4 && appearance == 0) || hwVersion == 4;
|
||||
}
|
||||
|
||||
public boolean isAmazFit() {
|
||||
return hwVersion == 6;
|
||||
}
|
||||
|
||||
public String getHwVersion() {
|
||||
if (isMili1()) {
|
||||
return MiBandConst.MI_1;
|
||||
@ -122,6 +126,9 @@ public class DeviceInfo extends AbstractInfo {
|
||||
if (isMili1S()) {
|
||||
return MiBandConst.MI_1S;
|
||||
}
|
||||
if (isAmazFit()) {
|
||||
return MiBandConst.MI_AMAZFIT;
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user