Add AudioChannelMask to Framework SAIDL definition
Framework SAIDL used to use 'int' for the channel mask
type. To help finding all the places where channel masks
are used, add a designated type. Currently it's an enum,
but it will be changed to a more extendable type soon (see
the bug and the plan document).
Bug: 188932434
Test: m
Change-Id: If2d958fcc92b8e549493d3fa83b35c12dcda2ccc
diff --git a/media/libaudioclient/IAudioFlinger.cpp b/media/libaudioclient/IAudioFlinger.cpp
index b517588..f89de97 100644
--- a/media/libaudioclient/IAudioFlinger.cpp
+++ b/media/libaudioclient/IAudioFlinger.cpp
@@ -408,8 +408,8 @@
int32_t sampleRateAidl = VALUE_OR_RETURN(convertIntegral<int32_t>(sampleRate));
media::AudioFormatSys formatAidl = VALUE_OR_RETURN(
legacy2aidl_audio_format_t_AudioFormat(format));
- int32_t channelMaskAidl = VALUE_OR_RETURN(
- legacy2aidl_audio_channel_mask_t_int32_t(channelMask));
+ media::AudioChannelMask channelMaskAidl = VALUE_OR_RETURN(
+ legacy2aidl_audio_channel_mask_t_AudioChannelMask(channelMask));
int64_t aidlRet;
RETURN_IF_ERROR(statusTFromBinderStatus(
mDelegate->getInputBufferSize(sampleRateAidl, formatAidl, channelMaskAidl,
@@ -927,12 +927,13 @@
Status AudioFlingerServerAdapter::getInputBufferSize(int32_t sampleRate,
media::AudioFormatSys format,
- int32_t channelMask, int64_t* _aidl_return) {
+ media::AudioChannelMask channelMask,
+ int64_t* _aidl_return) {
uint32_t sampleRateLegacy = VALUE_OR_RETURN_BINDER(convertIntegral<uint32_t>(sampleRate));
audio_format_t formatLegacy = VALUE_OR_RETURN_BINDER(
aidl2legacy_AudioFormat_audio_format_t(format));
audio_channel_mask_t channelMaskLegacy = VALUE_OR_RETURN_BINDER(
- aidl2legacy_int32_t_audio_channel_mask_t(channelMask));
+ aidl2legacy_AudioChannelMask_audio_channel_mask_t(channelMask));
size_t size = mDelegate->getInputBufferSize(sampleRateLegacy, formatLegacy, channelMaskLegacy);
*_aidl_return = VALUE_OR_RETURN_BINDER(convertIntegral<int64_t>(size));
return Status::ok();