From f277fbe9e522b45408839db11cf9cd053edad687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Fri, 31 Jan 2025 18:36:46 +0000 Subject: [PATCH] Sony WH-ULT900N: Initial support --- .../SonyWHULT900NCoordinator.java | 50 +++++++++++++++++++ .../gadgetbridge/model/DeviceType.java | 2 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 53 insertions(+) create mode 100644 app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWHULT900NCoordinator.java diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWHULT900NCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWHULT900NCoordinator.java new file mode 100644 index 000000000..9bef1506b --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWHULT900NCoordinator.java @@ -0,0 +1,50 @@ +/* Copyright (C) 2025 José Rebelo + + 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.HashSet; +import java.util.Set; +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 SonyWHULT900NCoordinator extends SonyHeadphonesCoordinator { + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile("^Sony ULT|ULT WEAR$"); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_sony_wh_ult900n; + } + + @Override + public Set getCapabilities() { + return new HashSet<>(Arrays.asList( + SonyHeadphonesCapabilities.BatterySingle, + SonyHeadphonesCapabilities.AmbientSoundControl, + SonyHeadphonesCapabilities.PowerOffFromPhone, + SonyHeadphonesCapabilities.PauseWhenTakenOff, + SonyHeadphonesCapabilities.QuickAccess, + SonyHeadphonesCapabilities.VoiceNotifications + )); + } +} 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 52bffb6b8..904260999 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -264,6 +264,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.SonyWHULT900NCoordinator; 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; @@ -538,6 +539,7 @@ public enum DeviceType { SONY_LINKBUDS(SonyLinkBudsCoordinator.class), SONY_LINKBUDS_S(SonyLinkBudsSCoordinator.class), SONY_WH_1000XM5(SonyWH1000XM5Coordinator.class), + SONY_WH_ULT900N(SonyWHULT900NCoordinator.class), SONY_WF_1000XM5(SonyWF1000XM5Coordinator.class), SONY_WF_C500(SonyWFC500Coordinator.class), SONY_WF_C510(SonyWFC510Coordinator.class), diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c1fd8057e..7d86a9f25 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1855,6 +1855,7 @@ Sony WH-1000XM3 Sony WH-1000XM4 Sony WH-1000XM5 + Sony WH-ULT900N Sony WF-SP800N Sony WF-1000XM3 Sony WF-1000XM4