1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 10:05:49 +01:00

Sony WH-1000XM2: Initial support

This commit is contained in:
José Rebelo 2022-10-20 23:48:02 +01:00
parent 2c182418fe
commit 1dca054853
6 changed files with 66 additions and 1 deletions

View File

@ -85,7 +85,7 @@ vendor's servers.
- PineTime (InfiniTime Firmware) - PineTime (InfiniTime Firmware)
- Roidmi, Roidmi 3, Mojietu 3 (Bluetooth FM Transmitters) - Roidmi, Roidmi 3, Mojietu 3 (Bluetooth FM Transmitters)
- [SMA](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/SMA) Q2 (SMA-Q2-OSS Firmware) - [SMA](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/SMA) Q2 (SMA-Q2-OSS Firmware)
- [Sony WH-1000XM3, WH-1000XM4, WF-SP800N, WF-1000XM3](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Sony-Headphones) - [Sony WH-1000XM2, WH-1000XM3, WH-1000XM4, WF-SP800N, WF-1000XM3](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Sony-Headphones)
- Teclast H10, H30 - Teclast H10, H30
- TLW64 - TLW64
- Vibratissimo (Experimental) - Vibratissimo (Experimental)

View File

@ -0,0 +1,59 @@
/* Copyright (C) 2022 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 <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators;
import androidx.annotation.NonNull;
import java.util.Arrays;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class SonyWH1000XM2Coordinator extends SonyHeadphonesCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
if (candidate.getName().contains("WH-1000XM2")) {
return DeviceType.SONY_WH_1000XM2;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.SONY_WH_1000XM2;
}
@Override
public List<SonyHeadphonesCapabilities> getCapabilities() {
return Arrays.asList(
SonyHeadphonesCapabilities.BatterySingle,
SonyHeadphonesCapabilities.AmbientSoundControl,
SonyHeadphonesCapabilities.WindNoiseReduction,
SonyHeadphonesCapabilities.AncOptimizer,
SonyHeadphonesCapabilities.AudioSettingsOnlyOnSbcCodec,
SonyHeadphonesCapabilities.Equalizer,
SonyHeadphonesCapabilities.SoundPosition,
SonyHeadphonesCapabilities.SurroundMode,
SonyHeadphonesCapabilities.AudioUpsampling
);
}
}

View File

@ -113,6 +113,7 @@ public enum DeviceType {
SONY_WF_SP800N(431, R.drawable.ic_device_sony_wf_800n, R.drawable.ic_device_sony_wf_800n_disabled, R.string.devicetype_sony_wf_sp800n), SONY_WF_SP800N(431, R.drawable.ic_device_sony_wf_800n, R.drawable.ic_device_sony_wf_800n_disabled, R.string.devicetype_sony_wf_sp800n),
SONY_WH_1000XM4(432, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm4), SONY_WH_1000XM4(432, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm4),
SONY_WF_1000XM3(433, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_1000xm3), SONY_WF_1000XM3(433, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_1000xm3),
SONY_WH_1000XM2(434, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm2),
BOSE_QC35(440, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_bose_qc35), BOSE_QC35(440, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_bose_qc35),
VESC_NRF(500, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc), VESC_NRF(500, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc),
VESC_HM10(501, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc), VESC_HM10(501, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc),

View File

@ -325,6 +325,8 @@ public class DeviceSupportFactory {
return new ServiceDeviceSupport(new SonyHeadphonesSupport(), ServiceDeviceSupport.Flags.BUSY_CHECKING); return new ServiceDeviceSupport(new SonyHeadphonesSupport(), ServiceDeviceSupport.Flags.BUSY_CHECKING);
case SONY_WF_1000XM3: case SONY_WF_1000XM3:
return new ServiceDeviceSupport(new SonyHeadphonesSupport()); return new ServiceDeviceSupport(new SonyHeadphonesSupport());
case SONY_WH_1000XM2:
return new ServiceDeviceSupport(new SonyHeadphonesSupport());
case VESC_NRF: case VESC_NRF:
case VESC_HM10: case VESC_HM10:
return new ServiceDeviceSupport(new VescDeviceSupport(device.getType())); return new ServiceDeviceSupport(new VescDeviceSupport(device.getType()));

View File

@ -116,6 +116,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.QHybridCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.roidmi.Roidmi1Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.roidmi.Roidmi1Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.roidmi.Roidmi3Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.roidmi.Roidmi3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.smaq2oss.SMAQ2OSSCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.smaq2oss.SMAQ2OSSCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM2Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM4Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM4Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sonyswr12.SonySWR12DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sonyswr12.SonySWR12DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.tlw64.TLW64Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.tlw64.TLW64Coordinator;
@ -339,6 +340,7 @@ public class DeviceHelper {
result.add(new SonyWH1000XM4Coordinator()); result.add(new SonyWH1000XM4Coordinator());
result.add(new SonyWFSP800NCoordinator()); result.add(new SonyWFSP800NCoordinator());
result.add(new SonyWF1000XM3Coordinator()); result.add(new SonyWF1000XM3Coordinator());
result.add(new SonyWH1000XM2Coordinator());
result.add(new QC35Coordinator()); result.add(new QC35Coordinator());
result.add(new BinarySensorCoordinator()); result.add(new BinarySensorCoordinator());
result.add(new FlipperZeroCoordinator()); result.add(new FlipperZeroCoordinator());

View File

@ -1144,6 +1144,7 @@
<string name="devicetype_smaq2oss">SMA-Q2 OSS</string> <string name="devicetype_smaq2oss">SMA-Q2 OSS</string>
<string name="devicetype_fitpro">FitPro</string> <string name="devicetype_fitpro">FitPro</string>
<string name="devicetype_domyos_t540">Domyos T540</string> <string name="devicetype_domyos_t540">Domyos T540</string>
<string name="devicetype_sony_wh_1000xm2">Sony WF-1000XM2</string>
<string name="devicetype_sony_wh_1000xm3">Sony WH-1000XM3</string> <string name="devicetype_sony_wh_1000xm3">Sony WH-1000XM3</string>
<string name="devicetype_sony_wh_1000xm4">Sony WH-1000XM4</string> <string name="devicetype_sony_wh_1000xm4">Sony WH-1000XM4</string>
<string name="devicetype_sony_wf_sp800n">Sony WF-SP800N</string> <string name="devicetype_sony_wf_sp800n">Sony WF-SP800N</string>