audioflinger: fix reuse of audio HAL patch handle
Fix bug in PatchPanel::createAudioPatch() were the previous
audio HAL assigned patch handle was dropped when modifying an exiting
audio patch
Bug: 137300168
Test: manual test with USB headset insertion removal
Change-Id: Ie8345ca97502a2d7327535f0228e0ff0bc95f8e9
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp
index cb1ef7f..53e2dd5 100644
--- a/services/audioflinger/PatchPanel.cpp
+++ b/services/audioflinger/PatchPanel.cpp
@@ -168,6 +168,7 @@
if (hwDevice != 0) {
hwDevice->releaseAudioPatch(removedPatch.mHalHandle);
}
+ halHandle = removedPatch.mHalHandle;
}
mPatches.erase(iter);
removeSoftwarePatchFromInsertedModules(*handle);