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

Commit 197a1bce authored by Sandeep Kunta's avatar Sandeep Kunta
Browse files

Accept waiting call, when hold & active calls are present.

In order to accept waiting call when hold & active calls are
present on same subscription, disconnect active call before
sending answer request for waiting call.

Change-Id: Id33224e43ca6db283bf6f8a03cbaac4b6cdefac2
CRs-Fixed: 723716
parent 1910df58
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -593,6 +593,16 @@ public final class CallsManager extends Call.ListenerBase {
        } else {
            Call activeCall = getFirstCallWithStateUsingSubId(call.getTargetPhoneAccount()
                    .getId(), CallState.ACTIVE, CallState.DIALING);
            //Check for existence of active call & held
            if ((activeCall != null) && (getFirstCallWithStateUsingSubId(call
                    .getTargetPhoneAccount().getId(), CallState.ON_HOLD) != null)) {
                Log.i(this, "Disconnect active call");
                // Both active call & Held call are present, hence disconnect active call
                // before sending answer request on waiting call.
                activeCall.disconnect();
                activeCall = null;
            }

            // If the foreground call is not the ringing call and it is currently isActive() or
            // STATE_DIALING, put it on hold before answering the call.
            if (activeCall != null && activeCall != call &&