Refactor the PatchCommandThread for reuse.
Extract the CommandThread into PatchCommandThread and make it reusable
for other components interested in PatchPanel changes.
Test: manual
Bug: 252776298
Change-Id: I16db5341543328b4a84be238aa7c1b5804dfe7c9
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp
index b54b41f..3b428bb 100644
--- a/services/audioflinger/PatchPanel.cpp
+++ b/services/audioflinger/PatchPanel.cpp
@@ -449,7 +449,7 @@
if (status == NO_ERROR) {
*handle = (audio_patch_handle_t) mAudioFlinger.nextUniqueId(AUDIO_UNIQUE_ID_USE_PATCH);
newPatch.mHalHandle = halHandle;
- mAudioFlinger.mDeviceEffectManager.createAudioPatch(*handle, newPatch);
+ mAudioFlinger.mPatchCommandThread->createAudioPatch(*handle, newPatch);
if (insertedModule != AUDIO_MODULE_HANDLE_NONE) {
addSoftwarePatchToInsertedModules(insertedModule, *handle, &newPatch.mAudioPatch);
}
@@ -800,7 +800,7 @@
void AudioFlinger::PatchPanel::erasePatch(audio_patch_handle_t handle) {
mPatches.erase(handle);
removeSoftwarePatchFromInsertedModules(handle);
- mAudioFlinger.mDeviceEffectManager.releaseAudioPatch(handle);
+ mAudioFlinger.mPatchCommandThread->releaseAudioPatch(handle);
}
/* List connected audio ports and they attributes */