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

Commit d2da9cdb authored by Pranav Madapurmath's avatar Pranav Madapurmath Committed by Android (Google) Code Review
Browse files

Merge "DSDA: Cleanup outgoing ECC logic" into main

parents 04b02ca5 8d34df6a
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 &&