audio flinger: match app op monitoring to audio source
When monitoring app op to silence audio recording when app op
is lost, it must be done for the specific app op corresponding
to selected audio source.
Bug: 186582878
Test: music playback to head unit simulator
Change-Id: I86d8b6eecf480d70dc9c0e974a92e6407ee73041
diff --git a/media/utils/ServiceUtilities.cpp b/media/utils/ServiceUtilities.cpp
index e3931b1..214a174 100644
--- a/media/utils/ServiceUtilities.cpp
+++ b/media/utils/ServiceUtilities.cpp
@@ -67,7 +67,7 @@
return packages[0];
}
-static int32_t getOpForSource(audio_source_t source) {
+int32_t getOpForSource(audio_source_t source) {
switch (source) {
case AUDIO_SOURCE_HOTWORD:
return AppOpsManager::OP_RECORD_AUDIO_HOTWORD;
@@ -133,8 +133,8 @@
return true;
}
-bool recordingAllowed(const Identity& identity) {
- return checkRecordingInternal(identity, String16(), /*start*/ false, AUDIO_SOURCE_DEFAULT);
+bool recordingAllowed(const Identity& identity, audio_source_t source) {
+ return checkRecordingInternal(identity, String16(), /*start*/ false, source);
}
bool startRecording(const Identity& identity, const String16& msg, audio_source_t source) {