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

Commit f3399156 authored by Yorke Lee's avatar Yorke Lee
Browse files

Don't play call waiting for first incoming call

The first incoming call causes the ringer to play call waiting
for a split second before the ringtone sounds because it is
not in the foreground at that point in time.

This causes issues with the audio layer as going to IN_CALL right before
MODE_RINGTONE results in a loss of outgoing audio for the first call.

Add a special check to avoid this scenario.

Bug: 17961223
Change-Id: I580f9c8fa21e375d0c1d6fada80aa23d1ecdb913
parent 88336c2e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -203,7 +203,11 @@ final class Ringer extends CallsManagerListenerBase {
                        VIBRATION_ATTRIBUTES);
                mIsVibrating = true;
            }
        } else {
        } else if (foregroundCall != null) {
            // The first incoming call added to Telecom is not a foreground call at this point
            // in time. If the current foreground call is null at point, don't play call-waiting
            // as the call will eventually be promoted to the foreground call and play the
            // ring tone.
            Log.v(this, "Playing call-waiting tone.");

            // All incoming calls are in background so play call waiting.