aaudio: limit number of streams per process
Testing the new max streams restriction revealed the bug
involving the second shared stream.
Bug: 62951298
Bug: 63171495
Test: test_n_streams.cpp can open MAX_STREAMS_PER_PROCESS MMAP streams
Change-Id: Ibea7d9c4716326a37c669954b52f397ed2968caa
diff --git a/services/oboeservice/AAudioClientTracker.h b/services/oboeservice/AAudioClientTracker.h
index 447665b..e74c8bf 100644
--- a/services/oboeservice/AAudioClientTracker.h
+++ b/services/oboeservice/AAudioClientTracker.h
@@ -38,6 +38,8 @@
void unregisterClient(pid_t pid);
+ int32_t getStreamCount(pid_t pid);
+
aaudio_result_t registerClientStream(pid_t pid,
android::sp<AAudioServiceStreamBase> serviceStream);
@@ -53,11 +55,17 @@
}
private:
+
+ /**
+ * One per process.
+ */
class NotificationClient : public IBinder::DeathRecipient {
public:
NotificationClient(pid_t pid);
virtual ~NotificationClient();
+ int32_t getStreamCount();
+
aaudio_result_t registerClientStream(android::sp<AAudioServiceStreamBase> serviceStream);
aaudio_result_t unregisterClientStream(android::sp<AAudioServiceStreamBase> serviceStream);