diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/freearc/HuaweiFreearcCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/freearc/HuaweiFreearcCoordinator.java new file mode 100644 index 0000000000..6e043271f5 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/freearc/HuaweiFreearcCoordinator.java @@ -0,0 +1,64 @@ +/* Copyright (C) 2025 + + This file is part of Gadgetbridge. + + Gadgetbridge is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Gadgetbridge is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . */ + +package nodomain.freeyourgadget.gadgetbridge.devices.huawei.freearc; + +import androidx.annotation.NonNull; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.regex.Pattern; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiFreebudsCoordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiHeadphonesCapabilities; +import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; +import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; +import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport; +import nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiFreebudsSupport; + +public class HuaweiFreearcCoordinator extends HuaweiFreebudsCoordinator { + + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("huawei freearc", Pattern.CASE_INSENSITIVE); + } + + @Override + public Set getCapabilities() { + return new HashSet<>( + // None + ); + } + + @NonNull + @Override + public Class getDeviceSupportClass(final GBDevice device) { + return HuaweiFreebudsSupport.class; + } + + @Override + public DeviceType getDeviceType() { + return DeviceType.HUAWEI_FREEARC; + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_huawei_freearc; + } +} diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java index a4dcaf61bc..c10ad0929d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -223,6 +223,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.Amazfit import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitTRex3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.AmazfitTRexUltraCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huami.zeppos.watches.MiBand7Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freearc.HuaweiFreearcCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freebuds5i.HuaweiFreebuds5iCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freebuds6.HuaweiFreebuds6Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.freebudspro.HuaweiFreebudsProCoordinator; @@ -733,6 +734,7 @@ public enum DeviceType { HUAWEIWATCH3(HuaweiWatch3Coordinator.class), HUAWEIWATCH4PRO(HuaweiWatch4ProCoordinator.class), HUAWEIWATCH5(HuaweiWatch5Coordinator.class), + HUAWEI_FREEARC(HuaweiFreearcCoordinator.class), HUAWEI_FREEBUDS5I(HuaweiFreebuds5iCoordinator.class), HUAWEI_FREEBUDS_PRO(HuaweiFreebudsProCoordinator.class), HUAWEI_FREEBUDS6(HuaweiFreebuds6Coordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7b23eaedf3..f054be9600 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2060,6 +2060,7 @@ Huawei Watch 3 (Pro) Huawei Watch 4 (Pro) Huawei Watch 5 + Huawei FreeArc Huawei FreeBuds 5i Huawei FreeBuds Pro Huawei FreeBuds 6