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

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

Merge "sound trigger HAL: add specialized methods for extended sound models"

parents f277fa14 a4b776c9
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -158,6 +158,34 @@ interface ISoundTriggerHw {
                   CallbackCookie cookie)
            generates (int32_t retval, SoundModelHandle modelHandle);

    /*
     * Load a key phrase sound model. Once loaded, recognition of this model can
     * be started and stopped. Only one active recognition per model at a time.
     * The SoundTrigger service must handle concurrent recognition requests by
     * different users/applications on the same model.
     * The implementation returns a unique handle used by other functions
     * (unloadSoundModel(), startRecognition(), etc...
     * @param soundModel A PhraseSoundModel structure describing the sound model
     *                   to load.
     * @param callback The callback interface on which the soundmodelCallback()
     *                 method will be called upon completion.
     * @param cookie The value of the cookie argument passed to the completion
     *               callback. This unique context information is assigned and
     *               used only by the framework.
     * @return retval Operation completion status: 0 in case of success,
     *                -EINVAL in case of invalid sound model (e.g 0 data size),
     *                -ENOSYS in case of invalid operation (e.g max number of
     *                models exceeded),
     *                -ENOMEM in case of memory allocation failure,
     *                -ENODEV in case of initialization error.
     * @return modelHandle A unique handle assigned by the HAL for use by the
     *                framework when controlling activity for this sound model.
     */
    loadPhraseSoundModel(PhraseSoundModel soundModel,
                   ISoundTriggerHwCallback callback,
                   CallbackCookie cookie)
            generates (int32_t retval, SoundModelHandle modelHandle);

    /*
     * Unload a sound model. A sound model may be unloaded to make room for a
     * new one to overcome implementation limitations.
+11 −0
Original line number Diff line number Diff line
@@ -92,6 +92,17 @@ interface ISoundTriggerHwCallback {
     *               started (see ISoundtriggerHw.startRecognition()
     */
    recognitionCallback(RecognitionEvent event, CallbackCookie cookie);

    /*
     * Callback method called by the HAL when the sound recognition triggers
     * for a key phrase sound model.
     * @param event A RecognitionEvent structure containing detailed results
     *              of the recognition triggered
     * @param cookie The cookie passed by the framework when recognition was
     *               started (see ISoundtriggerHw.startRecognition()
     */
    phraseRecognitionCallback(PhraseRecognitionEvent event,
                              CallbackCookie cookie);
    /*
     * Callback method called by the HAL when the sound model loading completes
     * @param event A ModelEvent structure containing detailed results of the