Use start/finish app op API for mic use
Since recording is a long running operation we need to use
the start/finish app op APIs since now system UI would watch
for active mic/camera/overlay ops and badge app notifications
with icons denoting that these capabilities are being used.
Test: atest android.media.cts.AudioRecordAppOpTest
bug: 64085448
Change-Id: I47d9b507ef5d757d34d65484c112cea6cdc246e1
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 9a30f71..c025654 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -3051,6 +3051,7 @@
// check recording permission for visualizer
if ((memcmp(&desc.type, SL_IID_VISUALIZATION, sizeof(effect_uuid_t)) == 0) &&
+ // TODO: Do we need to start/stop op - i.e. is there recording being performed?
!recordingAllowed(opPackageName, pid, IPCThreadState::self()->getCallingUid())) {
lStatus = PERMISSION_DENIED;
goto Exit;