Skip to content

Commit b84e993

Browse files
audio: add get_active_micropones() function
The Google VTS tests for Android VtsHalAudioV5_0Target(GetMicrophonesTest) needs to use pointer of function (*get_active_micropones)() which is not initialized and function in_get_active_microphones() required for initialization witch is not implemented in tinyhal. The analysis of the implementation of the audio hal for Qualcomm (https://android.googlesource.com/platform/hardware/qcom/audio/+/refs/heads/ master/hal/audio_hw.c) and Goldfish (https://android.googlesource.com/device/generic/goldfish/+/dc18a59%5E%21/) have been made. The implementation similar to Goldfish(stub) has been chosen as basic. Function in_get_active_microphones() was implemented as stub function that will expand in the future. This function fill array audio_microphone_characteristic_t with default microphone information. Signed-off-by: Anton Dehtiarov <anton.dehtiarov@globallogic.com>
1 parent bfb0a28 commit b84e993

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

audio/audio_hw.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,14 @@ static int adev_get_microphones(const struct audio_hw_device *dev,
20802080
}
20812081
#endif
20822082

2083+
#ifdef AUDIO_DEVICE_API_VERSION_5_0
2084+
static int in_get_active_microphones(const struct audio_stream_in *stream,
2085+
struct audio_microphone_characteristic_t *mic_array,
2086+
size_t *mic_count) {
2087+
return adev_get_microphones(NULL, mic_array, mic_count);
2088+
}
2089+
#endif
2090+
20832091
/*********************************************************************
20842092
* Stream open and close
20852093
*********************************************************************/
@@ -2222,6 +2230,10 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
22222230

22232231
in->common.dev = adev;
22242232

2233+
#ifdef AUDIO_DEVICE_API_VERSION_5_0
2234+
in->common.stream.get_active_microphones = in_get_active_microphones;
2235+
#endif
2236+
22252237
devices &= AUDIO_DEVICE_IN_ALL;
22262238
ret = do_init_in_common(&in->common, config, devices);
22272239
if (ret < 0) {

0 commit comments

Comments
 (0)