audio policy: fix record op monitor use of wrong command thread
commit ed726ccd introduced a potential deadlock in the audio policy
commnand thread dedicated to commands going from audio policy manager
to audioflinger. The thread was used by mistake when posting a command
to update the UID states which requires to take the audio policy service
lock. This type of commands should never be run in the audio command
thread but in the output command thread instead.
Bug: 193164403
Test: atest AudioPlaybackCaptureTest#testStopMediaProjectionDuringCapture
Change-Id: I150c768dd562f2658eaf4a31b837cf677136a3af
diff --git a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index b4b6ddf..9987252 100644
--- a/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -675,7 +675,7 @@
sp<AudioRecordClient> client = new AudioRecordClient(attr, input, session, portId,
selectedDeviceId, adjAttributionSource,
canCaptureOutput, canCaptureHotword,
- mAudioCommandThread);
+ mOutputCommandThread);
mAudioRecordClients.add(portId, client);
}