Phone fails to switch channel mode from stereo to mono

-Set codec to SBC when HD audio is off

Bug: 194349060
Test: make -j50 RunSettingsRoboTests

Change-Id: Iae4aa3f1d77350f5b4d91e7a687e048091c1daea
This commit is contained in:
Tim Peng
2021-08-20 05:43:29 +00:00
parent ab7640dcd9
commit 07b3675717
3 changed files with 51 additions and 3 deletions

View File

@@ -93,8 +93,9 @@ public class BluetoothCodecDialogPreferenceController extends
int codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT;
switch (index) {
case 0:
codecTypeValue = getHighestCodec(getSelectableConfigs(
mBluetoothA2dp.getActiveDevice()));
final BluetoothDevice activeDevice = mBluetoothA2dp.getActiveDevice();
codecTypeValue = getHighestCodec(mBluetoothA2dp, activeDevice,
getSelectableConfigs(activeDevice));
codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST;
break;
case 1:
@@ -147,6 +148,11 @@ public class BluetoothCodecDialogPreferenceController extends
mCallback.onBluetoothCodecChanged();
}
@Override
public void onHDAudioEnabled(boolean enabled) {
writeConfigurationValues(/* index= */ 0);
}
private List<Integer> getIndexFromConfig(BluetoothCodecConfig[] configs) {
List<Integer> indexArray = new ArrayList<>();
for (int i = 0; i < configs.length; i++) {