Remove dependency on android.media.audio.common.AudioFormat
In a preparation to converting audio HAL to SAIDL,
ensure that Framework SAIDL is self-contained and
has all the necessary types.
This creates a temporary duplication of types with
android.media.audio.common which will be fixed once
we stabilize the common types between the framework
and HALs.
Bug: 188932434
Test: m
Change-Id: Ib632c0ae5d2d1562266c87480b585b1b7f6e5ac6
diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp
index 0bc592d..48b74f1 100644
--- a/media/libaudioclient/AudioSystem.cpp
+++ b/media/libaudioclient/AudioSystem.cpp
@@ -1842,7 +1842,7 @@
media::Int numSurroundFormatsAidl;
numSurroundFormatsAidl.value =
VALUE_OR_RETURN_STATUS(convertIntegral<int32_t>(*numSurroundFormats));
- std::vector<media::audio::common::AudioFormat> surroundFormatsAidl;
+ std::vector<media::AudioFormatSys> surroundFormatsAidl;
std::vector<bool> surroundFormatsEnabledAidl;
RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(
aps->getSurroundFormats(&numSurroundFormatsAidl, &surroundFormatsAidl,
@@ -1869,7 +1869,7 @@
media::Int numSurroundFormatsAidl;
numSurroundFormatsAidl.value =
VALUE_OR_RETURN_STATUS(convertIntegral<int32_t>(*numSurroundFormats));
- std::vector<media::audio::common::AudioFormat> surroundFormatsAidl;
+ std::vector<media::AudioFormatSys> surroundFormatsAidl;
RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(
aps->getReportedSurroundFormats(&numSurroundFormatsAidl, &surroundFormatsAidl)));
@@ -1885,7 +1885,7 @@
const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
if (aps == 0) return PERMISSION_DENIED;
- media::audio::common::AudioFormat audioFormatAidl = VALUE_OR_RETURN_STATUS(
+ media::AudioFormatSys audioFormatAidl = VALUE_OR_RETURN_STATUS(
legacy2aidl_audio_format_t_AudioFormat(audioFormat));
return statusTFromBinderStatus(
aps->setSurroundFormatEnabled(audioFormatAidl, enabled));
@@ -1939,7 +1939,7 @@
& aps = AudioSystem::get_audio_policy_service();
if (aps == 0) return PERMISSION_DENIED;
- std::vector<media::audio::common::AudioFormat> formatsAidl;
+ std::vector<media::AudioFormatSys> formatsAidl;
RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(
aps->getHwOffloadEncodingFormatsSupportedForA2DP(&formatsAidl)));
*formats = VALUE_OR_RETURN_STATUS(