Skip to content

Commit 3e9fa16

Browse files
ValdikSSluca020400
authored andcommitted
Allow SBC as HD audio codec in Bluetooth device configuration
Change-Id: I4d149e87e27e16d571f53d0521f12a8ab9d0fc94
1 parent 24de8e5 commit 3e9fa16

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public String getHighQualityAudioOptionLabel(BluetoothDevice device) {
309309

310310
final BluetoothCodecConfig codecConfig = (selectable == null || selectable.length < 1)
311311
? null : selectable[0];
312-
final int codecType = (codecConfig == null || codecConfig.isMandatoryCodec())
312+
final int codecType = (codecConfig == null)
313313
? BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID : codecConfig.getCodecType();
314314

315315
int index = -1;

packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/A2dpProfileTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ public void getLabelDeviceConnectedButNotHighQualityCodec() {
184184
when(status.getCodecsSelectableCapabilities()).thenReturn(configs);
185185

186186
when(config.isMandatoryCodec()).thenReturn(true);
187-
assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo(UNKNOWN_CODEC_LABEL);
187+
when(config.getCodecName()).thenReturn("SBC");
188+
assertThat(mProfile.getHighQualityAudioOptionLabel(mDevice)).isEqualTo(
189+
String.format(KNOWN_CODEC_LABEL, config.getCodecName()));
188190
}
189191

190192
@Test

0 commit comments

Comments
 (0)