aaudio: fix crash on disconnect for shared streams
This fixes a regression caused by ag/12396646
That CL changed the way that AudioStreams are managed
using android::sp<>. Unfortunately it caused
a crash in audioserver when shared streams were disconnected.
The root cause was calling disconnectedRegisteredStreams()
from a data processing thread, which resulted
in deleting the object while the thread was using it.
The call was unnecessary so it was removed.
Bug: 164411271
Bug: 166877425
Test: adb logcat *:F
Test: Use OboeTester TEST DISCONNECT
Test: See b/166877425 for more details
Change-Id: I30fc7f00061a9caf5e3d9f7c8e257102c34f9d92
diff --git a/services/oboeservice/AAudioServiceEndpointCapture.cpp b/services/oboeservice/AAudioServiceEndpointCapture.cpp
index 206a264..1401120 100644
--- a/services/oboeservice/AAudioServiceEndpointCapture.cpp
+++ b/services/oboeservice/AAudioServiceEndpointCapture.cpp
@@ -65,7 +65,7 @@
result = getStreamInternal()->read(mDistributionBuffer.get(),
getFramesPerBurst(), timeoutNanos);
if (result == AAUDIO_ERROR_DISCONNECTED) {
- disconnectRegisteredStreams();
+ ALOGV("%s() read() returned AAUDIO_ERROR_DISCONNECTED, break", __func__);
break;
} else if (result != getFramesPerBurst()) {
ALOGW("callbackLoop() read %d / %d",