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

Commit 8d34df6a authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

DSDA: Cleanup outgoing ECC logic

First of, this CL addresses two bug fixes for conference calling + ECC
where we were disconnecting the child call during the bulk disconnect
operation. There's no need to do this and we can just disconnect the
host call.

Second, this CL also addresses some minor bugs and caveats found during
implementation. For non-holdable sims (VZW), we will now hold the VZW
call when placing an emergency call. Before, we were just disconnecting
the calls but due to how hold is handled on a single sim (for
non-holdable case), the swap operation will allow this to work
seamlessly. The other fix is around auto-unholding the non-holdable held
call in a single sim scenario. Due to the waiting performed on the
disconnect operations, it's possible that the held call is unheld while
we're processing the outgoing emergency call which can result in two
active calls. Now, we will skip this auto-unhold when we're placing an
outgoing (emergency) call. Note that once the outgoing call is placed or
fails, we will rerun the auto unhold logic and the held call will
successfully be unheld at that point.

Lastly, this CL performs a cleanup on the
makeRoomForOutgoingEmergencyCall logic. There are many clear assumptions
that can be made about the state of the calls at certain points in the
method which allows us to remove a lot of redundant code and makes this
method more readable.

Bug: 403620519
Flag: com.android.server.telecom.flags.enable_call_sequencing
Test: atest CtsTelecomCujTestCases
Test: Manual verification with the conference calling cases from the
bugs
Test: Manual verification with the two call scenario for different sim
combinations

Change-Id: I6a2fb3b4f36c6c33500d2cbab72183e2040b31a8
parent 74b2a342
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -644,6 +644,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,

    private boolean mIsTransactionalCall = false;
    private CallingPackageIdentity mCallingPackageIdentity = new CallingPackageIdentity();
    private boolean mSkipAutoUnhold = false;

    /**
     * CallingPackageIdentity is responsible for storing properties about the calling package that
@@ -5108,4 +5109,21 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
    public boolean hasVideoCall() {
        return mHasVideoCall;
    }

    /**
     * Used only for call sequencing for cases when we may end up auto-unholding the held call while
     * processing an outgoing (emergency) call. We want to refrain from unholding the held call so
     * that we don't end up with two active calls. Once the outgoing call is disconnected (either
     * from a successful disconnect by the user or a failed call), the auto-unhold logic will be
     * triggered again and successfully unhold the held call at that point. Note, that this only
     * applies to non-holdable phone accounts (i.e. Verizon). Refer to
     * {@link CallsManagerCallSequencingAdapter#maybeMoveHeldCallToForeground} for details.
     */
    public void setSkipAutoUnhold(boolean result) {
        mSkipAutoUnhold = result;
    }

    public boolean getSkipAutoUnhold() {
        return mSkipAutoUnhold;
    }
}
+168 −134

File changed.

Preview size limit exceeded, changes collapsed.

+10 −1
Original line number Diff line number Diff line
@@ -234,6 +234,16 @@ public class CallsManagerCallSequencingAdapter {
    public void maybeMoveHeldCallToForeground(Call removedCall, boolean isLocallyDisconnecting) {
        CompletableFuture<Boolean> unholdForegroundCallFuture = null;
        Call foregroundCall = mCallAudioManager.getPossiblyHeldForegroundCall();
        // There are some cases (non-holdable calls) where we may want to skip auto-unholding when
        // we're processing a new outgoing call and waiting for it to go active. Skip the
        // auto-unholding in this case so that we don't end up with two active calls. If the new
        // call fails, we will auto-unhold on that removed call. This is only set in
        // CallSequencingController because the legacy code doesn't wait for disconnects to occur
        // in order to place an outgoing (emergency) call, so we don't see this issue.
        if (removedCall.getSkipAutoUnhold()) {
            return;
        }

        if (isLocallyDisconnecting) {
            boolean isDisconnectingChildCall = removedCall.isDisconnectingChildCall();
            Log.v(this, "maybeMoveHeldCallToForeground: isDisconnectingChildCall = "
@@ -247,7 +257,6 @@ public class CallsManagerCallSequencingAdapter {
            if (!isDisconnectingChildCall && foregroundCall != null
                    && foregroundCall.getState() == CallState.ON_HOLD
                    && CallsManager.areFromSameSource(foregroundCall, removedCall)) {

                unholdForegroundCallFuture = foregroundCall.unhold();
            }
        } else if (foregroundCall != null &&