Adding getModelState API to sound trigger
Test: built android
Bug-Id: 70206501
Change-Id: I8f45fd86bc14544c676c94daeea71a0ecebdbe03
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
index 612772c..2de35e8 100644
--- a/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
+++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.cpp
@@ -247,7 +247,7 @@
}
SoundTriggerHalImpl::SoundTriggerHalImpl()
- : mModuleName("primary"), mHwDevice(NULL), mNextModelId(1) {}
+ : mModuleName("primary"), mNextModelId(1), mHwDevice(NULL) {}
void SoundTriggerHalImpl::onFirstRef() {
const hw_module_t* mod;
diff --git a/soundtrigger/2.0/default/SoundTriggerHalImpl.h b/soundtrigger/2.0/default/SoundTriggerHalImpl.h
index 5a9f0e1..fbe24c1 100644
--- a/soundtrigger/2.0/default/SoundTriggerHalImpl.h
+++ b/soundtrigger/2.0/default/SoundTriggerHalImpl.h
@@ -167,8 +167,11 @@
static void recognitionCallback(struct sound_trigger_recognition_event* halEvent, void* cookie);
const char* mModuleName;
- struct sound_trigger_hw_device* mHwDevice;
+
volatile atomic_uint_fast32_t mNextModelId;
+
+ protected:
+ struct sound_trigger_hw_device* mHwDevice;
DefaultKeyedVector<int32_t, sp<SoundModelClient> > mClients;
Mutex mLock;
};