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

Commit 8eafd394 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Fix for no audio on BT headset till waiting call is ended."

parents 37f1c5a9 060a6c49
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1540,8 +1540,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
                    !voice_is_in_call(adev) &&
                    (out == adev->primary_output)) {
                ret = voice_start_call(adev);
            } else if ((adev->mode == AUDIO_MODE_IN_CALL) &&
                            voice_is_in_call(adev) &&
            } else if (voice_is_in_call(adev) &&
                            (out == adev->primary_output)) {
                voice_update_devices_for_all_voice_usecases(adev);
            }
+7 −1
Original line number Diff line number Diff line
@@ -1558,8 +1558,8 @@ void AudioPolicyManager::setPhoneState(int state)
                                                  0 /* ignored */);
       }
    }
    mPrevPhoneState = oldState;
#endif
    mPrevPhoneState = oldState;

    int delayMs = 0;
    if (isStateInCall(state)) {
@@ -1609,6 +1609,12 @@ void AudioPolicyManager::setPhoneState(int state)
    ALOGD(" End of setPhoneState ... mPhoneState: %d ",mPhoneState);
}

bool AudioPolicyManager::isStateInCall(int state)
{
    return ((state == AudioSystem::MODE_IN_CALL) || (state == AudioSystem::MODE_IN_COMMUNICATION) ||
       ((state == AudioSystem::MODE_RINGTONE) && (mPrevPhoneState == AudioSystem::MODE_IN_CALL)));
}

extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface)
{
    return new AudioPolicyManager(clientInterface);
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,9 @@ public:
        virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);

        virtual void setPhoneState(int state);

        // true if given state represents a device in a telephony or VoIP call
        virtual bool isStateInCall(int state);
protected:
        // return the strategy corresponding to a given stream type
        static routing_strategy getStrategy(AudioSystem::stream_type stream);