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

Galaxy Buds2 support (#2853)

Mostly copied from the Buds Pro as those earbuds have a similar feature set and mostly the same protocol.
Co-authored-by: narektor <narektor@noreply.codeberg.org>
Co-committed-by: narektor <narektor@noreply.codeberg.org>
This commit is contained in:
narektor 2022-11-07 19:34:41 +01:00 committed by Andreas Shimokawa
parent 164c5e52a4
commit 2216b6b76a
11 changed files with 319 additions and 10 deletions

View File

@ -233,6 +233,7 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_GALAXY_BUDS_PRESSURE_RELIEF = "pref_galaxy_buds_live_pressure_relief";
public static final String PREF_GALAXY_BUDS_AMBIENT_SOUND = "pref_galaxy_buds_ambient_sound";
public static final String PREF_GALAXY_BUDS_PRO_NOISE_CONTROL="pref_galaxy_buds_pro_noise_control";
public static final String PREF_GALAXY_BUDS_2_NOISE_CONTROL="pref_galaxy_buds_2_noise_control";
public static final String PREF_GALAXY_PRO_DOUBLE_TAP_EDGE ="pref_galaxy_pro_double_tap_edge";
public static final String PREF_GALAXY_BUDS_PRO_IN_EAR_DETECTION ="pref_galaxy_buds_pro_in_ear_detection";
public static final String PREF_GALAXY_BUDS_PRO_VOICE_DETECT ="pref_galaxy_buds_pro_voice_detect";

View File

@ -0,0 +1,56 @@
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
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 GalaxyBuds2DeviceCoordinator extends GalaxyBudsGenericCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
String name = candidate.getName();
if (name != null && (
name.startsWith("Galaxy Buds2 (")
)) {
return DeviceType.GALAXY_BUDS2;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceSpecificSettingsCustomizer getDeviceSpecificSettingsCustomizer(final GBDevice device) {
return new GalaxyBudsSettingsCustomizer(device);
}
@Override
public DeviceType getDeviceType() {
return DeviceType.GALAXY_BUDS2;
}
@Override
public int getBatteryCount() {
return 3;
}
@Override
public BatteryConfig[] getBatteryConfig() {
BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_buds_pro_case, R.string.battery_case);
BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_buds_pro_left, R.string.left_earbud);
BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_buds_pro_right, R.string.right_earbud);
return new BatteryConfig[]{battery1, battery2, battery3};
}
@Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_galaxy_buds_2,
};
}
}

View File

@ -20,6 +20,7 @@ import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.Dev
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_ANC_LEVEL;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_BALANCE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_NOISE_CONTROL;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_2_NOISE_CONTROL;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT_SWITCH;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_RIGHT;
@ -69,6 +70,8 @@ public class GalaxyBudsSettingsCustomizer implements DeviceSpecificSettingsCusto
final Preference pref_galaxy_buds_pro_noise_control = handler.findPreference(PREF_GALAXY_BUDS_PRO_NOISE_CONTROL);
String pref_galaxy_buds_pro_noise_control_value = prefs.getString(PREF_GALAXY_BUDS_PRO_NOISE_CONTROL, "0");
final Preference pref_galaxy_buds_2_noise_control = handler.findPreference(PREF_GALAXY_BUDS_2_NOISE_CONTROL);
String pref_galaxy_buds_2_noise_control_value = prefs.getString(PREF_GALAXY_BUDS_2_NOISE_CONTROL, "0");
final Preference pref_galaxy_buds_pro_anc_level = handler.findPreference(PREF_GALAXY_BUDS_PRO_ANC_LEVEL);
final Preference pref_galaxy_buds_ambient_volume = handler.findPreference(PREF_GALAXY_BUDS_AMBIENT_VOLUME);
@ -113,6 +116,36 @@ public class GalaxyBudsSettingsCustomizer implements DeviceSpecificSettingsCusto
});
}
if (pref_galaxy_buds_2_noise_control != null) {
switch (pref_galaxy_buds_2_noise_control_value) {
case "0":
case "1":
pref_galaxy_buds_ambient_volume.setEnabled(false);
break;
case "2":
pref_galaxy_buds_ambient_volume.setEnabled(true);
break;
}
pref_galaxy_buds_2_noise_control.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
handler.notifyPreferenceChanged(PREF_GALAXY_BUDS_2_NOISE_CONTROL);
switch (newVal.toString()) {
case "0":
case "1":
pref_galaxy_buds_ambient_volume.setEnabled(false);
break;
case "2":
pref_galaxy_buds_ambient_volume.setEnabled(true);
break;
}
return true;
}
});
}
final Preference pref_galaxy_buds_touch_right = handler.findPreference(PREF_GALAXY_BUDS_TOUCH_RIGHT);
String pref_galaxy_buds_touch_right_value = prefs.getString(PREF_GALAXY_BUDS_TOUCH_RIGHT, "1");

