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

Commit 36bf1ca0 authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Correctly report phone state when call waiting is rejected" into lmp-dev

parents b63254cf 677e8113
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() {