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

Commit bd1440c8 authored by Avinash Vaish's avatar Avinash Vaish
Browse files

policy_hal: remove VGS check for BT volume

-Currently voice volume is forced to MAX when VGS is set for BT.
 But VGS parameter is not used anymore in BT stack so it never
 set the value.
-Removed VGS check as this is deprecated and keep the behavior
 same as default policy.

CRs-Fixed: 645853
Change-Id: I69de60987835cc7bfbf26e6b89eb39447423fd9d
parent a593da0c
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);