DSDA: Resolve missed call not received for 2nd MT.
When we have an existing ringing/dialing call and we attempt to receive
another incoming call on a different sim, ensure that we log the missed
call. Previously, this was failing in the IMS call tracker but now we're
explicitly handling this in Telecom so that we can log the call.
Bug: 394161212
Flag: com.android.server.telecom.flags.enable_call_sequencing
Test: Manual verification for RINGING + RINGING and DIALING + RINGING to
verify that 2nd call shows up in the call log and that we are properly
disconnecting the call in Telecom.
Test: atest CtsTelecomCujTestCases:CallSequencingBasicCallTest
Change-Id: I69dfda2146f278cf07e0c587f8447f4fe6ee4e2b
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 39cd379..7a0ff3a 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -1828,6 +1828,24 @@
} else {
notifyCreateConnectionFailed(phoneAccountHandle, call);
}
+ } else if (mFeatureFlags.enableCallSequencing() && (hasMaximumManagedRingingCalls(call)
+ || hasMaximumManagedDialingCalls(call))) {
+ // Fail incoming call if there's already a ringing or dialing call present.
+ boolean maxRinging = hasMaximumManagedRingingCalls(call);
+ if (maxRinging) {
+ call.setMissedReason(AUTO_MISSED_MAXIMUM_RINGING);
+ call.setStartFailCause(CallFailureCause.MAX_RINGING_CALLS);
+ } else {
+ call.setMissedReason(AUTO_MISSED_MAXIMUM_DIALING);
+ }
+ call.getAnalytics().setMissedReason(call.getMissedReason());
+ mCallLogManager.logCall(call, Calls.MISSED_TYPE,
+ true /*showNotificationForMissedCall*/, null /*CallFilteringResult*/);
+ if (isConference) {
+ notifyCreateConferenceFailed(phoneAccountHandle, call);
+ } else {
+ notifyCreateConnectionFailed(phoneAccountHandle, call);
+ }
} else if (call.isTransactionalCall()) {
// transactional calls should skip Call#startCreateConnection below
// as that is meant for Call objects with a ConnectionServiceWrapper
@@ -3544,6 +3562,9 @@
*/
public void disconnectCallOld(Call call, int previousState) {
call.disconnect();
+ for (CallsManagerListener listener : mListeners) {
+ listener.onCallStateChanged(call, previousState, call.getState());
+ }
processDisconnectCallAndCleanup(call, previousState);
}
@@ -3554,9 +3575,6 @@
* @param previousState The previous call state before the call is disconnected.
*/
public void processDisconnectCallAndCleanup(Call call, int previousState) {
- for (CallsManagerListener listener : mListeners) {
- listener.onCallStateChanged(call, previousState, call.getState());
- }
// Cancel any of the outgoing call futures if they're still around.
if (mPendingCallConfirm != null && !mPendingCallConfirm.isDone()) {
mPendingCallConfirm.complete(null);