Loading include/soundtrigger/ISoundTrigger.h +1 −2 Original line number Diff line number Diff line Loading @@ -40,8 +40,7 @@ public: virtual status_t startRecognition(sound_model_handle_t handle, const sp<IMemory>& dataMemory) = 0; virtual status_t stopRecognition(sound_model_handle_t handle) = 0; virtual status_t getModelState(sound_model_handle_t handle, sp<IMemory>& eventMemory) = 0; virtual status_t getModelState(sound_model_handle_t handle) = 0; }; Loading include/soundtrigger/SoundTrigger.h +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public: status_t startRecognition(sound_model_handle_t handle, const sp<IMemory>& dataMemory); status_t stopRecognition(sound_model_handle_t handle); status_t getModelState(sound_model_handle_t handle, sp<IMemory>& eventMemory); status_t getModelState(sound_model_handle_t handle); // BpSoundTriggerClient virtual void onRecognitionEvent(const sp<IMemory>& eventMemory); Loading services/soundtrigger/SoundTriggerHalHidl.cpp +3 −15 Original line number Diff line number Diff line Loading @@ -356,8 +356,7 @@ int SoundTriggerHalHidl::stopAllRecognitions() return hidlReturn; } int SoundTriggerHalHidl::getModelState(sound_model_handle_t handle, struct sound_trigger_recognition_event** event) int SoundTriggerHalHidl::getModelState(sound_model_handle_t handle) { sp<ISoundTriggerHw> soundtrigger = getService(); if (soundtrigger == 0) { Loading @@ -377,24 +376,13 @@ int SoundTriggerHalHidl::getModelState(sound_model_handle_t handle, } int ret = NO_ERROR; Return<void> hidlReturn; Return<int32_t> hidlReturn(0); { AutoMutex lock(mHalLock); hidlReturn = soundtrigger_2_2->getModelState( model->mHalHandle, [&](int r, const V2_0_ISoundTriggerHwCallback::RecognitionEvent& halEvent) { ret = r; if (ret != 0) { ALOGE("getModelState returned error code %d", ret); } else { *event = convertRecognitionEventFromHal(&halEvent); } }); hidlReturn = soundtrigger_2_2->getModelState(model->mHalHandle); } if (!hidlReturn.isOk()) { ALOGE("getModelState error %s", hidlReturn.description().c_str()); free(*event); *event = nullptr; ret = FAILED_TRANSACTION; } return ret; Loading services/soundtrigger/SoundTriggerHalHidl.h +4 −4 Original line number Diff line number Diff line Loading @@ -96,12 +96,12 @@ public: virtual int stopAllRecognitions(); /* Get the current state of a given model. * Returns 0 or an error code. If successful it also sets indicated the event pointer * and expectes that the caller will free the memory. * Returns 0 or an error code. If successful the state will be returned asynchronously * via a recognition event in the callback method that was registered in the * startRecognition() method. * Only supported for device api versions SOUND_TRIGGER_DEVICE_API_VERSION_1_2 or above. */ virtual int getModelState(sound_model_handle_t handle, struct sound_trigger_recognition_event** event); virtual int getModelState(sound_model_handle_t handle); // ISoundTriggerHwCallback virtual ::android::hardware::Return<void> recognitionCallback( Loading services/soundtrigger/SoundTriggerHalInterface.h +4 −4 Original line number Diff line number Diff line Loading @@ -72,12 +72,12 @@ public: virtual int stopAllRecognitions() = 0; /* Get the current state of a given model. * Returns 0 or an error code. If successful it also sets indicated the event pointer * and expectes that the caller will free the memory. * Returns 0 or an error code. If successful the state will be returned asynchronously * via a recognition event in the callback method that was registered in the * startRecognition() method. * Only supported for device api versions SOUND_TRIGGER_DEVICE_API_VERSION_1_2 or above. */ virtual int getModelState(sound_model_handle_t handle, struct sound_trigger_recognition_event** event) = 0; virtual int getModelState(sound_model_handle_t handle) = 0; protected: SoundTriggerHalInterface() {} Loading Loading
include/soundtrigger/ISoundTrigger.h +1 −2 Original line number Diff line number Diff line Loading @@ -40,8 +40,7 @@ public: virtual status_t startRecognition(sound_model_handle_t handle, const sp<IMemory>& dataMemory) = 0; virtual status_t stopRecognition(sound_model_handle_t handle) = 0; virtual status_t getModelState(sound_model_handle_t handle, sp<IMemory>& eventMemory) = 0; virtual status_t getModelState(sound_model_handle_t handle) = 0; }; Loading
include/soundtrigger/SoundTrigger.h +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public: status_t startRecognition(sound_model_handle_t handle, const sp<IMemory>& dataMemory); status_t stopRecognition(sound_model_handle_t handle); status_t getModelState(sound_model_handle_t handle, sp<IMemory>& eventMemory); status_t getModelState(sound_model_handle_t handle); // BpSoundTriggerClient virtual void onRecognitionEvent(const sp<IMemory>& eventMemory); Loading
services/soundtrigger/SoundTriggerHalHidl.cpp +3 −15 Original line number Diff line number Diff line Loading @@ -356,8 +356,7 @@ int SoundTriggerHalHidl::stopAllRecognitions() return hidlReturn; } int SoundTriggerHalHidl::getModelState(sound_model_handle_t handle, struct sound_trigger_recognition_event** event) int SoundTriggerHalHidl::getModelState(sound_model_handle_t handle) { sp<ISoundTriggerHw> soundtrigger = getService(); if (soundtrigger == 0) { Loading @@ -377,24 +376,13 @@ int SoundTriggerHalHidl::getModelState(sound_model_handle_t handle, } int ret = NO_ERROR; Return<void> hidlReturn; Return<int32_t> hidlReturn(0); { AutoMutex lock(mHalLock); hidlReturn = soundtrigger_2_2->getModelState( model->mHalHandle, [&](int r, const V2_0_ISoundTriggerHwCallback::RecognitionEvent& halEvent) { ret = r; if (ret != 0) { ALOGE("getModelState returned error code %d", ret); } else { *event = convertRecognitionEventFromHal(&halEvent); } }); hidlReturn = soundtrigger_2_2->getModelState(model->mHalHandle); } if (!hidlReturn.isOk()) { ALOGE("getModelState error %s", hidlReturn.description().c_str()); free(*event); *event = nullptr; ret = FAILED_TRANSACTION; } return ret; Loading
services/soundtrigger/SoundTriggerHalHidl.h +4 −4 Original line number Diff line number Diff line Loading @@ -96,12 +96,12 @@ public: virtual int stopAllRecognitions(); /* Get the current state of a given model. * Returns 0 or an error code. If successful it also sets indicated the event pointer * and expectes that the caller will free the memory. * Returns 0 or an error code. If successful the state will be returned asynchronously * via a recognition event in the callback method that was registered in the * startRecognition() method. * Only supported for device api versions SOUND_TRIGGER_DEVICE_API_VERSION_1_2 or above. */ virtual int getModelState(sound_model_handle_t handle, struct sound_trigger_recognition_event** event); virtual int getModelState(sound_model_handle_t handle); // ISoundTriggerHwCallback virtual ::android::hardware::Return<void> recognitionCallback( Loading
services/soundtrigger/SoundTriggerHalInterface.h +4 −4 Original line number Diff line number Diff line Loading @@ -72,12 +72,12 @@ public: virtual int stopAllRecognitions() = 0; /* Get the current state of a given model. * Returns 0 or an error code. If successful it also sets indicated the event pointer * and expectes that the caller will free the memory. * Returns 0 or an error code. If successful the state will be returned asynchronously * via a recognition event in the callback method that was registered in the * startRecognition() method. * Only supported for device api versions SOUND_TRIGGER_DEVICE_API_VERSION_1_2 or above. */ virtual int getModelState(sound_model_handle_t handle, struct sound_trigger_recognition_event** event) = 0; virtual int getModelState(sound_model_handle_t handle) = 0; protected: SoundTriggerHalInterface() {} Loading