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

Commit 130ad286 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fix regression in emergency dialing auto-disconnect code.

Change to support the call focus management caused a regression in the
disconnect logic when placing an outgoing call.  Some carriers do not
support holding of calls so the new logic would always disconnect a single
active call.

Reverting to the previous logic which relies on other means to tell if
we have reached the max number of held calls.  In the case of a carrier
which doesn't support call holding, we'll still place the emergency call
while leaving the previous active call alone.

Test: Ensure that single active call is not disconnected when dialing
emergency call.
Test: Ensure that where an active and held call is present, the active
call is disconnected to make room for emergency call.
Fixes: 79381233

Change-Id: I248804fe7a8402fe4a6a9263ea1224a04073e03f
parent 195e669f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2848,11 +2848,13 @@ public class CallsManager extends Call.ListenerBase
                return false;
            }

            // Disconnected the live call if the outgoing call is an emergency call.
            if (isEmergency && !canHold(liveCall)) {
            // If we have the max number of held managed calls and we're placing an emergency call,
            // we'll disconnect the ongoing call if it cannot be held.
            if (hasMaximumManagedHoldingCalls(call) && isEmergency && !canHold(liveCall)) {
                call.getAnalytics().setCallIsAdditional(true);
                liveCall.getAnalytics().setCallIsInterrupted(true);
                liveCall.disconnect("emergency, can't hold");
                liveCall.disconnect("disconnecting to make room for emergency call "
                        + call.getId());
                return true;
            }