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

Commit 8dc87a60 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy manager: do not reapply same forced usage

Skip systematic audio path and volume reevaluation when the new
forced configuration for the selected usage is the same as current one.

Bug: 38276985
Test: try repro steps in b/38276985. Check regressions with audio routing for music
and calls over speaker, headset and Bluetooth

Test: connect BT A2DP and launch CNN
Change-Id: Id43a5270c666065e099d02d9e52de86b20cb8039
parent 38ad5e22
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -638,6 +638,9 @@ void AudioPolicyManager::setForceUse(audio_policy_force_use_t usage,
                                         audio_policy_forced_cfg_t config)
{
    ALOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mEngine->getPhoneState());
    if (config == mEngine->getForceUse(usage)) {
        return;
    }

    if (mEngine->setForceUse(usage, config) != NO_ERROR) {
        ALOGW("setForceUse() could not set force cfg %d for usage %d", config, usage);