exynos: sthal: Import `sound_trigger_notify_ahal_record_status` from newer sthal
* This is used to explicitly stop sthal to prevent concurrent input,
which is not supported.
* This is also found on 9830 stock sthal, which is a version similar
to what we already have here.
* From https://gitlab.com/Linaro/96boards/e850-96/platform/vendor/samsung_slsi/-/blob/android13-e850-96/exynos/audio/sthal/unified/v1/sound_trigger_hw.c
Change-Id: Ia2f72840a0af34afb956fca5b6f7fd5c1b5d47fe
Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
diff --git a/libaudio/sthal/sound_trigger_hw.c b/libaudio/sthal/sound_trigger_hw.c
index 834117f..c03d793 100644
--- a/libaudio/sthal/sound_trigger_hw.c
+++ b/libaudio/sthal/sound_trigger_hw.c
@@ -1822,6 +1822,31 @@
return ret;
}
+__attribute__ ((visibility ("default")))
+int sound_trigger_notify_ahal_record_status(int state)
+{
+ struct sound_trigger_device *stdev = &g_stdev;
+ int ret = 0;
+
+ switch (state) {
+ case RECORDING_STOP:
+ /* no further impl for now */
+ break;
+ case RECORDING_START:
+ ALOGI("%s: audiohal is about to start recording", __func__);
+ if (stdev->is_mic_configured)
+ stdev_vts_set_power(stdev, 0);
+
+ break;
+ default:
+ ALOGE("%s: state(%d) is not defined", __func__, state);
+ ret = -1;
+ break;
+ }
+
+ return ret;
+}
+
static int stdev_close(hw_device_t *device)
{
struct sound_trigger_device *stdev = (struct sound_trigger_device *)device;
diff --git a/libaudio/sthal/sound_trigger_hw.h b/libaudio/sthal/sound_trigger_hw.h
index 3806e81..54ffef3 100644
--- a/libaudio/sthal/sound_trigger_hw.h
+++ b/libaudio/sthal/sound_trigger_hw.h
@@ -115,6 +115,11 @@
}VOICECALL_STATE;
typedef enum {
+ RECORDING_STOP = 0,
+ RECORDING_START,
+} AUDIOHAL_STATE;
+
+typedef enum {
RECOG_CB_NONE = 0, // Recognition event callback function not called
RECOG_CB_STARTED = 1, // Recognition event received
RECOG_CB_CALLED = 2, //Recognition event callback of STHW Service Called