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

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

Merge "Add sound trigger control by audio policy" into lmp-dev

parents ccad786f df3dc7e2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -309,6 +309,12 @@ public:
    /* Set audio port configuration */
    static status_t setAudioPortConfig(const struct audio_port_config *config);


    static status_t acquireSoundTriggerSession(audio_session_t *session,
                                           audio_io_handle_t *ioHandle,
                                           audio_devices_t *device);
    static status_t releaseSoundTriggerSession(audio_session_t session);

    // ----------------------------------------------------------------------------

    class AudioPortCallback : public RefBase
+6 −0
Original line number Diff line number Diff line
@@ -136,6 +136,12 @@ public:
    virtual status_t setAudioPortConfig(const struct audio_port_config *config) = 0;

    virtual void registerClient(const sp<IAudioPolicyServiceClient>& client) = 0;

    virtual status_t acquireSoundTriggerSession(audio_session_t *session,
                                           audio_io_handle_t *ioHandle,
                                           audio_devices_t *device) = 0;

    virtual status_t releaseSoundTriggerSession(audio_session_t session) = 0;
};


+4 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ public:

    virtual void onRecognitionEvent(const sp<IMemory>& eventMemory) = 0;

    virtual void onSoundModelEvent(const sp<IMemory>& eventMemory) = 0;

    virtual void onServiceStateChange(const sp<IMemory>& eventMemory) = 0;

};

// ----------------------------------------------------------------------------
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ public:
    virtual status_t attach(const sound_trigger_module_handle_t handle,
                                      const sp<ISoundTriggerClient>& client,
                                      sp<ISoundTrigger>& module) = 0;

    virtual status_t setCaptureState(bool active) = 0;
};

// ----------------------------------------------------------------------------
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#define ANDROID_HARDWARE_SOUNDTRIGGER_H

#include <binder/IBinder.h>
#include <utils/threads.h>
#include <soundtrigger/SoundTriggerCallback.h>
#include <soundtrigger/ISoundTrigger.h>
#include <soundtrigger/ISoundTriggerHwService.h>
@@ -32,12 +33,15 @@ class SoundTrigger : public BnSoundTriggerClient,
                        public IBinder::DeathRecipient
{
public:

    virtual ~SoundTrigger();

    static  status_t listModules(struct sound_trigger_module_descriptor *modules,
                                 uint32_t *numModules);
    static  sp<SoundTrigger> attach(const sound_trigger_module_handle_t module,
                                       const sp<SoundTriggerCallback>& callback);

            virtual ~SoundTrigger();
    static  status_t setCaptureState(bool active);

            void detach();

@@ -51,6 +55,8 @@ public:

            // BpSoundTriggerClient
            virtual void onRecognitionEvent(const sp<IMemory>& eventMemory);
            virtual void onSoundModelEvent(const sp<IMemory>& eventMemory);
            virtual void onServiceStateChange(const sp<IMemory>& eventMemory);

            //IBinder::DeathRecipient
            virtual void binderDied(const wp<IBinder>& who);
Loading