mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
audio: Fix update of an existing patch
The code for updating the existing patch did not modify the patch stored in the module's list of patches. Added a test which switches the patch to another port config and validates that 'Module.getAudioPatches' returns the updated patch. Bug: 302573756 Test: atest VtsHalAudioCoreTargetTest Change-Id: I0e3412b9387cd451436a48af116dc5a940d868cf
This commit is contained in:
@@ -515,7 +515,7 @@ ndk::ScopedAStatus Module::connectExternalDevice(const AudioPort& in_templateIdA
|
||||
}
|
||||
}
|
||||
|
||||
connectedPort.id = ++getConfig().nextPortId;
|
||||
connectedPort.id = getConfig().nextPortId++;
|
||||
auto [connectedPortsIt, _] =
|
||||
mConnectedDevicePorts.insert(std::pair(connectedPort.id, std::set<int32_t>()));
|
||||
LOG(DEBUG) << __func__ << ": template port " << templateId << " external device connected, "
|
||||
@@ -865,6 +865,7 @@ ndk::ScopedAStatus Module::setAudioPatch(const AudioPatch& in_requested, AudioPa
|
||||
patches.push_back(*_aidl_return);
|
||||
} else {
|
||||
oldPatch = *existing;
|
||||
*existing = *_aidl_return;
|
||||
}
|
||||
patchesBackup = mPatches;
|
||||
registerPatch(*_aidl_return);
|
||||
|
||||
Reference in New Issue
Block a user