View File

@ -111,6 +111,7 @@ public enum DeviceType {
GALAXY_BUDS_PRO(418, R.drawable.ic_device_galaxy_buds_pro, R.drawable.ic_device_galaxy_buds_pro_disabled, R.string.devicetype_galaxybuds_pro),
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),
GALAXY_BUDS2(421, R.drawable.ic_device_galaxy_buds_pro, R.drawable.ic_device_galaxy_buds_pro_disabled, R.string.devicetype_galaxybuds_2),
SONY_WH_1000XM3(430, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm3),
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),

View File

@ -322,6 +322,7 @@ public class DeviceSupportFactory {
case GALAXY_BUDS_LIVE:
return new ServiceDeviceSupport(new GalaxyBudsDeviceSupport());
case GALAXY_BUDS_PRO:
case GALAXY_BUDS2:
return new ServiceDeviceSupport(new GalaxyBudsDeviceSupport(), ServiceDeviceSupport.Flags.BUSY_CHECKING);
case SONY_WH_1000XM3:
return new ServiceDeviceSupport(new SonyHeadphonesSupport());

View File

@ -32,7 +32,8 @@ public class GalaxyBudsIOThread extends BtClassicIoThread {
return galaxyBudsProtocol.UUID_GALAXY_BUDS_DEVICE_CTRL;
}
if (gbDevice.getType().equals(DeviceType.GALAXY_BUDS_LIVE)
|| gbDevice.getType().equals(DeviceType.GALAXY_BUDS_PRO)) {
|| gbDevice.getType().equals(DeviceType.GALAXY_BUDS_PRO)
|| gbDevice.getType().equals(DeviceType.GALAXY_BUDS2)) {
return galaxyBudsProtocol.UUID_GALAXY_BUDS_LIVE_DEVICE_CTRL;
}
return galaxyBudsProtocol.UUID_GALAXY_BUDS_DEVICE_CTRL;

View File

@ -107,8 +107,8 @@ public class GalaxyBudsProtocol extends GBDeviceProtocol {
// "Use ambient sound during calls"
private static final byte set_noise_controls_with_one_earbud = (byte) 0x6f; //0x0/0x1
// "Noise controls with one earbud" in Accessibility menu. I'm not exactly sure what it means,
// my guess is that it allows ANC even if only one earbuds is in-ear
// "Noise controls with one earbud" in Accessibility menu.
// It allows ANC and ambient sound even if only one earbud is in-ear.
private static final byte set_balance = (byte) 0x8f;
// takes value in 0-32 range, it is used to change left/right balance
@ -361,6 +361,10 @@ public class GalaxyBudsProtocol extends GBDeviceProtocol {
int noise_controls = Integer.parseInt(prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_NOISE_CONTROL, "0"));
return encodeMessage(set_noise_controls, (byte) noise_controls);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_2_NOISE_CONTROL:
int b2_noise_controls = Integer.parseInt(prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_2_NOISE_CONTROL, "0"));
return encodeMessage(set_noise_controls, (byte) b2_noise_controls);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_ANC_LEVEL:
int anc_level = Integer.parseInt(prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_ANC_LEVEL, "0"));
return encodeMessage(set_noise_reduction_level, (byte) anc_level);
@ -380,7 +384,7 @@ public class GalaxyBudsProtocol extends GBDeviceProtocol {
return encodeMessage(set_ambient_mode, enable_ambient);
case DeviceSettingsPreferenceConst.PREFS_GALAXY_BUDS_SEAMLESS_CONNECTION:
byte seamless_switch = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREFS_GALAXY_BUDS_SEAMLESS_CONNECTION, false) ? 0x01 : 0x00);
byte seamless_switch = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREFS_GALAXY_BUDS_SEAMLESS_CONNECTION, false) ? 0x00 : 0x01);
return encodeMessage(set_seamless_connection, seamless_switch);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS:
@ -517,7 +521,8 @@ public class GalaxyBudsProtocol extends GBDeviceProtocol {
protected GalaxyBudsProtocol(GBDevice device) {
super(device);
if (device.getType().equals(DeviceType.GALAXY_BUDS_LIVE)
|| device.getType().equals(DeviceType.GALAXY_BUDS_PRO)) {
|| device.getType().equals(DeviceType.GALAXY_BUDS_PRO)
|| device.getType().equals(DeviceType.GALAXY_BUDS2)) {
StartOfMessage = SOM_BUDS_PLUS;
EndOfMessage = EOM_BUDS_PLUS;
}

View File

@ -50,6 +50,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.banglejs.BangleJSCoordinator
import nodomain.freeyourgadget.gadgetbridge.devices.casio.gb6900.CasioGB6900DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.casio.gbx100.CasioGBX100DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.domyos.DomyosT540Cooridnator;
import nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds.GalaxyBuds2DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.flipper.zero.FlipperZeroCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds.GalaxyBudsDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds.GalaxyBudsLiveDeviceCoordinator;
@ -338,6 +339,7 @@ public class DeviceHelper {
result.add(new GalaxyBudsDeviceCoordinator());
result.add(new GalaxyBudsLiveDeviceCoordinator());
result.add(new GalaxyBudsProDeviceCoordinator());
result.add(new GalaxyBuds2DeviceCoordinator());
result.add(new VescCoordinator());
result.add(new SonyWH1000XM3Coordinator());
result.add(new SonyWH1000XM4Coordinator());

View File

@ -2491,14 +2491,14 @@
<item>@string/pref_switch_noise_control</item>
<item>@string/pref_title_touch_voice_assistant</item>
<item>@string/pref_media_volumedown</item>
<item>@string/pref_title_touch_spotify</item>
<item>@string/pref_title_touch_spotify_official_app</item>
</string-array>
<string-array name="galaxy_pro_touch_options_right">
<item>@string/pref_switch_noise_control</item>
<item>@string/pref_title_touch_voice_assistant</item>
<item>@string/pref_media_volumeup</item>
<item>@string/pref_title_touch_spotify</item>
<item>@string/pref_title_touch_spotify_official_app</item>
</string-array>
<string-array name="galaxy_pro_touch_options_values">

View File

@ -1735,7 +1735,7 @@
<string name="prefs_ambient_sound">Ambient Sound</string>
<string name="prefs_customize_ambient_sound_summary">Customize Ambient Sound</string>
<string name="prefs_ambient_sound_during_call_title">Ambient Sound during call</string>
<string name="prefs_ambient_sound_during_call_summary">Hear own voice during call</string>
<string name="prefs_ambient_sound_during_call_summary">Hear own voice clearly during calls</string>
<string name="prefs_ambient_mode">Ambient Mode</string>
<string name="prefs_ambient_settings_title">Ambient Sound Options</string>
<string name="prefs_active_noise_cancelling">Active Noise Cancelling</string>
@ -1760,6 +1760,8 @@
<string name="pref_title_touch_volume">Volume</string>
<string name="pref_title_touch_ambient">Ambient Sound</string>
<string name="pref_title_touch_spotify">Spotify</string>
<string name="pref_title_touch_spotify_official_app">Spotify (official app only)</string>
<string name="pref_title_touch_spotify_galaxy_app">Spotify (Galaxy Wearable app only)</string>
<string name="pref_switch_noise_control">Switch Noise Control</string>
<string name="prefs_noise_control_with_one_earbud">Noise Control with one earbud</string>
<string name="prefs_noise_control_with_one_earbud_summary">Allow noise control when using one earbud only</string>
@ -1773,7 +1775,7 @@
<string name="prefs_voice_detect">Voice detect</string>
<string name="prefs_voice_detect_summary">Enable Ambient sound and lower playback automatically after voice has been detected</string>
<string name="prefs_double_tap_edge">Double tap edge</string>
<string name="prefs_double_tap_edge_summary">Detect double tap even when not taped on touch pad</string>
<string name="prefs_double_tap_edge_summary">Detect double tap even when not tapped on touch pad</string>
<string name="prefs_voice_detect_duration">End after quiet for:</string>
<string name="pref_voice_detect_duration_5">5 seconds</string>
<string name="pref_voice_detect_duration_10">10 seconds</string>
@ -1816,7 +1818,7 @@
<string name="sony_anc_optimizer_status_starting">Starting…</string>
<string name="sony_anc_optimizer_status_not_running">Not Running</string>
<string name="sony_anc_optimizer_status_wearing_condition">Measuring wearing condition…</string>
<string name="sony_anc_optimizer_status_atmospheric_pressure">Measuring atmostpheric pressure…</string>
<string name="sony_anc_optimizer_status_atmospheric_pressure">Measuring atmospheric pressure…</string>
<string name="sony_anc_optimizer_status_analyzing">Analyzing…</string>
<string name="sony_anc_optimizer_status_finished">Finishing…</string>
<string name="sony_equalizer_preset_off">Off</string>
@ -1962,6 +1964,8 @@
<string name="step_streaks_achievements_sharing_title">Steps Achievements</string>
<string name="prefs_hourly_chime">Hourly chime</string>
<string name="prefs_hourly_chime_summary">The watch will beep once an hour</string>
<string name="devicetype_galaxybuds_2">Galaxy Buds2</string>
<string name="prefs_touch_lock_buds2">Touch controls</string>
<string name="devicetype_flipper_zero">Flipper zero</string>
<string name="activity_prefs_allow_bluetooth_intent_api">Bluetooth Intent API</string>
<string name="activity_prefs_summary_allow_bluetooth_intent_api">Allow controlling Bluetooth connection via Intent API</string>

View File

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen
android:icon="@drawable/ic_surround"
android:key="pref_galaxy_buds_pro_noise_control_preference"
android:persistent="false"
android:title="@string/prefs_noise_control">
<PreferenceCategory android:title="@string/prefs_noise_control">
<ListPreference
android:defaultValue="0"
android:entries="@array/galaxy_pro_noise_controls_options"
android:entryValues="@array/galaxy_pro_noise_controls_options_values"
android:icon="@drawable/ic_surround"
android:key="pref_galaxy_buds_2_noise_control"
android:summary="%s"
android:title="@string/prefs_noise_control" />
<SeekBarPreference
android:icon="@drawable/ic_volume_up"
android:key="pref_galaxy_buds_ambient_volume"
android:max="2"
android:min="0"
android:title="@string/prefs_ambient_volume"
app:showSeekBarValue="false" />
</PreferenceCategory>
</PreferenceScreen>
<ListPreference
android:defaultValue="0"
android:entries="@array/galaxy_buds_live_equalizer_modes"
android:entryValues="@array/galaxy_buds_live_equalizer_values"
android:icon="@drawable/ic_equalizer"
android:key="pref_galaxy_buds_equalizer_mode"
android:summary="%s"
android:title="@string/prefs_equalizer_preset" />
<PreferenceScreen
android:icon="@drawable/ic_touch"
android:key="prefs_galaxy_touch_options"
android:persistent="false"
android:title="@string/prefs_galaxy_touch_options">
<PreferenceCategory android:title="@string/prefs_galaxy_touch_options">
<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_touch"
android:key="pref_galaxy_buds_lock_touch"
android:title="@string/prefs_touch_lock_buds2" />
<ListPreference
android:defaultValue="0"
android:dependency="pref_galaxy_buds_lock_touch"
android:entries="@array/galaxy_pro_touch_options_left"
android:entryValues="@array/galaxy_pro_touch_options_values"
android:icon="@drawable/ic_switch_left"
android:key="pref_galaxy_buds_touch_left"
android:summary="%s"
android:title="@string/prefs_left" />
<ListPreference
android:defaultValue="0"
android:dependency="pref_galaxy_buds_lock_touch"
android:entries="@array/galaxy_pro_touch_switch_controls_options"
android:entryValues="@array/galaxy_pro_touch_switch_controls_values"
android:key="pref_galaxy_buds_touch_left_switch"
android:summary="%s"
android:title="@string/prefs_switch_control_left" />
<ListPreference
android:defaultValue="0"
android:dependency="pref_galaxy_buds_lock_touch"
android:entries="@array/galaxy_pro_touch_options_right"
android:entryValues="@array/galaxy_pro_touch_options_values"
android:icon="@drawable/ic_switch_right"
android:key="pref_galaxy_buds_touch_right"
android:summary="%s"
android:title="@string/prefs_right" />
<ListPreference
android:defaultValue="0"
android:dependency="pref_galaxy_buds_lock_touch"
android:entries="@array/galaxy_pro_touch_switch_controls_options"
android:entryValues="@array/galaxy_pro_touch_switch_controls_values"
android:key="pref_galaxy_buds_touch_right_switch"
android:summary="%s"
android:title="@string/prefs_switch_control_right" />
<SwitchPreference
android:defaultValue="false"
android:dependency="pref_galaxy_buds_lock_touch"
android:icon="@drawable/ic_touch"
android:key="pref_galaxy_pro_double_tap_edge"
android:summary="@string/prefs_double_tap_edge_summary"
android:title="@string/prefs_double_tap_edge" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_settings"
android:key="prefs_settings"
android:persistent="false"
android:title="@string/title_activity_settings">
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_hearing"
android:key="pref_galaxy_buds_pro_in_ear_detection"
android:summary="@string/prefs_in_ear_detection_summary"
android:title="@string/nothing_prefs_inear_title" />
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_auto_awesome"
android:key="prefs_galaxy_buds_seamless_connection"
android:summary="@string/prefs_seamless_connection_switch_summary"
android:title="@string/prefs_seamless_connection_switch_title" />
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_hearing"
android:key="pref_galaxy_buds_noise_controls_with_one_earbud"
android:summary="@string/prefs_noise_control_with_one_earbud_summary"
android:title="@string/prefs_noise_control_with_one_earbud" />
<SeekBarPreference
android:defaultValue="50"
android:icon="@drawable/ic_volume_up"
android:key="pref_galaxy_buds_pro_balance"
android:max="32"
android:min="0"
android:title="@string/pref_balance"
app:defaultValue="16"
app:showSeekBarValue="true" />
<PreferenceCategory android:title="@string/prefs_galaxy_buds_experimental">
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_videogame"
android:key="pref_galaxy_buds_game_mode"
android:summary="@string/prefs_game_mode_summary"
android:title="@string/prefs_game_mode" />
</PreferenceCategory>
<!-- <SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_graphic_eq"
android:key="pref_galaxy_buds_pro_read_notifications_outloud"
android:title="@string/prefs_read_notification_outloud" />
-->
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_settings_applications"
android:key="prefs_accessibility"
android:persistent="false"
android:title="@string/prefs_ambient_settings_title">
<PreferenceCategory android:title="@string/prefs_ambient_sound">
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_hearing"
android:key="pref_galaxy_buds_ambient_mode_during_call"
android:summary="@string/prefs_ambient_sound_during_call_summary"
android:title="@string/prefs_ambient_sound_during_call_title" />
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_hearing"
android:key="pref_galaxy_buds_ambient_sound"
android:summary="@string/prefs_customize_ambient_sound_summary"
android:title="@string/prefs_ambient_sound" />
<SeekBarPreference
android:defaultValue="1"
android:dependency="pref_galaxy_buds_ambient_sound"
android:icon="@drawable/ic_volume_up"
android:key="pref_galaxy_buds_pro_ambient_volume_right"
android:max="2"
android:min="0"
android:title="@string/prefs_ambient_volume_right"
app:showSeekBarValue="false" />
<SeekBarPreference
android:defaultValue="1"
android:dependency="pref_galaxy_buds_ambient_sound"
android:icon="@drawable/ic_volume_up"
android:key="pref_galaxy_buds_pro_ambient_volume_left"
android:max="2"
android:min="0"
android:title="@string/prefs_ambient_volume_left"
app:showSeekBarValue="false" />
<SeekBarPreference
android:defaultValue="1"
android:dependency="pref_galaxy_buds_ambient_sound"
android:icon="@drawable/ic_surround"
android:key="pref_galaxy_buds_pro_ambient_sound_tone"
android:max="4"
android:min="0"
android:summary="@string/pref_ambient_sound_tone_summary"
android:title="@string/pref_ambient_sound_tone"
app:showSeekBarValue="false" />
</PreferenceCategory>
</PreferenceScreen>
</androidx.preference.PreferenceScreen>