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

Commit 73dd1fdb authored by Quinn male's avatar Quinn male Committed by Gerrit - the friendly Code Review server
Browse files

hal: send device connect, disconnect events to sound trigger hal

Relay the device connect/disconnect events to sound trigger hal
in order to support voice activation using mic devices other
than handset mic.

Change-Id: Id4b186269f6f39ebbba605f4819965365b33b7e7
parent 591c2baf
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -349,6 +349,18 @@ void audio_extn_sound_trigger_set_parameters(struct audio_device *adev __unused,
        event.u.value = val;
        st_dev->st_callback(AUDIO_EVENT_NUM_ST_SESSIONS, &event);
    }

    ret = str_parms_get_int(params, AUDIO_PARAMETER_DEVICE_CONNECT, &val);
    if ((ret >= 0) && audio_is_input_device(val)) {
        event.u.value = val;
        st_dev->st_callback(AUDIO_EVENT_DEVICE_CONNECT, &event);
    }

    ret = str_parms_get_int(params, AUDIO_PARAMETER_DEVICE_DISCONNECT, &val);
    if ((ret >= 0) && audio_is_input_device(val)) {
        event.u.value = val;
        st_dev->st_callback(AUDIO_EVENT_DEVICE_DISCONNECT, &event);
    }
}

int audio_extn_sound_trigger_init(struct audio_device *adev)