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

Commit 2f99bb5e authored by John Wang's avatar John Wang Committed by Android (Google) Code Review
Browse files

Merge "Remain in call audio mode while phone is offhook." into ics-mr1

parents 2d9ccdb4 f885e878
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -379,19 +379,20 @@ public final class CallManager {
                mode = AudioManager.MODE_RINGTONE;
                break;
            case OFFHOOK:
                Phone fgPhone = getFgPhone();
                // While foreground call is in DIALING,
                // ALERTING, ACTIVE and DISCONNECTING state
                if (getActiveFgCallState() != Call.State.IDLE
                        && getActiveFgCallState() != Call.State.DISCONNECTED) {
                    if (fgPhone instanceof SipPhone) {
                Phone offhookPhone = getFgPhone();
                if (getActiveFgCallState() == Call.State.IDLE) {
                    // There is no active Fg calls, the OFFHOOK state
                    // is set by the Bg call. So set the phone to bgPhone.
                    offhookPhone = getBgPhone();
                }

                if (offhookPhone 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