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

Commit 86878d87 authored by Thomas Stuart's avatar Thomas Stuart
Browse files

disconnect or ignore onAnswer/onSetAnswer CCCs that are rejected

TL;DR:
- docs update for CallControlCallback rejection cases
- CTS coverage for onAnswer#(wasCompleted(false)) case
- CTS coverage for onSetActive#(wasCompleted(false)) case
- TSW fix

In most of the Transactional tests, it's expected that the client
always completed the CallControlCallback. In adding these tests I
noticed that the current logic will answer or set the call active if the
client rejects the onAnswer or onSetActive. In order to prevent this two
active call scenario, I've adjusted the appropriate code.

Fixes: 279034589
Test: CTS coverage for changes
Change-Id: I614ac31d53b4bc01b35f40de9dbc5a75933f09c5
parent 2ab0678e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -425,6 +425,15 @@ public class TransactionalServiceWrapper implements

                    @Override
                    public void onError(CallException exception) {
                        if (isAnswerRequest) {
                            // This also sends the signal to untrack from TSW and the client_TSW
                            removeCallFromCallsManager(call,
                                    new DisconnectCause(DisconnectCause.REJECTED,
                                            "client rejected to answer the call;"
                                                    + " force disconnecting"));
                        } else {
                            mCallsManager.markCallAsOnHold(call);
                        }
                        maybeResetForegroundCall(foregroundCallBeforeSwap, wasActive);
                    }
                });
+2 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@ public class CallEventCallbackAckTransaction extends VoipCallTransaction {
            boolean success = latch.await(VoipCallTransaction.TIMEOUT_LIMIT, TimeUnit.MILLISECONDS);
            if (!success) {
                // client send onError and failed to complete transaction
                Log.i(TAG, String.format("CallEventCallbackAckTransaction:"
                        + " client failed to complete the [%s] transaction", mAction));
                return CompletableFuture.completedFuture(TRANSACTION_FAILED);
            } else {
                // success