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

Commit f60c824b authored by Yung Ti Su's avatar Yung Ti Su Committed by Carter Hsu
Browse files

audiopolicy: clean delayMs to 0 before reevaluate all outputs routing when call state changes



since the delayMs is for updateCallRouting(),
we need to clean delayMs to 0 before reevaluate
all outputs routing when call state changes.
Otherwise, setPhoneState will cost too much time
which will block UI making phone call.
Test: self-test making phone call and check for delay time
Bug: 79187322

Test: delayed time is reduced.
Change-Id: I3f71af700efb958c0716b4bf28aa436d85c5af66
Signed-off-by: default avatarYung Ti Su <andysu@google.com>
parent ec2c0359
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -596,7 +596,7 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state)
        sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
        audio_devices_t newDevice = getNewOutputDevice(desc, true /*fromCache*/);
        if (state != AUDIO_MODE_IN_CALL || desc != mPrimaryOutput) {
            setOutputDevice(desc, newDevice, (newDevice != AUDIO_DEVICE_NONE), delayMs);
            setOutputDevice(desc, newDevice, (newDevice != AUDIO_DEVICE_NONE), 0 /*delayMs*/);
        }
    }