Correct attribution source for MMAP thread
Ensure that the package name, which is used for listening for appops
below getInputForAttr, is corrected for MMAP threads.
Bug: 268724205
Test: AudioRecordTest
Test: Oboetester MMAP record silenced when backgrounded - 6s
Change-Id: Ia6fc1bff815bbbb2fee8bc1a60569a663a713e4b
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 8d0c648..64de99a 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -9985,6 +9985,9 @@
audio_port_handle_t portId = AUDIO_PORT_HANDLE_NONE;
audio_io_handle_t io = mId;
+ AttributionSourceState adjAttributionSource = AudioFlinger::checkAttributionSourcePackage(
+ client.attributionSource);
+
if (isOutput()) {
audio_config_t config = AUDIO_CONFIG_INITIALIZER;
config.sample_rate = mSampleRate;
@@ -10000,7 +10003,7 @@
ret = AudioSystem::getOutputForAttr(&mAttr, &io,
mSessionId,
&stream,
- client.attributionSource,
+ adjAttributionSource,
&config,
flags,
&deviceId,
@@ -10019,7 +10022,7 @@
ret = AudioSystem::getInputForAttr(&mAttr, &io,
RECORD_RIID_INVALID,
mSessionId,
- client.attributionSource,
+ adjAttributionSource,
&config,
AUDIO_INPUT_FLAG_MMAP_NOIRQ,
&deviceId,