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

Commit 3ed6d792 authored by Satya Krishna Pindiproli's avatar Satya Krishna Pindiproli
Browse files

hal: fix low volume issue during device switch in a hfp call

When an active hfp call is switched from the hands-free client
to the audio gateway and then back to the hands-free client,
voice is not heard at the client.

After the switch from the gateway to the client, the volume applied
is very low and hence is not audible.

Fix the issue by setting the volume properly.

CRs-Fixed: 720804
Change-Id: I4dfdff7d0b8e5763dc0a19d55531252994db90c3
parent a8fb2e1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ static int32_t hfp_set_volume(struct audio_device *adev, float value)
    ALOGV("%s: entry", __func__);
    ALOGD("%s: (%f)\n", __func__, value);

    hfpmod.hfp_volume = value;
    if (value < 0.0) {
        ALOGW("%s: (%f) Under 0.0, assuming 0.0\n", __func__, value);
        value = 0.0;
@@ -103,7 +104,6 @@ static int32_t hfp_set_volume(struct audio_device *adev, float value)
        ALOGW("%s: Volume brought with in range (%f)\n", __func__, value);
    }
    vol  = lrint((value * 0x2000) + 0.5);
    hfpmod.hfp_volume = value;

    if (!hfpmod.is_hfp_running) {
        ALOGV("%s: HFP not active, ignoring set_hfp_volume call", __func__);