CEC : Use system property to get the audio device name

Bug: 15990136
Test: make
Change-Id: I2452f5bf2b6b7c698cc82506f24f1dab61fcfc04
This commit is contained in:
Shraddha Basantwani
2020-08-19 10:55:38 +05:30
parent 5c8e5ca313
commit b739c22a4d

View File

@@ -635,17 +635,17 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
private byte[] getSupportedShortAudioDescriptorsFromConfig(
List<DeviceConfig> deviceConfig, @AudioCodec int[] audioFormatCodes) {
DeviceConfig deviceConfigToUse = null;
String audioDeviceName = SystemProperties.get(
Constants.PROPERTY_SYSTEM_AUDIO_MODE_AUDIO_PORT,
"VX_AUDIO_DEVICE_IN_HDMI_ARC");
for (DeviceConfig device : deviceConfig) {
// TODO(amyjojo) use PROPERTY_SYSTEM_AUDIO_MODE_AUDIO_PORT to get the audio device name
if (device.name.equals("VX_AUDIO_DEVICE_IN_HDMI_ARC")) {
if (device.name.equals(audioDeviceName)) {
deviceConfigToUse = device;
break;
}
}
if (deviceConfigToUse == null) {
// TODO(amyjojo) use PROPERTY_SYSTEM_AUDIO_MODE_AUDIO_PORT to get the audio device name
Slog.w(TAG, "sadConfig.xml does not have required device info for "
+ "VX_AUDIO_DEVICE_IN_HDMI_ARC");
Slog.w(TAG, "sadConfig.xml does not have required device info for " + audioDeviceName);
return new byte[0];
}
HashMap<Integer, byte[]> map = new HashMap<>();