Config LE audio connection by default

Use LE audio connection by default, and allow to have the differenct
configuration per project (system property). As using LE audio connection by
default, the toggle, "Show LE audio toggle in Device Details", would be
useless, hide this toggle based on the project configuration

Bug: 300012501
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeDeviceDetailsPreferenceControllerTest
Change-Id: Ia4df48d6a71b5b9f11bd91a69971c8393412da13
This commit is contained in:
Alice Kuo
2023-10-08 05:09:24 +08:00
parent b2336ea7db
commit ddec75bb39
3 changed files with 21 additions and 12 deletions

View File

@@ -114,6 +114,7 @@ public class BluetoothLeAudioDeviceDetailsPreferenceControllerTest {
@Test
public void isAvailable_leAudioSupported() {
mController.mLeAudioEnabledByDefault = false;
mController.sLeAudioSupportedStateCache = BluetoothStatusCodes.ERROR_UNKNOWN;
when(mBluetoothAdapter.isLeAudioSupported())
.thenReturn(BluetoothStatusCodes.FEATURE_SUPPORTED);
@@ -122,9 +123,16 @@ public class BluetoothLeAudioDeviceDetailsPreferenceControllerTest {
@Test
public void isAvailable_leAudioNotSupported() {
mController.mLeAudioEnabledByDefault = false;
mController.sLeAudioSupportedStateCache = BluetoothStatusCodes.ERROR_UNKNOWN;
when(mBluetoothAdapter.isLeAudioSupported())
.thenReturn(BluetoothStatusCodes.FEATURE_NOT_SUPPORTED);
assertThat(mController.isAvailable()).isFalse();
}
@Test
public void isUnAvailable_ifLeAudioConnectionByDefault() {
mController.mLeAudioEnabledByDefault = true;
assertThat(mController.isAvailable()).isFalse();
}
}