From a6053eda77572d048e4d7e44d6da744e4ee3c16b Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Wed, 30 Oct 2024 13:47:36 +0100 Subject: [PATCH] Add support for Sony WI-C100 --- .../coordinators/SonyWIC100Coordinator.java | 59 +++++++++++++++++++ .../gadgetbridge/model/DeviceType.java | 2 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 62 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWIC100Coordinator.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWIC100Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWIC100Coordinator.java new file mode 100644 index 000000000..372e9f3d3 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWIC100Coordinator.java @@ -0,0 +1,59 @@ +/* Copyright (C) 2024 Zahnstocher + + 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.sony.headphones.coordinators; + +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; + +import nodomain.freeyourgadget.gadgetbridge.R; +import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities; +import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator; + +public class SonyWIC100Coordinator extends SonyHeadphonesCoordinator { + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile(".*WI-C100.*"); + } + + @Override + public List getCapabilities() { + return Arrays.asList( + SonyHeadphonesCapabilities.BatterySingle, + SonyHeadphonesCapabilities.EqualizerSimple, + SonyHeadphonesCapabilities.EqualizerWithCustomBands, + SonyHeadphonesCapabilities.AudioUpsampling, + SonyHeadphonesCapabilities.VoiceNotifications, + SonyHeadphonesCapabilities.PowerOffFromPhone + ); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_sony_wi_c100; + } + + @Override + public int getDefaultIconResource() { + return R.drawable.ic_device_galaxy_buds; + } + + @Override + public int getDisabledIconResource() { + return R.drawable.ic_device_galaxy_buds_disabled; + } +} 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 2287d851d..d4a237be4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -241,6 +241,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM4Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM5Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWIC100Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWISP600NCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.wena3.SonyWena3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sonyswr12.SonySWR12DeviceCoordinator; @@ -478,6 +479,7 @@ public enum DeviceType { GALAXY_BUDS2_PRO(GalaxyBuds2ProDeviceCoordinator.class), SONY_WH_1000XM3(SonyWH1000XM3Coordinator.class), SONY_WF_SP800N(SonyWFSP800NCoordinator.class), + SONY_WI_C100(SonyWIC100Coordinator.class), SONY_WI_SP600N(SonyWISP600NCoordinator.class), SONY_WH_1000XM4(SonyWH1000XM4Coordinator.class), SONY_WF_1000XM3(SonyWF1000XM3Coordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 35627422a..06ffde71f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1821,6 +1821,7 @@ Sony WF-1000XM5 Sony WF-C500 Sony WF-C700N + Sony WI-C100 Sony WI-SP600N Sony LinkBuds Sony LinkBuds S