Loading services/soundtrigger/SoundTriggerHwService.cpp +38 −20 Original line number Diff line number Diff line Loading @@ -653,7 +653,6 @@ void SoundTriggerHwService::Module::onCallbackEvent(const sp<CallbackEvent>& eve { ALOGV("onCallbackEvent type %d", event->mType); AutoMutex lock(mLock); sp<IMemory> eventMemory = event->mMemory; if (eventMemory == 0 || eventMemory->pointer() == NULL) { Loading @@ -668,7 +667,9 @@ void SoundTriggerHwService::Module::onCallbackEvent(const sp<CallbackEvent>& eve case CallbackEvent::TYPE_RECOGNITION: { struct sound_trigger_recognition_event *recognitionEvent = (struct sound_trigger_recognition_event *)eventMemory->pointer(); sp<ISoundTriggerClient> client; { AutoMutex lock(mLock); sp<Model> model = getModel(recognitionEvent->model); if (model == 0) { ALOGW("%s model == 0", __func__); Loading @@ -680,22 +681,39 @@ void SoundTriggerHwService::Module::onCallbackEvent(const sp<CallbackEvent>& eve } recognitionEvent->capture_session = model->mCaptureSession; mClient->onRecognitionEvent(eventMemory); model->mState = Model::STATE_IDLE; client = mClient; } if (client != 0) { client->onRecognitionEvent(eventMemory); } } break; case CallbackEvent::TYPE_SOUNDMODEL: { struct sound_trigger_model_event *soundmodelEvent = (struct sound_trigger_model_event *)eventMemory->pointer(); sp<ISoundTriggerClient> client; { AutoMutex lock(mLock); sp<Model> model = getModel(soundmodelEvent->model); if (model == 0) { ALOGW("%s model == 0", __func__); return; } mClient->onSoundModelEvent(eventMemory); client = mClient; } if (client != 0) { client->onSoundModelEvent(eventMemory); } } break; case CallbackEvent::TYPE_SERVICE_STATE: { mClient->onServiceStateChange(eventMemory); sp<ISoundTriggerClient> client; { AutoMutex lock(mLock); client = mClient; } if (client != 0) { client->onServiceStateChange(eventMemory); } } break; default: LOG_ALWAYS_FATAL("onCallbackEvent unknown event type %d", event->mType); Loading Loading
services/soundtrigger/SoundTriggerHwService.cpp +38 −20 Original line number Diff line number Diff line Loading @@ -653,7 +653,6 @@ void SoundTriggerHwService::Module::onCallbackEvent(const sp<CallbackEvent>& eve { ALOGV("onCallbackEvent type %d", event->mType); AutoMutex lock(mLock); sp<IMemory> eventMemory = event->mMemory; if (eventMemory == 0 || eventMemory->pointer() == NULL) { Loading @@ -668,7 +667,9 @@ void SoundTriggerHwService::Module::onCallbackEvent(const sp<CallbackEvent>& eve case CallbackEvent::TYPE_RECOGNITION: { struct sound_trigger_recognition_event *recognitionEvent = (struct sound_trigger_recognition_event *)eventMemory->pointer(); sp<ISoundTriggerClient> client; { AutoMutex lock(mLock); sp<Model> model = getModel(recognitionEvent->model); if (model == 0) { ALOGW("%s model == 0", __func__); Loading @@ -680,22 +681,39 @@ void SoundTriggerHwService::Module::onCallbackEvent(const sp<CallbackEvent>& eve } recognitionEvent->capture_session = model->mCaptureSession; mClient->onRecognitionEvent(eventMemory); model->mState = Model::STATE_IDLE; client = mClient; } if (client != 0) { client->onRecognitionEvent(eventMemory); } } break; case CallbackEvent::TYPE_SOUNDMODEL: { struct sound_trigger_model_event *soundmodelEvent = (struct sound_trigger_model_event *)eventMemory->pointer(); sp<ISoundTriggerClient> client; { AutoMutex lock(mLock); sp<Model> model = getModel(soundmodelEvent->model); if (model == 0) { ALOGW("%s model == 0", __func__); return; } mClient->onSoundModelEvent(eventMemory); client = mClient; } if (client != 0) { client->onSoundModelEvent(eventMemory); } } break; case CallbackEvent::TYPE_SERVICE_STATE: { mClient->onServiceStateChange(eventMemory); sp<ISoundTriggerClient> client; { AutoMutex lock(mLock); client = mClient; } if (client != 0) { client->onServiceStateChange(eventMemory); } } break; default: LOG_ALWAYS_FATAL("onCallbackEvent unknown event type %d", event->mType); Loading