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

Commit 1433cc64 authored by Mingming Yin's avatar Mingming Yin Committed by Gerrit - the friendly Code Review server
Browse files

policy_hal: fix for volume burst during FM device switch

- Issue: Volume burst is heard during device switch
  (headphone and speaker) for FM playback
- Root cause: delayMs passed to CheckAndSetVolume is
  not applied for FM playback
- Fix: Double delayMs and apply FM volume with this delay

Change-Id: Ifa0b214d16527973277a5c84b8a4f3fbd0760d07
parent 61f9adf9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1277,7 +1277,8 @@ status_t AudioPolicyManagerCustom::checkAndSetVolume(audio_stream_type_t stream,
            mPrevFMVolumeDb = volumeDb;
            AudioParameter param = AudioParameter();
            param.addFloat(String8("fm_volume"), Volume::DbToAmpl(volumeDb));
            mpClientInterface->setParameters(mPrimaryOutput->mIoHandle, param.toString(), delayMs);
            //Double delayMs to avoid sound burst while device switch.
            mpClientInterface->setParameters(mPrimaryOutput->mIoHandle, param.toString(), delayMs*2);
        }
#endif /* FM_POWER_OPT end */
    }