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

Commit 0ca47c2b authored by Carter Hsu's avatar Carter Hsu
Browse files

AudioFlinger: revert adjust standby delay on VOIP RX output



This reverts the fix for b/227811055.

If VoIP client starts/stops the track quickly, it might cause
the VoIP output standby/resume frequently.

Bug: 285443585
Test: 1. made VoIP call and confirmed the VoIP output didn't standby
         frequently.
      2. played music and made voice-call, music resumed on speaker
         when the call ends.
      3. played youtube music and received an incoming call, confirmed
         the music resumed from speaker when the incoming call ended.
Change-Id: I37b8b82cc46f4088dd1cf02ef6ddcda721504257
Signed-off-by: default avatarCarter Hsu <carterhsu@google.com>
parent c36537d8
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -3571,12 +3571,7 @@ void AudioFlinger::PlaybackThread::cacheParameters_l()
    mIdleSleepTimeUs = idleSleepTimeUs();

    mStandbyDelayNs = AudioFlinger::mStandbyTimeInNsecs;
    // Shorten standby delay on VOIP RX output to avoid delayed routing updates
    // after a call due to call end tone.
    if (mOutput != nullptr && (mOutput->flags & AUDIO_OUTPUT_FLAG_VOIP_RX) != 0) {
        const nsecs_t NS_PER_MS = 1000000;
        mStandbyDelayNs = std::min(mStandbyDelayNs, latency_l() * NS_PER_MS);
    }

    // make sure standby delay is not too short when connected to an A2DP sink to avoid
    // truncating audio when going to standby.
    if (!Intersection(outDeviceTypes(),  getAudioDeviceOutAllA2dpSet()).empty()) {