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

Commit c862f71d authored by Pavan Chikkala's avatar Pavan Chikkala Committed by Gerrit - the friendly Code Review server
Browse files

audio: Reject incall record request when mode is not IN_CALL

- If application selects AUDIO_SOURCE_VOICE_CALL when voice call is
  not active, audio HAL is selecting afe-proxy use case which is
  wrong. afe-proxy usecase/device expected to be selected during
  USB Voice call scenario only

- Fix is to fail opening the input stream with
  AUDIO_DEVICE_IN_TELEPHONY_RX or AUDIO_DEVICE_IN_VOICE_CALL if
  current mode is not IN_CALL

CRs-Fixed: 772386

Change-Id: I8ee3e72daec86e26d05b01a117d7a01f7f6b69a8
parent 0c716814
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3367,6 +3367,10 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
    in->format = config->format;

    if (in->device == AUDIO_DEVICE_IN_TELEPHONY_RX) {
        if (adev->mode != AUDIO_MODE_IN_CALL) {
            ret = -EINVAL;
            goto err_open;
        }
        if (config->sample_rate == 0)
            config->sample_rate = AFE_PROXY_SAMPLING_RATE;
        if (config->sample_rate != 48000 && config->sample_rate != 16000 &&