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

Commit bd878c15 authored by solk2's avatar solk2 Committed by Dan Pasanen
Browse files

hal: Fix voice call recording for msm8974

Voice call recording uses audio-record usecase which causes recording
only devices microphone. Use the correct usecase for call recording.

Change-Id: Ia81a0e6930ea97e964d3feb2bf4d8d0fafa2761f
parent 8ead0b8f
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -2857,10 +2857,21 @@ int64_t platform_render_latency(audio_usecase_t usecase)
int platform_update_usecase_from_source(int source, int usecase)
{
    ALOGV("%s: input source :%d", __func__, source);
    if (source == AUDIO_SOURCE_FM_TUNER)
        usecase = USECASE_AUDIO_RECORD_FM_VIRTUAL;
    switch(source) {
        case AUDIO_SOURCE_VOICE_UPLINK:
            return USECASE_INCALL_REC_UPLINK;
        case AUDIO_SOURCE_VOICE_DOWNLINK:
            return USECASE_INCALL_REC_DOWNLINK;
        case AUDIO_SOURCE_VOICE_CALL:
            return USECASE_INCALL_REC_UPLINK_AND_DOWNLINK;
#ifdef FM_ENABLED
        case AUDIO_SOURCE_FM_TUNER:
            return USECASE_AUDIO_RECORD_FM_VIRTUAL;
#endif
        default:
            return usecase;
    }
}

bool platform_listen_device_needs_event(snd_device_t snd_device)
{