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

Commit 5d71ca77 authored by Yorke Lee's avatar Yorke Lee Committed by Android Git Automerger
Browse files

am 36bf1ca0: Merge "Correctly report phone state when call waiting is rejected" into lmp-dev

* commit '36bf1ca0':
  Correctly report phone state when call waiting is rejected
parents ea30cfca 36bf1ca0
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -61,9 +61,17 @@ final class PhoneStateBroadcaster extends CallsManagerListenerBase {

    @Override
    public void onCallRemoved(Call call) {
        if (!CallsManager.getInstance().hasAnyCalls()) {
            sendPhoneStateChangedBroadcast(call, TelephonyManager.CALL_STATE_IDLE);
        // Recalculate the current phone state based on the consolidated state of the remaining
        // calls in the call list.
        final CallsManager callsManager = CallsManager.getInstance();
        int callState = TelephonyManager.CALL_STATE_IDLE;
        if (callsManager.hasRingingCall()) {
            callState = TelephonyManager.CALL_STATE_RINGING;
        } else if (callsManager.getFirstCallWithState(CallState.DIALING, CallState.ACTIVE,
                    CallState.ON_HOLD) != null) {
            callState = TelephonyManager.CALL_STATE_OFFHOOK;
        }
        sendPhoneStateChangedBroadcast(call, callState);
    }

    int getCallState() {