Switch the framework AIDL to use AudioDeviceDescription
'AudioDeviceDescription' is a new type that will be used
both by HAL and framework interfaces. This CL changes the
framework interfaces to use it instead of 'int' type
which was used to pass legacy 'audio_devices_t' transparently
via the AIDL layer.
Bug: 188932434
Test: check audio on device
Change-Id: Ie275ea82db89011c855ac21f0af4f6546ceb2d13
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 54a6425..1f19fc9 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2810,7 +2810,9 @@
{
Mutex::Autolock _l(mLock);
- if (request.device.type == AUDIO_DEVICE_NONE) {
+ AudioDeviceTypeAddr device = VALUE_OR_RETURN_STATUS(
+ aidl2legacy_AudioDeviceTypeAddress(request.device));
+ if (device.mType == AUDIO_DEVICE_NONE) {
return BAD_VALUE;
}
@@ -2818,8 +2820,6 @@
aidl2legacy_int32_t_audio_io_handle_t(request.input));
audio_config_t config = VALUE_OR_RETURN_STATUS(
aidl2legacy_AudioConfig_audio_config_t(request.config));
- AudioDeviceTypeAddr device = VALUE_OR_RETURN_STATUS(
- aidl2legacy_AudioDeviceTypeAddress(request.device));
sp<ThreadBase> thread = openInput_l(
VALUE_OR_RETURN_STATUS(aidl2legacy_int32_t_audio_module_handle_t(request.module)),