diff --git a/README.md b/README.md
index c71a4bab5..96fa952ea 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ vendor's servers.
- PineTime (InfiniTime Firmware)
- Roidmi, Roidmi 3, Mojietu 3 (Bluetooth FM Transmitters)
- [SMA](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/SMA) Q2 (SMA-Q2-OSS Firmware)
-- Sony WH-1000XM3
+- Sony WH-1000XM3, WF-SP800N
- Teclast H10, H30
- TLW64
- Vibratissimo (Experimental)
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java
index cda7bf042..231912ae6 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java
@@ -127,6 +127,9 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_SONY_EQUALIZER_BAND_16000 = "pref_sony_equalizer_band_16000";
public static final String PREF_SONY_EQUALIZER_BASS = "pref_sony_equalizer_bass";
public static final String PREF_SONY_TOUCH_SENSOR = "pref_sony_touch_sensor";
+ public static final String PREF_SONY_PAUSE_WHEN_TAKEN_OFF = "sony_pause_when_taken_off";
+ public static final String PREF_SONY_BUTTON_MODE_LEFT = "pref_sony_button_mode_left";
+ public static final String PREF_SONY_BUTTON_MODE_RIGHT = "pref_sony_button_mode_right";
public static final String PREF_SONY_AUTOMATIC_POWER_OFF = "pref_sony_automatic_power_off";
public static final String PREF_SONY_NOTIFICATION_VOICE_GUIDE = "pref_sony_notification_voice_guide";
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java
index b3258de1d..e0371502e 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java
@@ -121,6 +121,7 @@ import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.Dev
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONYSWR12_LOW_VIBRATION;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONYSWR12_SMART_INTERVAL;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONYSWR12_STAMINA;
+import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_PAUSE_WHEN_TAKEN_OFF;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SOUNDS;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_TIMEFORMAT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_VIBRATION_STRENGH_PERCENTAGE;
@@ -142,6 +143,8 @@ import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.Dev
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_EQUALIZER_BASS;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_AUDIO_UPSAMPLING;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_TOUCH_SENSOR;
+import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_RIGHT;
+import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_LEFT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_AUTOMATIC_POWER_OFF;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_SONY_NOTIFICATION_VOICE_GUIDE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREFS_ACTIVITY_IN_DEVICE_CARD;
@@ -560,6 +563,9 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
addPreferenceHandlerFor(PREF_SONY_EQUALIZER_BASS);
addPreferenceHandlerFor(PREF_SONY_AUDIO_UPSAMPLING);
addPreferenceHandlerFor(PREF_SONY_TOUCH_SENSOR);
+ addPreferenceHandlerFor(PREF_SONY_PAUSE_WHEN_TAKEN_OFF);
+ addPreferenceHandlerFor(PREF_SONY_BUTTON_MODE_LEFT);
+ addPreferenceHandlerFor(PREF_SONY_BUTTON_MODE_RIGHT);
addPreferenceHandlerFor(PREF_SONY_AUTOMATIC_POWER_OFF);
addPreferenceHandlerFor(PREF_SONY_NOTIFICATION_VOICE_GUIDE);
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java
index 51edd2a75..c31ae60fd 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java
@@ -139,7 +139,7 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter. */
+package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators;
+
+import androidx.annotation.NonNull;
+
+import nodomain.freeyourgadget.gadgetbridge.R;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
+import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
+import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
+import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
+import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
+
+public class SonyWFSP800NCoordinator extends SonyHeadphonesCoordinator {
+ @NonNull
+ @Override
+ public DeviceType getSupportedType(final GBDeviceCandidate candidate) {
+ if (candidate.getName().contains("WF-SP800N")) {
+ return DeviceType.SONY_WF_SP800N;
+ }
+
+ return DeviceType.UNKNOWN;
+ }
+
+ @Override
+ public DeviceType getDeviceType() {
+ return DeviceType.SONY_WF_SP800N;
+ }
+
+ @Override
+ public int getBatteryCount() {
+ return 3;
+ }
+
+ @Override
+ public boolean supportsPowerOff() {
+ return true;
+ }
+
+ @Override
+ public BatteryConfig[] getBatteryConfig() {
+ final BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_tws_case, R.string.battery_case);
+ final BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_galaxy_buds_l, R.string.left_earbud);
+ final BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_galaxy_buds_r, R.string.right_earbud);
+
+ return new BatteryConfig[]{battery1, battery2, battery3};
+ }
+
+ @Override
+ public int[] getSupportedDeviceSpecificSettings(final GBDevice device) {
+ return new int[]{
+ R.xml.devicesettings_sony_headphones_ambient_sound_control,
+ R.xml.devicesettings_header_other,
+ R.xml.devicesettings_sony_headphones_equalizer,
+ R.xml.devicesettings_header_system,
+ R.xml.devicesettings_sony_headphones_button_modes_left_right,
+ R.xml.devicesettings_sony_headphones_pause_when_taken_off,
+ R.xml.devicesettings_sony_wf_sp800n,
+ R.xml.devicesettings_sony_headphones_notifications_voice_guide
+ };
+ }
+}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWH1000XM3Coordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWH1000XM3Coordinator.java
index bfd9a6d4c..ab4d375e6 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWH1000XM3Coordinator.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/coordinators/SonyWH1000XM3Coordinator.java
@@ -44,7 +44,7 @@ public class SonyWH1000XM3Coordinator extends SonyHeadphonesCoordinator {
public int[] getSupportedDeviceSpecificSettings(final GBDevice device) {
return new int[]{
R.xml.devicesettings_sony_warning_wh1000xm3,
- R.xml.devicesettings_sony_headphones_ambient_sound_control,
+ R.xml.devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction,
R.xml.devicesettings_header_other,
R.xml.devicesettings_sony_headphones_equalizer,
R.xml.devicesettings_sony_headphones_sound_position,
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/prefs/ButtonModes.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/prefs/ButtonModes.java
new file mode 100644
index 000000000..79b66070a
--- /dev/null
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/prefs/ButtonModes.java
@@ -0,0 +1,74 @@
+/* Copyright (C) 2021 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.prefs;
+
+import android.content.SharedPreferences;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
+
+public class ButtonModes {
+ public enum Mode {
+ OFF((byte) 0xff),
+ AMBIENT_SOUND_CONTROL((byte) 0x00),
+ PLAYBACK_CONTROL((byte) 0x20),
+ VOLUME_CONTROL((byte) 0x10);
+
+ private final byte code;
+
+ Mode(final byte code) {
+ this.code = code;
+ }
+
+ public byte getCode() {
+ return this.code;
+ }
+ }
+
+ final Mode left;
+ final Mode right;
+
+ public ButtonModes(final Mode left, final Mode right) {
+ this.left = left;
+ this.right = right;
+ }
+
+ public Mode getModeLeft() {
+ return left;
+ }
+
+ public Mode getModeRight() {
+ return right;
+ }
+
+ public Map toPreferences() {
+ return new HashMap() {{
+ put(DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_LEFT, left.name().toLowerCase(Locale.getDefault()));
+ put(DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_RIGHT, right.name().toLowerCase(Locale.getDefault()));
+ }};
+ }
+
+ public static ButtonModes fromPreferences(final SharedPreferences prefs) {
+ return new ButtonModes(
+ Mode.valueOf(prefs.getString(DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_LEFT, "off").toUpperCase()),
+ Mode.valueOf(prefs.getString(DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_RIGHT, "off").toUpperCase())
+ );
+ }
+}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/prefs/PauseWhenTakenOff.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/prefs/PauseWhenTakenOff.java
new file mode 100644
index 000000000..29a56d4cb
--- /dev/null
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/sony/headphones/prefs/PauseWhenTakenOff.java
@@ -0,0 +1,46 @@
+/* Copyright (C) 2021 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.prefs;
+
+import android.content.SharedPreferences;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
+
+public class PauseWhenTakenOff {
+ private final boolean enabled;
+
+ public PauseWhenTakenOff(final boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public Map toPreferences() {
+ return new HashMap() {{
+ put(DeviceSettingsPreferenceConst.PREF_SONY_PAUSE_WHEN_TAKEN_OFF, enabled);
+ }};
+ }
+
+ public static PauseWhenTakenOff fromPreferences(final SharedPreferences prefs) {
+ return new PauseWhenTakenOff(prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_SONY_PAUSE_WHEN_TAKEN_OFF, false));
+ }
+}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java
index 1e75fbe91..69ede37da 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java
@@ -449,4 +449,10 @@ public class GBDeviceService implements DeviceService {
.putExtra(EXTRA_LED_COLOR, color);
invokeService(intent);
}
+
+ @Override
+ public void onPowerOff() {
+ Intent intent = createIntent().setAction(ACTION_POWER_OFF);
+ invokeService(intent);
+ }
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceService.java
index 62f71e9d8..8304b8410 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceService.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceService.java
@@ -69,6 +69,7 @@ public interface DeviceService extends EventHandler {
String ACTION_TEST_NEW_FUNCTION = PREFIX + ".action.test_new_function";
String ACTION_SET_FM_FREQUENCY = PREFIX + ".action.set_fm_frequency";
String ACTION_SET_LED_COLOR = PREFIX + ".action.set_led_color";
+ String ACTION_POWER_OFF = PREFIX + ".action.power_off";
String EXTRA_NOTIFICATION_BODY = "notification_body";
String EXTRA_NOTIFICATION_FLAGS = "notification_flags";
String EXTRA_NOTIFICATION_ID = "notification_id";
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 259b9bc1f..ff3dcc3c8 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceType.java
@@ -104,6 +104,7 @@ public enum DeviceType {
GALAXY_BUDS_LIVE(419, R.drawable.ic_device_galaxy_buds_live, R.drawable.ic_device_galaxy_buds_live_disabled, R.string.devicetype_galaxybuds_live),
GALAXY_BUDS(420, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_galaxybuds),
SONY_WH_1000XM3(430, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_sony_wh_1000xm3),
+ SONY_WF_SP800N(431, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_sp800n),
TEST(1000, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_test);
private final int key;
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java
index 148ebb465..a9f7ddfa6 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java
@@ -102,6 +102,7 @@ import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_FI
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_HEARTRATE_TEST;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_INSTALL;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_NOTIFICATION;
+import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_POWER_OFF;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_READ_CONFIGURATION;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_REQUEST_APPINFO;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_REQUEST_DEVICEINFO;
@@ -632,6 +633,9 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
mDeviceSupport.onSetLedColor(color);
}
break;
+ case ACTION_POWER_OFF:
+ mDeviceSupport.onPowerOff();
+ break;
case ACTION_SET_FM_FREQUENCY:
float frequency = intent.getFloatExtra(EXTRA_FM_FREQUENCY, -1);
if (frequency != -1) {
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java
index 9ee62d5a2..bef134867 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java
@@ -373,6 +373,9 @@ public class DeviceSupportFactory {
case SONY_WH_1000XM3:
deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break;
+ case SONY_WF_SP800N:
+ deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
+ break;
}
if (deviceSupport != null) {
deviceSupport.setContext(gbDevice, mBtAdapter, mContext);
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/ServiceDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/ServiceDeviceSupport.java
index bd60f8342..0cc8a6d06 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/ServiceDeviceSupport.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/ServiceDeviceSupport.java
@@ -413,4 +413,12 @@ public class ServiceDeviceSupport implements DeviceSupport {
}
delegate.onSetLedColor(color);
}
+
+ @Override
+ public void onPowerOff() {
+ if (checkBusy("power off event")) {
+ return;
+ }
+ delegate.onPowerOff();
+ }
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/AbstractBTLEDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/AbstractBTLEDeviceSupport.java
index a51d887d9..73a9e1b95 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/AbstractBTLEDeviceSupport.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/AbstractBTLEDeviceSupport.java
@@ -22,6 +22,7 @@ import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
+import android.content.Intent;
import org.slf4j.Logger;
@@ -367,6 +368,11 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
}
+ @Override
+ public void onPowerOff() {
+
+ }
+
@Override
public void onSetReminders(ArrayList extends Reminder> reminders) {
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesIoThread.java
index db80e8639..975543a1b 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesIoThread.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesIoThread.java
@@ -57,6 +57,7 @@ public class SonyHeadphonesIoThread extends BtClassicIoThread {
if (initRetries++ < 2) {
LOG.warn("Init retry {}", initRetries);
+ mProtocol.decreasePendingAcks();
write(mProtocol.encodeInit());
scheduleInitRetry();
} else {
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java
index 4ec87f4db..a0e253d7c 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/SonyHeadphonesProtocol.java
@@ -34,8 +34,10 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdateDevi
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControl;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AudioUpsampling;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AutomaticPowerOff;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.ButtonModes;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.EqualizerCustomBands;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.EqualizerPreset;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.PauseWhenTakenOff;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.VoiceNotifications;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.SoundPosition;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.SurroundMode;
@@ -175,6 +177,13 @@ public class SonyHeadphonesProtocol extends GBDeviceProtocol {
case DeviceSettingsPreferenceConst.PREF_SONY_AUTOMATIC_POWER_OFF:
configRequest = protocolImpl.setAutomaticPowerOff(AutomaticPowerOff.fromPreferences(prefs));
break;
+ case DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_LEFT:
+ case DeviceSettingsPreferenceConst.PREF_SONY_BUTTON_MODE_RIGHT:
+ configRequest = protocolImpl.setButtonModes(ButtonModes.fromPreferences(prefs));
+ break;
+ case DeviceSettingsPreferenceConst.PREF_SONY_PAUSE_WHEN_TAKEN_OFF:
+ configRequest = protocolImpl.setPauseWhenTakenOff(PauseWhenTakenOff.fromPreferences(prefs));
+ break;
case DeviceSettingsPreferenceConst.PREF_SONY_NOTIFICATION_VOICE_GUIDE:
configRequest = protocolImpl.setVoiceNotifications(VoiceNotifications.fromPreferences(prefs));
break;
@@ -200,6 +209,15 @@ public class SonyHeadphonesProtocol extends GBDeviceProtocol {
return null;
}
+ @Override
+ public byte[] encodePowerOff() {
+ if (protocolImpl != null) {
+ return protocolImpl.powerOff().encode(sequenceNumber);
+ }
+
+ return super.encodePowerOff();
+ }
+
public byte[] encodeAck(byte sequenceNumber) {
return new Message(MessageType.ACK, (byte) (1 - sequenceNumber), new byte[0]).encode();
}
@@ -226,6 +244,10 @@ public class SonyHeadphonesProtocol extends GBDeviceProtocol {
return pendingAcks;
}
+ public void decreasePendingAcks() {
+ pendingAcks--;
+ }
+
public byte[] getFromQueue() {
return requestQueue.remove().encode(sequenceNumber);
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/AbstractSonyProtocolImpl.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/AbstractSonyProtocolImpl.java
index 6e53d06ca..3af5befc4 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/AbstractSonyProtocolImpl.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/AbstractSonyProtocolImpl.java
@@ -22,8 +22,10 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControl;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AudioUpsampling;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AutomaticPowerOff;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.ButtonModes;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.EqualizerCustomBands;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.EqualizerPreset;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.PauseWhenTakenOff;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.SoundPosition;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.SurroundMode;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.TouchSensor;
@@ -62,6 +64,14 @@ public abstract class AbstractSonyProtocolImpl {
public abstract Request setAutomaticPowerOff(final AutomaticPowerOff config);
+ public abstract Request getButtonModes();
+
+ public abstract Request setButtonModes(final ButtonModes config);
+
+ public abstract Request getPauseWhenTakenOff();
+
+ public abstract Request setPauseWhenTakenOff(final PauseWhenTakenOff config);
+
public abstract Request getEqualizer();
public abstract Request setEqualizerPreset(final EqualizerPreset config);
@@ -86,5 +96,7 @@ public abstract class AbstractSonyProtocolImpl {
public abstract Request startNoiseCancellingOptimizer();
+ public abstract Request powerOff();
+
public abstract List extends GBDeviceEvent> handlePayload(final MessageType messageType, final byte[] payload);
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/PayloadType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/PayloadType.java
index 6af86dce5..c79b410d5 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/PayloadType.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/sony/headphones/protocol/impl/v1/PayloadType.java
@@ -36,6 +36,8 @@ public enum PayloadType {
AUDIO_CODEC_REPLY(MessageType.COMMAND_1, 0x19),
AUDIO_CODEC_NOTIFY(MessageType.COMMAND_1, 0x1b),
+ POWER_OFF(MessageType.COMMAND_1, 0x22),
+
SOUND_POSITION_OR_MODE_GET(MessageType.COMMAND_1, 0x46),
SOUND_POSITION_OR_MODE_RET(MessageType.COMMAND_1, 0x47),
SOUND_POSITION_OR_MODE_SET(MessageType.COMMAND_1, 0x48),
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 36feedf2a..b72cdd4e4 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
@@ -36,8 +36,10 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInf
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AmbientSoundControl;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AudioUpsampling;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.AutomaticPowerOff;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.ButtonModes;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.EqualizerCustomBands;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.EqualizerPreset;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.PauseWhenTakenOff;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.SoundPosition;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.SurroundMode;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.TouchSensor;
@@ -210,6 +212,53 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
);
}
+ public Request getButtonModes() {
+ return new Request(
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_GET.getMessageType(),
+ new byte[]{
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_GET.getCode(),
+ (byte) 0x06
+ }
+ );
+ }
+
+ public Request setButtonModes(final ButtonModes config) {
+ return new Request(
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_SET.getMessageType(),
+ new byte[]{
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_SET.getCode(),
+ (byte) 0x06,
+ (byte) 0x02,
+ config.getModeLeft().getCode(),
+ config.getModeRight().getCode()
+ }
+ );
+ }
+
+ @Override
+ public Request getPauseWhenTakenOff() {
+ return new Request(
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_GET.getMessageType(),
+ new byte[]{
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_GET.getCode(),
+ (byte) 0x03
+ }
+ );
+ }
+
+ @Override
+ public Request setPauseWhenTakenOff(final PauseWhenTakenOff config) {
+ return new Request(
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_SET.getMessageType(),
+ new byte[]{
+ PayloadType.AUTOMATIC_POWER_OFF_BUTTON_MODE_SET.getCode(),
+ (byte) 0x03,
+ (byte) 0x00,
+ (byte) (config.isEnabled() ? 0x01 : 0x00)
+ }
+ );
+ }
+
@Override
public Request getEqualizer() {
return new Request(
@@ -362,6 +411,18 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
);
}
+ @Override
+ public Request powerOff() {
+ return new Request(
+ PayloadType.POWER_OFF.getMessageType(),
+ new byte[]{
+ PayloadType.POWER_OFF.getCode(),
+ (byte) 0x00,
+ (byte) 0x01
+ }
+ );
+ }
+
@Override
public List extends GBDeviceEvent> handlePayload(final MessageType messageType, final byte[] payload) {
final PayloadType payloadType = PayloadType.fromCode(messageType, payload[0]);
@@ -394,7 +455,7 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
return handleAudioUpsampling(payload);
case AUTOMATIC_POWER_OFF_BUTTON_MODE_RET:
case AUTOMATIC_POWER_OFF_BUTTON_MODE_NOTIFY:
- return handleAutomaticPowerOff(payload);
+ return handleAutomaticPowerOffButtonMode(payload);
case VOICE_NOTIFICATIONS_RET:
case VOICE_NOTIFICATIONS_NOTIFY:
return handleVoiceNotifications(payload);
@@ -433,6 +494,18 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
capabilityRequests.add(getSoundPosition());
capabilityRequests.add(getEqualizer());
break;
+ case SONY_WF_SP800N:
+ capabilityRequests.add(getFirmwareVersion());
+ capabilityRequests.add(getBattery(BatteryType.DUAL));
+ capabilityRequests.add(getBattery(BatteryType.CASE));
+ capabilityRequests.add(getAudioCodec());
+ capabilityRequests.add(getAmbientSoundControl());
+ capabilityRequests.add(getVoiceNotifications());
+ capabilityRequests.add(getAutomaticPowerOff());
+ capabilityRequests.add(getEqualizer());
+ capabilityRequests.add(getButtonModes());
+ capabilityRequests.add(getPauseWhenTakenOff());
+ break;
default:
LOG.error("Unsupported Sony device type '{}' with key '{}'", deviceType, deviceType.getKey());
return null;
@@ -569,6 +642,69 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
return Collections.singletonList(event);
}
+ public List extends GBDeviceEvent> handleButtonModes(final byte[] payload) {
+ if (payload.length != 5) {
+ LOG.warn("Unexpected payload length {}", payload.length);
+ return Collections.emptyList();
+ }
+
+ ButtonModes.Mode modeLeft = null;
+ for (ButtonModes.Mode value : ButtonModes.Mode.values()) {
+ if (value.getCode() == payload[3]) {
+ modeLeft = value;
+ break;
+ }
+ }
+
+ ButtonModes.Mode modeRight = null;
+ for (ButtonModes.Mode value : ButtonModes.Mode.values()) {
+ if (value.getCode() == payload[4]) {
+ modeRight = value;
+ break;
+ }
+ }
+
+ if (modeLeft == null || modeRight == null) {
+ LOG.warn("Unknown button mode codes {}", String.format("%02x %02x", payload[3], payload[4]));
+ return Collections.emptyList();
+ }
+
+ LOG.debug("Button Modes: L: {}, R: {}", modeLeft, modeRight);
+
+ final GBDeviceEventUpdatePreferences event = new GBDeviceEventUpdatePreferences()
+ .withPreferences(new ButtonModes(modeLeft, modeRight).toPreferences());
+
+ return Collections.singletonList(event);
+ }
+
+ public List extends GBDeviceEvent> handlePauseWhenTakenOff(final byte[] payload) {
+ if (payload.length != 4) {
+ LOG.warn("Unexpected payload length {}", payload.length);
+ return Collections.emptyList();
+ }
+
+ boolean enabled;
+
+ switch (payload[3]) {
+ case 0x00:
+ enabled = false;
+ break;
+ case 0x01:
+ enabled = true;
+ break;
+ default:
+ LOG.warn("Unknown pause when taken off code {}", String.format("%02x", payload[3]));
+ return Collections.emptyList();
+ }
+
+ LOG.debug("Touch Sensor: {}", enabled);
+
+ final GBDeviceEventUpdatePreferences event = new GBDeviceEventUpdatePreferences()
+ .withPreferences(new PauseWhenTakenOff(enabled).toPreferences());
+
+ return Collections.singletonList(event);
+ }
+
public List extends GBDeviceEvent> handleBattery(final byte[] payload) {
final BatteryType batteryType = BatteryType.fromCode(payload[1]);
@@ -585,8 +721,8 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
final GBDeviceEventBatteryInfo singleBatteryInfo = new GBDeviceEventBatteryInfo();
singleBatteryInfo.batteryIndex = 0;
- singleBatteryInfo.state = BatteryState.BATTERY_NORMAL;
singleBatteryInfo.level = payload[2];
+ singleBatteryInfo.state = payload[3] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL;
batteryEvents.add(singleBatteryInfo);
} else if (BatteryType.DUAL.equals(batteryType)) {
@@ -597,8 +733,8 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
final GBDeviceEventBatteryInfo gbDeviceEventBatteryInfoLeft = new GBDeviceEventBatteryInfo();
gbDeviceEventBatteryInfoLeft.batteryIndex = 1;
- gbDeviceEventBatteryInfoLeft.state = BatteryState.BATTERY_NORMAL;
gbDeviceEventBatteryInfoLeft.level = payload[2];
+ gbDeviceEventBatteryInfoLeft.state = payload[3] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL;
batteryEvents.add(gbDeviceEventBatteryInfoLeft);
}
@@ -607,8 +743,8 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
final GBDeviceEventBatteryInfo gbDeviceEventBatteryInfoRight = new GBDeviceEventBatteryInfo();
gbDeviceEventBatteryInfoRight.batteryIndex = 2;
- gbDeviceEventBatteryInfoRight.state = BatteryState.BATTERY_NORMAL;
gbDeviceEventBatteryInfoRight.level = payload[4];
+ gbDeviceEventBatteryInfoRight.state = payload[5] == 1 ? BatteryState.BATTERY_CHARGING : BatteryState.BATTERY_NORMAL;
batteryEvents.add(gbDeviceEventBatteryInfoRight);
}
@@ -714,6 +850,19 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
return Collections.emptyList();
}
+ public List extends GBDeviceEvent> handleAutomaticPowerOffButtonMode(final byte[] payload) {
+ switch (payload[1]) {
+ case 0x04:
+ return handleAutomaticPowerOff(payload);
+ case 0x03:
+ return handlePauseWhenTakenOff(payload);
+ case 0x06:
+ return handleButtonModes(payload);
+ }
+
+ return Collections.emptyList();
+ }
+
public List extends GBDeviceEvent> handleVirtualSound(final byte[] payload) {
if (payload.length != 3) {
LOG.warn("Unexpected payload length {}", payload.length);
@@ -856,6 +1005,8 @@ public class SonyProtocolImplV1 extends AbstractSonyProtocolImpl {
switch (deviceType) {
case SONY_WH_1000XM3:
return true;
+ case SONY_WF_SP800N:
+ return false;
default:
LOG.error("Unknown Sony device type '{}' with key '{}'", deviceType, deviceType.getKey());
return false;
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/AbstractSerialDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/AbstractSerialDeviceSupport.java
index d880f8aae..39da5fb9e 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/AbstractSerialDeviceSupport.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/AbstractSerialDeviceSupport.java
@@ -265,6 +265,12 @@ public abstract class AbstractSerialDeviceSupport extends AbstractDeviceSupport
sendToDevice(bytes);
}
+ @Override
+ public void onPowerOff() {
+ byte[] bytes = gbDeviceProtocol.encodePowerOff();
+ sendToDevice(bytes);
+ }
+
@Override
public void onSetReminders(ArrayList extends Reminder> reminders) {
byte[] bytes = gbDeviceProtocol.encodeReminders(reminders);
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/GBDeviceProtocol.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/GBDeviceProtocol.java
index ccf3adb52..a4408d053 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/GBDeviceProtocol.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/serial/GBDeviceProtocol.java
@@ -143,6 +143,10 @@ public abstract class GBDeviceProtocol {
return null;
}
+ public byte[] encodePowerOff() {
+ return null;
+ }
+
public byte[] encodeReminders(ArrayList extends Reminder> reminders) {
return null;
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java
index 99e6f98f4..abd6b8952 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java
@@ -113,6 +113,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.um25.Coordinator.UM25Coordin
import nodomain.freeyourgadget.gadgetbridge.devices.vibratissimo.VibratissimoCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.waspos.WaspOSCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.watch9.Watch9DeviceCoordinator;
+import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWFSP800NCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators.SonyWH1000XM3Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimeCoordinator;
@@ -315,6 +316,7 @@ public class DeviceHelper {
result.add(new GalaxyBudsDeviceCoordinator());
result.add(new GalaxyBudsLiveDeviceCoordinator());
result.add(new SonyWH1000XM3Coordinator());
+ result.add(new SonyWFSP800NCoordinator());
return result;
}
diff --git a/app/src/main/res/drawable/ic_pause.xml b/app/src/main/res/drawable/ic_pause.xml
new file mode 100644
index 000000000..a932d88fb
--- /dev/null
+++ b/app/src/main/res/drawable/ic_pause.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/layout/device_itemv2.xml b/app/src/main/res/layout/device_itemv2.xml
index 2dcbefaa0..98ff82cad 100644
--- a/app/src/main/res/layout/device_itemv2.xml
+++ b/app/src/main/res/layout/device_itemv2.xml
@@ -477,6 +477,20 @@
+
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 53bf80961..9a9d68380 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -1235,6 +1235,10 @@
1 hora
3 horas
Quando retirar os auscultadores
+ Desligado
+ Controlo Som Ambiente
+ Controlo da reprodução
+ Controlo do Volume
Desmarcar todos as aplicações
Está prestes a instalar o firmware %s no seu Amazfit X.
\n
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 6bfc8e4fc..d870dcfe4 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -1949,20 +1949,32 @@
- 3
-
+
- @string/sony_ambient_sound_off
- @string/sony_ambient_sound_noise_cancelling
- @string/sony_ambient_sound_wind_noise_reduction
- @string/sony_ambient_sound_ambient_sound
-
+
- off
- noise_cancelling
- wind_noise_reduction
- ambient_sound
+
+ - @string/sony_ambient_sound_off
+ - @string/sony_ambient_sound_noise_cancelling
+ - @string/sony_ambient_sound_ambient_sound
+
+
+
+ - off
+ - noise_cancelling
+ - ambient_sound
+
+
- @string/sony_sound_position_off
- @string/sony_sound_position_front
@@ -2042,5 +2054,29 @@
- after_1_hour
- after_3_hour
+
+
+ - @string/sony_automatic_power_off_off
+ - @string/sony_automatic_power_off_when_taken_off
+
+
+
+ - off
+ - when_taken_off
+
+
+
+ - @string/sony_button_mode_off
+ - @string/sony_button_mode_ambient_sound_control
+ - @string/sony_button_mode_playback_control
+ - @string/sony_button_mode_volume_control
+
+
+
+ - off
+ - ambient_sound_control
+ - playback_control
+ - volume_control
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 2326836ad..25aae9a00 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -10,6 +10,9 @@
Find lost device
Search for %1$s?
Take Screenshot
+ Power Off
+ Power Off
+ Are you sure you want to power off the device?
Change LED Color
Change FM Frequency
Connect…
@@ -926,6 +929,7 @@
FitPro
Sony WH-1000XM3
+ Sony WF-SP800N
Choose export location
General
High-priority
@@ -1424,6 +1428,13 @@
1 hour
3 hours
When taken off
+ Pause when headphones are taken off
+ Button Mode (Left)
+ Button Mode (Right)
+ Off
+ Ambient Sound Control
+ Playback Control
+ Volume Control
Custom widget
Time zone:
Update timeout in minutes:
diff --git a/app/src/main/res/xml/devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction.xml b/app/src/main/res/xml/devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction.xml
new file mode 100644
index 000000000..20439fca4
--- /dev/null
+++ b/app/src/main/res/xml/devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/xml/devicesettings_sony_headphones_button_modes_left_right.xml b/app/src/main/res/xml/devicesettings_sony_headphones_button_modes_left_right.xml
new file mode 100644
index 000000000..ce19dd899
--- /dev/null
+++ b/app/src/main/res/xml/devicesettings_sony_headphones_button_modes_left_right.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/xml/devicesettings_sony_headphones_pause_when_taken_off.xml b/app/src/main/res/xml/devicesettings_sony_headphones_pause_when_taken_off.xml
new file mode 100644
index 000000000..d09af46d2
--- /dev/null
+++ b/app/src/main/res/xml/devicesettings_sony_headphones_pause_when_taken_off.xml
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/app/src/main/res/xml/devicesettings_sony_wf_sp800n.xml b/app/src/main/res/xml/devicesettings_sony_wf_sp800n.xml
new file mode 100644
index 000000000..815a3612b
--- /dev/null
+++ b/app/src/main/res/xml/devicesettings_sony_wf_sp800n.xml
@@ -0,0 +1,11 @@
+
+
+
+