diff options
author | François Gaffie <francois.gaffie@intel.com> | 2015-03-19 10:43:27 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2015-04-01 10:22:42 -0700 |
commit | df37269852ea92bafd939fe793209d0581c4a574 (patch) | |
tree | 673a3e9838f06a33c6304942d8138b1eb224d348 /services/audiopolicy/managerdefault/AudioPolicyManager.cpp | |
parent | 45ed3b053d9af2250f5ece9ee4e826905c3763a7 (diff) | |
download | frameworks_av-df37269852ea92bafd939fe793209d0581c4a574.zip frameworks_av-df37269852ea92bafd939fe793209d0581c4a574.tar.gz frameworks_av-df37269852ea92bafd939fe793209d0581c4a574.tar.bz2 |
Create SoundTriggerSession and associated collection within common
This patch creates a SoundTriggerSession and associated collection within
common policy pillar elements.
It moves the code from managerdefault and creates helpers function within
the collection.
Change-Id: I83ea230573c05e8ab99f4489c20059ed27678221
Signed-off-by: François Gaffie <francois.gaffie@intel.com>
Diffstat (limited to 'services/audiopolicy/managerdefault/AudioPolicyManager.cpp')
-rw-r--r-- | services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 01400ec..5341559 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -2458,21 +2458,7 @@ status_t AudioPolicyManager::acquireSoundTriggerSession(audio_session_t *session *ioHandle = (audio_io_handle_t)mpClientInterface->newAudioUniqueId(); *device = getDeviceAndMixForInputSource(AUDIO_SOURCE_HOTWORD); - mSoundTriggerSessions.add(*session, *ioHandle); - - return NO_ERROR; -} - -status_t AudioPolicyManager::releaseSoundTriggerSession(audio_session_t session) -{ - ssize_t index = mSoundTriggerSessions.indexOfKey(session); - if (index < 0) { - ALOGW("acquireSoundTriggerSession() session %d not registered", session); - return BAD_VALUE; - } - - mSoundTriggerSessions.removeItem(session); - return NO_ERROR; + return mSoundTriggerSessions.acquireSession(*session, *ioHandle); } // ---------------------------------------------------------------------------- |