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

Commit ea4fd420 authored by Huicheng Liu's avatar Huicheng Liu
Browse files

hal: Move sequence of audio_extn_auto_hal_open_input_stream



* Move the call sequence of audio_extn_auto_hal_open_input_stream
to avoid overriding the usecase field of struct stream_in
* This will fix the issue where adev->pcm_record_uc_state
won't be assign back to 1 in adev_close_input_stream
* CRs-Fixed: 2853209

Change-Id: Ia2129b21f82d642d07c917aa13d1e2fb1c742242
Signed-off-by: default avatarHuicheng Liu <huicliu@codeaurora.org>
parent 4bef764f
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -9509,6 +9509,12 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
            goto err_open;
        }
        ALOGV("%s: car_audio_stream 0x%x", __func__, in->car_audio_stream);
        ret = audio_extn_auto_hal_open_input_stream(in);
        if (ret) {
            ALOGE("%s: Failed to open input stream for bus device", __func__);
            ret = -EINVAL;
            goto err_open;
        }
    }

    if (in->source == AUDIO_SOURCE_FM_TUNER) {
@@ -9714,14 +9720,6 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
                }
            }
        }
        if (compare_device_type(&in->device_list, AUDIO_DEVICE_IN_BUS)) {
           ret = audio_extn_auto_hal_open_input_stream(in);
           if (ret) {
               ALOGE("%s: Failed to open input stream for bus device", __func__);
               ret = -EINVAL;
               goto err_open;
           }
        }
    }
    if (audio_extn_ssr_get_stream() != in)
        in->config.channels = channel_count;