summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioSystem.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-10-10 12:11:16 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2012-10-10 12:11:16 -0700
commitd7086030fcf731e4bcef6c033cc6418cd04e6b91 (patch)
tree51f233eeff7c3e17e980d1fb0f41a2ba3f030b16 /media/libmedia/AudioSystem.cpp
parentdca0ac2193e87c57d871dd208073107408c13c0a (diff)
downloadframeworks_av-d7086030fcf731e4bcef6c033cc6418cd04e6b91.zip
frameworks_av-d7086030fcf731e4bcef6c033cc6418cd04e6b91.tar.gz
frameworks_av-d7086030fcf731e4bcef6c033cc6418cd04e6b91.tar.bz2
Support querying active record sources
Add support for querying whether there is currently a recording underway from the specified audio source. Bug 7314859 Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
Diffstat (limited to 'media/libmedia/AudioSystem.cpp')
-rw-r--r--media/libmedia/AudioSystem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 5624df4..207f96f 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -735,6 +735,15 @@ status_t AudioSystem::isStreamActive(audio_stream_type_t stream, bool* state, ui
return NO_ERROR;
}
+status_t AudioSystem::isSourceActive(audio_source_t stream, bool* state)
+{
+ const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
+ if (aps == 0) return PERMISSION_DENIED;
+ if (state == NULL) return BAD_VALUE;
+ *state = aps->isSourceActive(stream);
+ return NO_ERROR;
+}
+
int32_t AudioSystem::getPrimaryOutputSamplingRate()
{
const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();