summaryrefslogtreecommitdiffstats
path: root/include/soundtrigger
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-07-27 18:39:40 -0700
committerEric Laurent <elaurent@google.com>2014-08-05 12:10:27 -0700
commitdf3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871 (patch)
treee54724362f700e3e72fc72604a3b5f568d8cee7b /include/soundtrigger
parentd0fded31e473e909c018f534d3019fb5168bdcd6 (diff)
downloadframeworks_av-df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871.zip
frameworks_av-df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871.tar.gz
frameworks_av-df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871.tar.bz2
Add sound trigger control by audio policy
Audio policy: - Added active capture indication to sound trigger service: recognition stops if concurrent capture is not supported. - Added generation of reserved I/O handle and session ID for utterance capture. Sound trigger service - Added sound model update callback handling. - Added service state callback - Simplified callback shared memory allocation. Bug: 12378680. Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
Diffstat (limited to 'include/soundtrigger')
-rw-r--r--include/soundtrigger/ISoundTriggerClient.h4
-rw-r--r--include/soundtrigger/ISoundTriggerHwService.h2
-rw-r--r--include/soundtrigger/SoundTrigger.h8
-rw-r--r--include/soundtrigger/SoundTriggerCallback.h4
4 files changed, 17 insertions, 1 deletions
diff --git a/include/soundtrigger/ISoundTriggerClient.h b/include/soundtrigger/ISoundTriggerClient.h
index 7f86d02..480429a 100644
--- a/include/soundtrigger/ISoundTriggerClient.h
+++ b/include/soundtrigger/ISoundTriggerClient.h
@@ -31,6 +31,10 @@ public:
virtual void onRecognitionEvent(const sp<IMemory>& eventMemory) = 0;
+ virtual void onSoundModelEvent(const sp<IMemory>& eventMemory) = 0;
+
+ virtual void onServiceStateChange(const sp<IMemory>& eventMemory) = 0;
+
};
// ----------------------------------------------------------------------------
diff --git a/include/soundtrigger/ISoundTriggerHwService.h b/include/soundtrigger/ISoundTriggerHwService.h
index 05a764a..ae0cb01 100644
--- a/include/soundtrigger/ISoundTriggerHwService.h
+++ b/include/soundtrigger/ISoundTriggerHwService.h
@@ -39,6 +39,8 @@ public:
virtual status_t attach(const sound_trigger_module_handle_t handle,
const sp<ISoundTriggerClient>& client,
sp<ISoundTrigger>& module) = 0;
+
+ virtual status_t setCaptureState(bool active) = 0;
};
// ----------------------------------------------------------------------------
diff --git a/include/soundtrigger/SoundTrigger.h b/include/soundtrigger/SoundTrigger.h
index 1f7f286..bf5e1de 100644
--- a/include/soundtrigger/SoundTrigger.h
+++ b/include/soundtrigger/SoundTrigger.h
@@ -18,6 +18,7 @@
#define ANDROID_HARDWARE_SOUNDTRIGGER_H
#include <binder/IBinder.h>
+#include <utils/threads.h>
#include <soundtrigger/SoundTriggerCallback.h>
#include <soundtrigger/ISoundTrigger.h>
#include <soundtrigger/ISoundTriggerHwService.h>
@@ -32,12 +33,15 @@ class SoundTrigger : public BnSoundTriggerClient,
public IBinder::DeathRecipient
{
public:
+
+ virtual ~SoundTrigger();
+
static status_t listModules(struct sound_trigger_module_descriptor *modules,
uint32_t *numModules);
static sp<SoundTrigger> attach(const sound_trigger_module_handle_t module,
const sp<SoundTriggerCallback>& callback);
- virtual ~SoundTrigger();
+ static status_t setCaptureState(bool active);
void detach();
@@ -51,6 +55,8 @@ public:
// BpSoundTriggerClient
virtual void onRecognitionEvent(const sp<IMemory>& eventMemory);
+ virtual void onSoundModelEvent(const sp<IMemory>& eventMemory);
+ virtual void onServiceStateChange(const sp<IMemory>& eventMemory);
//IBinder::DeathRecipient
virtual void binderDied(const wp<IBinder>& who);
diff --git a/include/soundtrigger/SoundTriggerCallback.h b/include/soundtrigger/SoundTriggerCallback.h
index 8a5ba02..b5277f2 100644
--- a/include/soundtrigger/SoundTriggerCallback.h
+++ b/include/soundtrigger/SoundTriggerCallback.h
@@ -31,6 +31,10 @@ public:
virtual void onRecognitionEvent(struct sound_trigger_recognition_event *event) = 0;
+ virtual void onSoundModelEvent(struct sound_trigger_model_event *event) = 0;
+
+ virtual void onServiceStateChange(sound_trigger_service_state_t state) = 0;
+
virtual void onServiceDied() = 0;
};