audioflinger: Pass pid of process creating track or opening record
AudioFlinger allocates a Client heap for each unique pid.
If two applications use mediaplayer APIs, the same Client heap
is reused as the pid used is not the application pid but that
of mediaserver. With this change, the pid of the application
pid is used to decide the heap to be used.
Bug: 23525542
Bug: 28772898
Change-Id: I31a695b0b321eff6e2aca80c3bc4aeb3e1cd9ac7
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 1ade4ba..984bc02 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -73,6 +73,7 @@
// reference and will release it when the track is destroyed.
// However on failure, the client is responsible for release.
audio_io_handle_t output,
+ pid_t pid,
pid_t tid, // -1 means unused, otherwise must be valid non-0
audio_session_t *sessionId,
int clientUid,
@@ -89,6 +90,7 @@
const String16& callingPackage,
size_t *pFrameCount,
track_flags_t *flags,
+ pid_t pid,
pid_t tid, // -1 means unused, otherwise must be valid non-0
int clientUid,
audio_session_t *sessionId,