Rename toggle "Enable Bluetooth LE audio" to "Disable Bluetooth LE audio"
Bug: 275388899 Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioAllowListPreferenceControllerTest Change-Id: Ic936eb22aa4f6efd97d3a84b23a44fab83dd09a0
This commit is contained in:
@@ -36,13 +36,13 @@ public class BluetoothLeAudioPreferenceController
|
||||
extends DeveloperOptionsPreferenceController
|
||||
implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
|
||||
|
||||
private static final String PREFERENCE_KEY = "bluetooth_enable_leaudio";
|
||||
private static final String PREFERENCE_KEY = "bluetooth_disable_leaudio";
|
||||
|
||||
private static final String LE_AUDIO_DYNAMIC_SWITCH_PROPERTY =
|
||||
"ro.bluetooth.leaudio_switcher.supported";
|
||||
@VisibleForTesting
|
||||
static final String LE_AUDIO_DYNAMIC_ENABLED_PROPERTY =
|
||||
"persist.bluetooth.leaudio_switcher.enabled";
|
||||
static final String LE_AUDIO_SWITCHER_DISABLED_PROPERTY =
|
||||
"persist.bluetooth.leaudio_switcher.disabled";
|
||||
|
||||
private final DevelopmentSettingsDashboardFragment mFragment;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class BluetoothLeAudioPreferenceController
|
||||
final boolean leAudioEnabled =
|
||||
(isLeAudioSupportedStatus == BluetoothStatusCodes.FEATURE_SUPPORTED);
|
||||
|
||||
((SwitchPreference) mPreference).setChecked(leAudioEnabled);
|
||||
((SwitchPreference) mPreference).setChecked(!leAudioEnabled);
|
||||
|
||||
// Disable option if Bluetooth is disabled or if switch is not supported
|
||||
if (isLeAudioSupportedStatus == BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED
|
||||
@@ -101,10 +101,10 @@ public class BluetoothLeAudioPreferenceController
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean leAudioEnabled =
|
||||
(mBluetoothAdapter.isLeAudioSupported() == BluetoothStatusCodes.FEATURE_SUPPORTED);
|
||||
SystemProperties.set(LE_AUDIO_DYNAMIC_ENABLED_PROPERTY,
|
||||
Boolean.toString(!leAudioEnabled));
|
||||
final boolean leAudioDisabled =
|
||||
(mBluetoothAdapter.isLeAudioSupported() != BluetoothStatusCodes.FEATURE_SUPPORTED);
|
||||
SystemProperties.set(LE_AUDIO_SWITCHER_DISABLED_PROPERTY,
|
||||
Boolean.toString(!leAudioDisabled));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user