mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
audio: Set connectedProfiles for non-attached device ports. am: f7492518c7 am: 6788dcd1f8 am: abcc5cd2c8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794108 Change-Id: Ia00d4ea2e89d6fcb2ab4436d0daca57957ce673c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
9bee81e56b
@@ -185,6 +185,11 @@ std::ostream& operator<<(std::ostream& os, Module::Type t) {
|
||||
return os;
|
||||
}
|
||||
|
||||
Module::Module(Type type, std::unique_ptr<Configuration>&& config)
|
||||
: mType(type), mConfig(std::move(config)) {
|
||||
populateConnectedProfiles();
|
||||
}
|
||||
|
||||
void Module::cleanUpPatch(int32_t patchId) {
|
||||
erase_all_values(mPatches, std::set<int32_t>{patchId});
|
||||
}
|
||||
@@ -325,6 +330,22 @@ ndk::ScopedAStatus Module::findPortIdForNewStream(int32_t in_portConfigId, Audio
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
void Module::populateConnectedProfiles() {
|
||||
Configuration& config = getConfig();
|
||||
for (const AudioPort& port : config.ports) {
|
||||
if (port.ext.getTag() == AudioPortExt::device) {
|
||||
if (auto devicePort = port.ext.get<AudioPortExt::device>();
|
||||
!devicePort.device.type.connection.empty() && port.profiles.empty()) {
|
||||
if (auto connIt = config.connectedProfiles.find(port.id);
|
||||
connIt == config.connectedProfiles.end()) {
|
||||
config.connectedProfiles.emplace(
|
||||
port.id, internal::getStandard16And24BitPcmAudioProfiles());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename C>
|
||||
std::set<int32_t> Module::portIdsFromPortConfigIds(C portConfigIds) {
|
||||
std::set<int32_t> result;
|
||||
|
||||
Reference in New Issue
Block a user