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

Commit 677e8113 authored by Yorke Lee's avatar Yorke Lee
Browse files

Correctly report phone state when call waiting is rejected

Bug: 17673093
Change-Id: Ibb539858ff9644621139f4829d1e6d1c521d597a
parent fddf12ed
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() {