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

Commit 3554345a authored by Vidyakumar Athota's avatar Vidyakumar Athota
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.

Change-Id: I69de60987835cc7bfbf26e6b89eb39447423fd9d
parent 02f6a3cb
Loading
Loading
Loading
Loading
+5 −13
Original line number Diff line number Diff line
@@ -1076,20 +1076,12 @@ status_t AudioPolicyManager::checkAndSetVolume(int stream,
    if (stream == AudioSystem::VOICE_CALL ||
        stream == AudioSystem::BLUETOOTH_SCO) {
        float voiceVolume;

        // Force voice volume to max for bluetooth SCO as volume is managed by the headset
        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 {
            voiceVolume = 1.0;
        }
        }

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