diff --git a/audio/aidl/common/include/Utils.h b/audio/aidl/common/include/Utils.h index 2cf862c81d..305c92471e 100644 --- a/audio/aidl/common/include/Utils.h +++ b/audio/aidl/common/include/Utils.h @@ -99,6 +99,12 @@ constexpr size_t getFrameSizeInBytes( return 0; } +constexpr bool isDefaultAudioFormat( + const ::aidl::android::media::audio::common::AudioFormatDescription& desc) { + return desc.type == ::aidl::android::media::audio::common::AudioFormatType::DEFAULT && + desc.pcm == ::aidl::android::media::audio::common::PcmType::DEFAULT; +} + constexpr bool isTelephonyDeviceType( ::aidl::android::media::audio::common::AudioDeviceType device) { return device == ::aidl::android::media::audio::common::AudioDeviceType::IN_TELEPHONY_RX || diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp index 984b9a1014..71dc4595e3 100644 --- a/audio/aidl/default/Module.cpp +++ b/audio/aidl/default/Module.cpp @@ -143,6 +143,21 @@ StreamOut::CreateInstance Module::getStreamOutCreator(Type type) { } } +std::ostream& operator<<(std::ostream& os, Module::Type t) { + switch (t) { + case Module::Type::DEFAULT: + os << "default"; + break; + case Module::Type::R_SUBMIX: + os << "r_submix"; + break; + case Module::Type::USB: + os << "usb"; + break; + } + return os; +} + void Module::cleanUpPatch(int32_t patchId) { erase_all_values(mPatches, std::set{patchId}); } @@ -352,16 +367,17 @@ void Module::updateStreamsConnectedState(const AudioPatch& oldPatch, const Audio ndk::ScopedAStatus Module::setModuleDebug( const ::aidl::android::hardware::audio::core::ModuleDebug& in_debug) { - LOG(DEBUG) << __func__ << ": old flags:" << mDebug.toString() + LOG(DEBUG) << __func__ << ": " << mType << ": old flags:" << mDebug.toString() << ", new flags: " << in_debug.toString(); if (mDebug.simulateDeviceConnections != in_debug.simulateDeviceConnections && !mConnectedDevicePorts.empty()) { - LOG(ERROR) << __func__ << ": attempting to change device connections simulation " - << "while having external devices connected"; + LOG(ERROR) << __func__ << ": " << mType + << ": attempting to change device connections simulation while having external " + << "devices connected"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } if (in_debug.streamTransientStateDelayMs < 0) { - LOG(ERROR) << __func__ << ": streamTransientStateDelayMs is negative: " + LOG(ERROR) << __func__ << ": " << mType << ": streamTransientStateDelayMs is negative: " << in_debug.streamTransientStateDelayMs; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp index b7203053fa..62b4270a11 100644 --- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp @@ -129,7 +129,9 @@ AudioDeviceAddress::Tag suggestDeviceAddressTag(const AudioDeviceDescription& de using Tag = AudioDeviceAddress::Tag; if (std::string_view connection = description.connection; connection == AudioDeviceDescription::CONNECTION_BT_A2DP || - connection == AudioDeviceDescription::CONNECTION_BT_LE || + // Note: BT LE Broadcast uses a "group id". + (description.type != AudioDeviceType::OUT_BROADCAST && + connection == AudioDeviceDescription::CONNECTION_BT_LE) || connection == AudioDeviceDescription::CONNECTION_BT_SCO || connection == AudioDeviceDescription::CONNECTION_WIRELESS) { return Tag::mac;