~aleteoryx/muditaos

3196d7929e2f62d1d9ac1f65c0ec3f149afed837 — Lefucjusz 3 years ago 74c3691
[MOS-422] Incoming call sound both on HFP and Pure fix

Fix of the issue that incoming call sound was played
both in Pure speaker and HFP device while HFP profile
connected.
1 files changed, 5 insertions(+), 0 deletions(-)

M module-services/service-audio/ServiceAudio.cpp
M module-services/service-audio/ServiceAudio.cpp => module-services/service-audio/ServiceAudio.cpp +5 -0
@@ 422,6 422,11 @@ std::unique_ptr<AudioResponseMessage> ServiceAudio::HandleStart(const Operation:
    if (opType == Operation::Type::Playback) {
        auto input = audioMux.GetPlaybackInput(playbackType);

        if (playbackType == audio::PlaybackType::CallRingtone && bluetoothVoiceProfileConnected && input) {
            // don't play ringtone on HFP connection on Pure
            return std::make_unique<AudioStartPlaybackResponse>(audio::RetCode::Success, retToken);
        }

        if (bluetoothA2DPConnected && playbackType != audio::PlaybackType::CallRingtone) {
            LOG_DEBUG("Sending Bluetooth start stream request");
            bus.sendUnicast(std::make_shared<BluetoothMessage>(BluetoothMessage::Request::Play),