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

Commit 9190f94d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DSDA: Drop HELD with ACTIVE + RINGING nonholdable" into main

parents f78306bc 6bedacff
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -355,12 +355,15 @@ public class CallSequencingController {
                            Log.i(this, "Disconnecting non-holdable calls from account (%s).",
                                    activeCall.getTargetPhoneAccount());
                            return disconnectAllCallsWithPhoneAccount(
                                    activeCall.getTargetPhoneAccount());
                                    activeCall.getTargetPhoneAccount(), false /* excludeAccount */);
                        } else {
                            // Disconnect calls on other phone accounts and allow CS to handle
                            // holding/disconnecting calls from the same CS.
                            Log.i(this, "holdActiveCallForNewCallWithSequencing: "
                                    + "allowing ConnectionService to determine how to handle "
                                    + "this case");
                            CompletableFuture.completedFuture(true);
                                    + "disconnecting calls on other phone accounts and allowing "
                                    + "ConnectionService to determine how to handle this case.");
                            return disconnectAllCallsWithPhoneAccount(
                                    activeCall.getTargetPhoneAccount(), true /* excludeAccount */);
                        }
                    }
                } else {
@@ -1027,10 +1030,10 @@ public class CallSequencingController {
    }

    private CompletableFuture<Boolean> disconnectAllCallsWithPhoneAccount(
            PhoneAccountHandle handle) {
            PhoneAccountHandle handle, boolean excludeAccount) {
        CompletableFuture<Boolean> disconnectFuture = CompletableFuture.completedFuture(true);
        List<Call> calls = mCallsManager.getCalls().stream()
                .filter(c -> c.getTargetPhoneAccount().equals(handle)).toList();
                .filter(c -> excludeAccount != c.getTargetPhoneAccount().equals(handle)).toList();
        for (Call call: calls) {
            // Wait for all disconnects before we accept the new call.
            disconnectFuture = disconnectFuture.thenComposeAsync((result) -> {
@@ -1038,7 +1041,7 @@ public class CallSequencingController {
                    Log.i(this, "disconnectAllCallsWithPhoneAccount: "
                            + "Failed to disconnect %s.", call);
                }
                return call.disconnect("Un-holdable call " + call + " disconnected "
                return call.disconnect("Call " + call + " disconnected "
                        + "in favor of new call.");
            }, new LoggedHandlerExecutor(mHandler, "CSC.dACWPA", mCallsManager.getLock()));
        }
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import java.util.stream.IntStream;
 */
public class VerifyCallStateChangeTransaction extends CallTransaction {
    private static final String TAG = VerifyCallStateChangeTransaction.class.getSimpleName();
    private static final long CALL_STATE_TIMEOUT_MILLISECONDS = 2000L;
    private static final long CALL_STATE_TIMEOUT_MILLISECONDS = 5000L;
    private final Call mCall;
    private final Set<Integer> mTargetCallStates;
    private final CompletableFuture<CallTransactionResult> mTransactionResult =