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

Commit 6c97eba1 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "SIP calls should set the audio mode to MODE_IN_COMMUNICATION"

parents 751073ac 42c5a5ed
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -380,13 +380,18 @@ public final class CallManager {
                break;
            case OFFHOOK:
                Phone fgPhone = getFgPhone();
                // Enable IN_CALL mode while foreground call is in DIALING,
                // ALERTING, ACTIVE and DISCONNECTING state and not from sipPhone
                // While foreground call is in DIALING,
                // ALERTING, ACTIVE and DISCONNECTING state
                if (getActiveFgCallState() != Call.State.IDLE
                        && getActiveFgCallState() != Call.State.DISCONNECTED
                        && !(fgPhone instanceof SipPhone)) {
                        && getActiveFgCallState() != Call.State.DISCONNECTED) {
                    if (fgPhone instanceof SipPhone) {
                        // enable IN_COMMUNICATION audio mode for sipPhone
                        mode = AudioManager.MODE_IN_COMMUNICATION;
                    } else {
                        // enable IN_CALL audio mode for telephony
                        mode = AudioManager.MODE_IN_CALL;
                    }
                }
                break;
        }
        // calling audioManager.setMode() multiple times in a short period of