summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-08-19 17:08:09 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-08-19 17:08:09 -0700
commit61bd7a0281ffecb99b27bff63334c559df7357e6 (patch)
tree7dabc579d3c5bcc03136fdffb50970321eef0e8e /services/audioflinger/AudioFlinger.cpp
parentca50e46baee42120a631b67243f7c3acb911e307 (diff)
parent0541b3bb40fa23e97e0a4599463b6afc0e271939 (diff)
downloadframeworks_av-61bd7a0281ffecb99b27bff63334c559df7357e6.zip
frameworks_av-61bd7a0281ffecb99b27bff63334c559df7357e6.tar.gz
frameworks_av-61bd7a0281ffecb99b27bff63334c559df7357e6.tar.bz2
am 0541b3bb: am c8b226f4: Merge "Enforce permission for recording from remote submix." into klp-dev
* commit '0541b3bb40fa23e97e0a4599463b6afc0e271939': Enforce permission for recording from remote submix.
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index aa14d7b..4a7ddfd 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1211,6 +1211,10 @@ void AudioFlinger::NotificationClient::binderDied(const wp<IBinder>& who)
// ----------------------------------------------------------------------------
+static bool deviceRequiresCaptureAudioOutputPermission(audio_devices_t inDevice) {
+ return audio_is_remote_submix_device(inDevice);
+}
+
sp<IAudioRecord> AudioFlinger::openRecord(
audio_io_handle_t input,
uint32_t sampleRate,
@@ -1251,6 +1255,12 @@ sp<IAudioRecord> AudioFlinger::openRecord(
goto Exit;
}
+ if (deviceRequiresCaptureAudioOutputPermission(thread->inDevice())
+ && !captureAudioOutputAllowed()) {
+ lStatus = PERMISSION_DENIED;
+ goto Exit;
+ }
+
pid_t pid = IPCThreadState::self()->getCallingPid();
client = registerPid_l(pid);