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: Yung Ti Su <andysu@google.com>
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index e1467b7..d1d7530 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -596,7 +596,7 @@
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*/);
}
}