summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-10-10 16:30:19 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-10 16:30:20 -0700
commit7e2c0a15bb8086460070811a152029726479a297 (patch)
tree9ca9478a5391a897d5283f85f0873f35abc284da /services
parent907e5651c18d0e25073743a49a685fe1a385939a (diff)
parentd7086030fcf731e4bcef6c033cc6418cd04e6b91 (diff)
downloadframeworks_av-7e2c0a15bb8086460070811a152029726479a297.zip
frameworks_av-7e2c0a15bb8086460070811a152029726479a297.tar.gz
frameworks_av-7e2c0a15bb8086460070811a152029726479a297.tar.bz2
Merge "Support querying active record sources" into jb-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioPolicyService.cpp12
-rw-r--r--services/audioflinger/AudioPolicyService.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index 155a0b8..8b99bd2 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -483,6 +483,18 @@ bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inP
return mpAudioPolicy->is_stream_active(mpAudioPolicy, stream, inPastMs);
}
+bool AudioPolicyService::isSourceActive(audio_source_t source) const
+{
+ if (mpAudioPolicy == NULL) {
+ return false;
+ }
+ if (mpAudioPolicy->is_source_active == 0) {
+ return false;
+ }
+ Mutex::Autolock _l(mLock);
+ return mpAudioPolicy->is_source_active(mpAudioPolicy, source);
+}
+
status_t AudioPolicyService::queryDefaultPreProcessing(int audioSession,
effect_descriptor_t *descriptors,
uint32_t *count)
diff --git a/services/audioflinger/AudioPolicyService.h b/services/audioflinger/AudioPolicyService.h
index a086734..63f9549 100644
--- a/services/audioflinger/AudioPolicyService.h
+++ b/services/audioflinger/AudioPolicyService.h
@@ -104,6 +104,7 @@ public:
virtual status_t unregisterEffect(int id);
virtual status_t setEffectEnabled(int id, bool enabled);
virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
+ virtual bool isSourceActive(audio_source_t source) const;
virtual status_t queryDefaultPreProcessing(int audioSession,
effect_descriptor_t *descriptors,