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

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

Merge "policy_hal: remove VGS check for BT volume"

parents 5696e425 bd1440c8
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -1157,19 +1157,11 @@ status_t AudioPolicyManager::checkAndSetVolume(int stream,
        stream == AudioSystem::BLUETOOTH_SCO) {
        float voiceVolume;

        if (stream == AudioSystem::VOICE_CALL)
            voiceVolume = (float)index/(float)mStreams[stream].mIndexMax;

        // Force voice volume to max when Vgs is set for bluetooth SCO as volume is managed by the headset
        if (stream == AudioSystem::BLUETOOTH_SCO) {
            String8 key ("bt_headset_vgs");
            mpClientInterface->getParameters(output,key);
            AudioParameter result(mpClientInterface->getParameters(0,key));
            int value;
            if (result.getInt(String8("isVGS"),value) == NO_ERROR) {
                ALOGV("Use BT-SCO Voice Volume");
        else
            // Force voice volume to max for bluetooth SCO as volume is managed by the headset
            voiceVolume = 1.0;
            }
        }

        if (voiceVolume != mLastVoiceVolume && output == mPrimaryOutput) {
            mpClientInterface->setVoiceVolume(voiceVolume, delayMs);