Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d1c8480 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "sound trigger: stop recognition on sound model unload"

parents 1a93f0cb 1a1cba8f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -367,8 +367,12 @@ status_t SoundTriggerHwService::Module::unloadSoundModel(sound_model_handle_t ha
    if (index < 0) {
        return BAD_VALUE;
    }
    sp<Model> model = mModels.valueAt(index);
    mModels.removeItem(handle);

    if (model->mState == Model::STATE_ACTIVE) {
        mHwDevice->stop_recognition(mHwDevice, model->mHandle);
        model->deallocateMemory();
    }
    return mHwDevice->unload_sound_model(mHwDevice, handle);
}