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

Commit 02c45c7a authored by John Wang's avatar John Wang Committed by Android Git Automerger
Browse files

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

* commit '2f99bb5e':
  Remain in call audio mode while phone is offhook.
parents 46bb0a1c 2f99bb5e
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