diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2015-04-24 21:09:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-24 21:09:05 +0000 |
commit | 7d7ea036436320b03bef826d78c4c035b67edbd0 (patch) | |
tree | 35c3322983d83f97abcde43da37329ac98f6b122 /services/audiopolicy/managerdefault | |
parent | 11f88677e9a9405d2b5d7f7bf9b6eec035b6331d (diff) | |
parent | 2b0c1fc0d0ad3744a32d48234f255d82a5c80ded (diff) | |
download | frameworks_av-7d7ea036436320b03bef826d78c4c035b67edbd0.zip frameworks_av-7d7ea036436320b03bef826d78c4c035b67edbd0.tar.gz frameworks_av-7d7ea036436320b03bef826d78c4c035b67edbd0.tar.bz2 |
Merge "AudioPolicyManager: notification of dynamic policy mix activity (input)"
Diffstat (limited to 'services/audiopolicy/managerdefault')
-rw-r--r-- | services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 01f2b61..ba3fcaf 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -1420,6 +1420,13 @@ status_t AudioPolicyManager::startInput(audio_io_handle_t input, } if (inputDesc->mRefCount == 0) { + // if input maps to a dynamic policy with an activity listener, notify of state change + if ((inputDesc->mPolicyMix != NULL) + && ((inputDesc->mPolicyMix->mFlags & MIX_FLAG_NOTIFY_ACTIVITY) != 0)) { + mpClientInterface->onDynamicPolicyMixStateUpdate(inputDesc->mPolicyMix->mRegistrationId, + MIX_STATE_MIXING); + } + if (mInputs.activeInputsCount() == 0) { SoundTrigger::setCaptureState(true); } @@ -1473,6 +1480,12 @@ status_t AudioPolicyManager::stopInput(audio_io_handle_t input, inputDesc->mRefCount--; if (inputDesc->mRefCount == 0) { + // if input maps to a dynamic policy with an activity listener, notify of state change + if ((inputDesc->mPolicyMix != NULL) + && ((inputDesc->mPolicyMix->mFlags & MIX_FLAG_NOTIFY_ACTIVITY) != 0)) { + mpClientInterface->onDynamicPolicyMixStateUpdate(inputDesc->mPolicyMix->mRegistrationId, + MIX_STATE_IDLE); + } // automatically disable the remote submix output when input is stopped if not // used by a policy mix of type MIX_TYPE_RECORDERS |