From 820a5b98009fae4dbb155e372817abfb262b10fb Mon Sep 17 00:00:00 2001 From: Vitaliy Tomin Date: Mon, 23 Sep 2024 16:20:38 +0800 Subject: [PATCH] huawei: Add non pro version of Watch 4 * it was missing in current watch4pro coordinator --- .../gadgetbridge/devices/huawei/HuaweiConstants.java | 1 + .../huawei/huaweiwatch4pro/HuaweiWatch4ProCoordinator.java | 2 +- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java index 490ea8ba5..6a9340149 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiConstants.java @@ -77,6 +77,7 @@ public final class HuaweiConstants { public static final String HU_WATCHFIT2_NAME = "huawei watch fit 2-"; public static final String HU_WATCHFIT3_NAME = "huawei watch fit 3-"; public static final String HU_WATCHULTIMATE_NAME = "huawei watch ultimate-"; + public static final String HU_WATCH4_NAME = "huawei watch 4-"; public static final String HU_WATCH4PRO_NAME = "huawei watch 4 pro-"; public static final String PREF_HUAWEI_ADDRESS = "huawei_address"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatch4pro/HuaweiWatch4ProCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatch4pro/HuaweiWatch4ProCoordinator.java index 0fb94512f..9a3a273ae 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatch4pro/HuaweiWatch4ProCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/huaweiwatch4pro/HuaweiWatch4ProCoordinator.java @@ -36,7 +36,7 @@ public class HuaweiWatch4ProCoordinator extends HuaweiBRCoordinator { @Override protected Pattern getSupportedDeviceName() { - return Pattern.compile("(" + HuaweiConstants.HU_WATCH4PRO_NAME + ").*", Pattern.CASE_INSENSITIVE); + return Pattern.compile("(" + HuaweiConstants.HU_WATCH4_NAME + "|" + HuaweiConstants.HU_WATCH4PRO_NAME + ").*", Pattern.CASE_INSENSITIVE); } @Override diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 40a78893f..fe964546c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1840,7 +1840,7 @@ Huawei Watch Fit 3 Huawei Watch Ultimate Huawei Watch 3 (Pro) - Huawei Watch 4 Pro + Huawei Watch 4 (Pro) Femometer Vinca II Xiaomi Watch Lite Redmi Watch 3 Active