aaudio: pass strong pointers into threads
The AAudio service has several threads that are used
to handle routing changes (disconnects), and also the
timestamp generating thread.
In this CL we pass a strong pointer to the owning object into
the thread in order to prevent the object from being deleted
while the thread is running.
Bug: 179331032
Bug: 184774807
Test: atest CtsNativeMediaAAudioTestCases
Test: Run OboeTester "TEST DISCONNECTS" test.
Change-Id: I894f5c38fdf111257dea2bee9561c13608da52aa
diff --git a/services/oboeservice/AAudioServiceEndpoint.cpp b/services/oboeservice/AAudioServiceEndpoint.cpp
index faea58f..13dd3d3 100644
--- a/services/oboeservice/AAudioServiceEndpoint.cpp
+++ b/services/oboeservice/AAudioServiceEndpoint.cpp
@@ -38,6 +38,10 @@
using namespace android; // TODO just import names needed
using namespace aaudio; // TODO just import names needed
+AAudioServiceEndpoint::~AAudioServiceEndpoint() {
+ ALOGD("%s() called", __func__);
+}
+
std::string AAudioServiceEndpoint::dump() const NO_THREAD_SAFETY_ANALYSIS {
std::stringstream result;