Loading audio/aidl/default/Module.cpp +20 −17 Original line number Diff line number Diff line Loading @@ -454,16 +454,15 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA LOG(ERROR) << __func__ << ": port id " << templateId << " is not a device port"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (!templateIt->profiles.empty()) { LOG(ERROR) << __func__ << ": port id " << templateId << " does not have dynamic profiles"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } auto& templateDevicePort = templateIt->ext.get<AudioPortExt::Tag::device>(); if (templateDevicePort.device.type.connection.empty()) { LOG(ERROR) << __func__ << ": port id " << templateId << " is permanently attached"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (mConnectedDevicePorts.find(templateId) != mConnectedDevicePorts.end()) { LOG(ERROR) << __func__ << ": port id " << templateId << " is a connected device port"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } // Postpone id allocation until we ensure that there are no client errors. connectedPort = *templateIt; connectedPort.extraAudioDescriptors = in_templateIdAndAdditionalData.extraAudioDescriptors; Loading @@ -486,6 +485,7 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA } } if (connectedPort.profiles.empty()) { if (!mDebug.simulateDeviceConnections) { RETURN_STATUS_IF_ERROR(populateConnectedDevicePort(&connectedPort)); } else { Loading @@ -496,10 +496,13 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA } } if (connectedPort.profiles.empty()) { LOG(ERROR) << "Profiles of a connected port still empty after connecting external device " LOG(ERROR) << __func__ << ": profiles of a connected port still empty after connecting external " "device " << connectedPort.toString(); return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } } for (auto profile : connectedPort.profiles) { if (profile.channelMasks.empty()) { Loading Loading
audio/aidl/default/Module.cpp +20 −17 Original line number Diff line number Diff line Loading @@ -454,16 +454,15 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA LOG(ERROR) << __func__ << ": port id " << templateId << " is not a device port"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (!templateIt->profiles.empty()) { LOG(ERROR) << __func__ << ": port id " << templateId << " does not have dynamic profiles"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } auto& templateDevicePort = templateIt->ext.get<AudioPortExt::Tag::device>(); if (templateDevicePort.device.type.connection.empty()) { LOG(ERROR) << __func__ << ": port id " << templateId << " is permanently attached"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (mConnectedDevicePorts.find(templateId) != mConnectedDevicePorts.end()) { LOG(ERROR) << __func__ << ": port id " << templateId << " is a connected device port"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } // Postpone id allocation until we ensure that there are no client errors. connectedPort = *templateIt; connectedPort.extraAudioDescriptors = in_templateIdAndAdditionalData.extraAudioDescriptors; Loading @@ -486,6 +485,7 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA } } if (connectedPort.profiles.empty()) { if (!mDebug.simulateDeviceConnections) { RETURN_STATUS_IF_ERROR(populateConnectedDevicePort(&connectedPort)); } else { Loading @@ -496,10 +496,13 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA } } if (connectedPort.profiles.empty()) { LOG(ERROR) << "Profiles of a connected port still empty after connecting external device " LOG(ERROR) << __func__ << ": profiles of a connected port still empty after connecting external " "device " << connectedPort.toString(); return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } } for (auto profile : connectedPort.profiles) { if (profile.channelMasks.empty()) { Loading