diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCapabilities.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCapabilities.java index 3907083d8..49a9f3ac4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCapabilities.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCapabilities.java @@ -19,10 +19,11 @@ package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones; public enum SonyHeadphonesCapabilities { BatterySingle, BatteryDual, - BatteryDual_NoCase, + BatteryDual2, BatteryCase, PowerOffFromPhone, AmbientSoundControl, + AmbientSoundControl2, WindNoiseReduction, SpeakToChatEnabled, SpeakToChatConfig, diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java index 0427e0b5e..8172f4e63 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/SonyHeadphonesCoordinator.java @@ -19,8 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones; import androidx.annotation.NonNull; -import org.apache.commons.lang3.ArrayUtils; - import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -70,7 +68,7 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC @Override public int getBatteryCount() { if (supports(SonyHeadphonesCapabilities.BatterySingle)) { - if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual_NoCase)) { + if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual2)) { throw new IllegalStateException("A device can't have both single and dual battery"); } else if (supports(SonyHeadphonesCapabilities.BatteryCase)) { throw new IllegalStateException("Devices with single battery + case are not supported by the protocol"); @@ -87,7 +85,7 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC batteryCount += 1; } - if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual_NoCase)) { + if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual2)) { batteryCount += 2; } @@ -106,7 +104,7 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_tws_case, R.string.battery_case)); } - if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual_NoCase)) { + if (supports(SonyHeadphonesCapabilities.BatteryDual) || supports(SonyHeadphonesCapabilities.BatteryDual2)) { batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_galaxy_buds_l, R.string.left_earbud)); batteries.add(new BatteryConfig(batteries.size(), R.drawable.ic_galaxy_buds_r, R.string.right_earbud)); } @@ -118,7 +116,7 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC public DeviceSpecificSettings getDeviceSpecificSettings(final GBDevice device) { final DeviceSpecificSettings deviceSpecificSettings = new DeviceSpecificSettings(); - if (supports(SonyHeadphonesCapabilities.AmbientSoundControl)) { + if (supports(SonyHeadphonesCapabilities.AmbientSoundControl) || supports(SonyHeadphonesCapabilities.AmbientSoundControl2)) { if (supports(SonyHeadphonesCapabilities.WindNoiseReduction)) { deviceSpecificSettings.addRootScreen(R.xml.devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction); } else { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC500Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC500Coordinator.java index 84c1c44a9..1de398275 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC500Coordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC500Coordinator.java @@ -23,8 +23,6 @@ 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; -import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; -import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig; public class SonyWFC500Coordinator extends SonyHeadphonesCoordinator { @Override @@ -32,18 +30,10 @@ public class SonyWFC500Coordinator extends SonyHeadphonesCoordinator { return Pattern.compile(".*WF-C500.*"); } - @Override - public BatteryConfig[] getBatteryConfig(final GBDevice device) { - final BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_galaxy_buds_l, R.string.left_earbud); - final BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_galaxy_buds_r, R.string.right_earbud); - - return new BatteryConfig[]{battery1, battery2}; - } - @Override public List getCapabilities() { return Arrays.asList( - SonyHeadphonesCapabilities.BatteryDual_NoCase, + SonyHeadphonesCapabilities.BatteryDual2, SonyHeadphonesCapabilities.EqualizerSimple, SonyHeadphonesCapabilities.EqualizerWithCustomBands, SonyHeadphonesCapabilities.AudioUpsampling, diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java new file mode 100644 index 000000000..1dc6917b6 --- /dev/null +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWFC700NCoordinator.java @@ -0,0 +1,66 @@ +/* Copyright (C) 2024 Marcel + + 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 SonyWFC700NCoordinator extends SonyHeadphonesCoordinator { + + @Override + protected Pattern getSupportedDeviceName() { + return Pattern.compile(".*WF-C700N.*"); + } + + @Override + public List getCapabilities() { + return Arrays.asList( + SonyHeadphonesCapabilities.BatteryDual2, + SonyHeadphonesCapabilities.BatteryCase, + SonyHeadphonesCapabilities.AmbientSoundControl2, + SonyHeadphonesCapabilities.EqualizerSimple, + SonyHeadphonesCapabilities.EqualizerWithCustomBands, + SonyHeadphonesCapabilities.AudioUpsampling, + SonyHeadphonesCapabilities.ButtonModesLeftRight, + SonyHeadphonesCapabilities.PowerOffFromPhone, + SonyHeadphonesCapabilities.AmbientSoundControlButtonMode + // AutoOff is supported, but current Payload is incorrect. + // Available options in Sony App: 15min, 30min, 1h, 3h, off + // TODO: SonyHeadphonesCapabilities.AutomaticPowerOffByTime + ); + } + + @Override + public int getDeviceNameResource() { + return R.string.devicetype_sony_wf_c700n; + } + + @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 e15b74338..79efd61bd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java @@ -226,6 +226,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWF1000XM4Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWF1000XM5Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWFC500Coordinator; +import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWFC700NCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWFSP800NCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM2Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM3Coordinator; @@ -472,6 +473,7 @@ public enum DeviceType { SONY_WH_1000XM5(SonyWH1000XM5Coordinator.class), SONY_WF_1000XM5(SonyWF1000XM5Coordinator.class), SONY_WF_C500(SonyWFC500Coordinator.class), + SONY_WF_C700N(SonyWFC700NCoordinator.class), SOUNDCORE_LIBERTY3_PRO(SoundcoreLiberty3ProCoordinator.class), SOUNDCORE_LIBERTY4_NC(SoundcoreLiberty4NCCoordinator.class), SOUNDCORE_MOTION300(SoundcoreMotion300Coordinator.class), diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/SonyProtocolImplV1.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/SonyProtocolImplV1.java index 9dbf13ab0..4d3e3827b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/SonyProtocolImplV1.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/SonyProtocolImplV1.java @@ -638,9 +638,10 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl { final Map capabilityRequestMap = new LinkedHashMap() {{ put(SonyHeadphonesCapabilities.BatterySingle, getBattery(BatteryType.SINGLE)); put(SonyHeadphonesCapabilities.BatteryDual, getBattery(BatteryType.DUAL)); - put(SonyHeadphonesCapabilities.BatteryDual_NoCase, getBattery(BatteryType.DUAL_NO_CASE)); + put(SonyHeadphonesCapabilities.BatteryDual2, getBattery(BatteryType.DUAL2)); put(SonyHeadphonesCapabilities.BatteryCase, getBattery(BatteryType.CASE)); put(SonyHeadphonesCapabilities.AmbientSoundControl, getAmbientSoundControl()); + put(SonyHeadphonesCapabilities.AmbientSoundControl2, getAmbientSoundControl()); put(SonyHeadphonesCapabilities.AncOptimizer, getNoiseCancellingOptimizerState()); put(SonyHeadphonesCapabilities.AudioUpsampling, getAudioUpsampling()); put(SonyHeadphonesCapabilities.ButtonModesLeftRight, getButtonModes()); @@ -940,14 +941,16 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl { singleBatteryInfo.state = payload[3] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL; batteryEvents.add(singleBatteryInfo); - } else if (BatteryType.DUAL.equals(batteryType)) { + } else if (BatteryType.DUAL.equals(batteryType) || BatteryType.DUAL2.equals(batteryType)) { // Dual Battery (L / R) - LOG.debug("Battery Level: L: {}, R: {}", payload[2], payload[4]); + LOG.debug("Battery Level: {}: L: {}, R: {}", batteryType, payload[2], payload[4]); + + boolean hasCaseBattery = getCoordinator().supports(SonyHeadphonesCapabilities.BatteryCase); if (payload[2] != 0) { final GBDeviceEventBatteryInfo gbDeviceEventBatteryInfoLeft = new GBDeviceEventBatteryInfo(); - gbDeviceEventBatteryInfoLeft.batteryIndex = 1; + gbDeviceEventBatteryInfoLeft.batteryIndex = hasCaseBattery ? 1 : 0; gbDeviceEventBatteryInfoLeft.level = payload[2]; gbDeviceEventBatteryInfoLeft.state = payload[3] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL; @@ -957,30 +960,7 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl { if (payload[4] != 0) { final GBDeviceEventBatteryInfo gbDeviceEventBatteryInfoRight = new GBDeviceEventBatteryInfo(); - gbDeviceEventBatteryInfoRight.batteryIndex = 2; - gbDeviceEventBatteryInfoRight.level = payload[4]; - gbDeviceEventBatteryInfoRight.state = payload[5] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL; - - batteryEvents.add(gbDeviceEventBatteryInfoRight); - } - } else if (BatteryType.DUAL_NO_CASE.equals(batteryType)) { - // Dual Battery (L / R) - LOG.debug("Battery Level: L: {}, R: {}", payload[2], payload[4]); - - if (payload[2] != 0) { - final GBDeviceEventBatteryInfo gbDeviceEventBatteryInfoLeft = new GBDeviceEventBatteryInfo(); - - gbDeviceEventBatteryInfoLeft.batteryIndex = 0; - gbDeviceEventBatteryInfoLeft.level = payload[2]; - gbDeviceEventBatteryInfoLeft.state = payload[3] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL; - - batteryEvents.add(gbDeviceEventBatteryInfoLeft); - } - - if (payload[4] != 0) { - final GBDeviceEventBatteryInfo gbDeviceEventBatteryInfoRight = new GBDeviceEventBatteryInfo(); - - gbDeviceEventBatteryInfoRight.batteryIndex = 1; + gbDeviceEventBatteryInfoRight.batteryIndex = hasCaseBattery ? 2 : 1; gbDeviceEventBatteryInfoRight.level = payload[4]; gbDeviceEventBatteryInfoRight.state = payload[5] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/params/BatteryType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/params/BatteryType.java index 213206b24..76b9c6b0a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/params/BatteryType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/params/BatteryType.java @@ -19,6 +19,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.sony.headphones.pro public enum BatteryType { SINGLE, DUAL, - DUAL_NO_CASE, + DUAL2, CASE, } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2.java index 94e6e4ae2..0dcc8bd38 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2.java @@ -29,6 +29,7 @@ import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSett import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdateDeviceInfo; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdatePreferences; +import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AdaptiveVolumeControl; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControl; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControlButtonMode; @@ -68,7 +69,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { PayloadTypeV1.AMBIENT_SOUND_CONTROL_GET.getMessageType(), new byte[]{ PayloadTypeV1.AMBIENT_SOUND_CONTROL_GET.getCode(), - (byte) (supportsWindNoiseCancelling() ? 0x17 : 0x15) + (byte) (supportsWindNoiseCancelling() || getCoordinator().supports(SonyHeadphonesCapabilities.AmbientSoundControl2) ? 0x17 : 0x15) } ); } @@ -78,7 +79,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { final ByteBuffer buf = ByteBuffer.allocate(supportsWindNoiseCancelling() ? 8 : 7); buf.put(PayloadTypeV1.AMBIENT_SOUND_CONTROL_SET.getCode()); - buf.put((byte) (supportsWindNoiseCancelling() ? 0x17 : 0x15)); + buf.put((byte) (supportsWindNoiseCancelling() || getCoordinator().supports(SonyHeadphonesCapabilities.AmbientSoundControl2) ? 0x17 : 0x15)); buf.put((byte) 0x01); // 0x00 while dragging the slider? if (AmbientSoundControl.Mode.OFF.equals(ambientSoundControl.getMode())) { @@ -351,7 +352,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { PayloadTypeV2.AMBIENT_SOUND_CONTROL_BUTTON_MODE_SET.getCode(), (byte) 0x03, (byte) 0x01, - (byte) 0x35, + (byte) (getCoordinator().supports(SonyHeadphonesCapabilities.AmbientSoundControl2) ? 0x00 : 0x35), (byte) 0x01, (byte) 0x00, ambientSoundControlButtonMode.getCode() @@ -554,7 +555,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { return Collections.emptyList(); } - final boolean includesWindNoiseReduction = payload[1] == 0x17; + final boolean includesWindNoiseReduction = payload[1] == 0x17 && payload.length > 7; AmbientSoundControl.Mode mode = null; @@ -798,7 +799,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { return Collections.emptyList(); } - if (payload[1] != 0x03 || payload[2] != 0x01 || payload[3] != 0x35 || payload[4] != 0x01 || payload[5] != 0x00) { + if (payload[1] != 0x03 || payload[2] != 0x01 || (payload[3] != 0x00 && payload[3] != 0x35) || payload[4] != 0x01 || payload[5] != 0x00) { LOG.warn( "Unexpected ambient sound control button mode payload bytes {}", String.format("%02x %02x %02x %02x %02x", payload[1], payload[2], payload[3], payload[4], payload[5]) @@ -812,7 +813,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { return Collections.emptyList(); } - LOG.debug("Ambient Sound Control Buton Mode: {}", mode); + LOG.debug("Ambient Sound Control Button Mode: {}", mode); final GBDeviceEventUpdatePreferences event = new GBDeviceEventUpdatePreferences() .withPreferences(mode.toPreferences()); @@ -1028,7 +1029,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { case 0x00: return BatteryType.SINGLE; case 0x01: - return BatteryType.DUAL_NO_CASE; + return BatteryType.DUAL2; case 0x09: return BatteryType.DUAL; case 0x0a: @@ -1043,7 +1044,7 @@ public class SonyProtocolImplV2 extends SonyProtocolImplV1 { switch (batteryType) { case SINGLE: return 0x00; - case DUAL_NO_CASE: + case DUAL2: return 0x01; case DUAL: return 0x09; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0d9b7be65..5357dde7a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1807,6 +1807,7 @@ Sony WF-1000XM4 Sony WF-1000XM5 Sony WF-C500 + Sony WF-C700N Sony WI-SP600N Sony LinkBuds Sony LinkBuds S diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2Test.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2Test.java index 9e6189378..45ebab847 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2Test.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v2/SonyProtocolImplV2Test.java @@ -37,7 +37,6 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdatePreferences; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWF1000XM4Coordinator; -import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControl; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControlButtonMode; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AudioUpsampling; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AutomaticPowerOff; @@ -104,7 +103,7 @@ public class SonyProtocolImplV2Test { final Map commands = new LinkedHashMap() {{ put(BatteryType.SINGLE, "22:00"); put(BatteryType.DUAL, "22:09"); - put(BatteryType.DUAL_NO_CASE, "22:01"); + put(BatteryType.DUAL2, "22:01"); put(BatteryType.CASE, "22:0a"); }};