aaudio: prevent apps from affecting a stream they do not own
Bug: 62951648
Test: need test that hacks a stream handle from another user ID
Change-Id: I342f2a4cf9350c949f346b3c867d7f9e035c76b4
diff --git a/services/oboeservice/AAudioService.h b/services/oboeservice/AAudioService.h
index c622f5d..9b6b342 100644
--- a/services/oboeservice/AAudioService.h
+++ b/services/oboeservice/AAudioService.h
@@ -64,11 +64,11 @@
virtual aaudio_result_t flushStream(aaudio_handle_t streamHandle);
virtual aaudio_result_t registerAudioThread(aaudio_handle_t streamHandle,
- pid_t pid, pid_t tid,
- int64_t periodNanoseconds) ;
+ pid_t tid,
+ int64_t periodNanoseconds) ;
virtual aaudio_result_t unregisterAudioThread(aaudio_handle_t streamHandle,
- pid_t pid, pid_t tid);
+ pid_t tid);
private:
@@ -76,6 +76,9 @@
HandleTracker mHandleTracker;
+ uid_t mCachedUserId = -1;
+ pid_t mCachedProcessId = -1;
+
enum constants {
DEFAULT_AUDIO_PRIORITY = 2
};