Correct CDMA conference establishment issue.
When making an outgoing call on the device while simultaneously receiving
an incoming call, there is a possibility for one of the calls to be added
to the cdma conference before the call has itself been added to the
ConnectionService as a tracked call.
Test: Manual
Bug: 34033942
Change-Id: I1fffc642ae8bd36cef92bd2d669e675ddb651de4
diff --git a/src/com/android/services/telephony/CdmaConferenceController.java b/src/com/android/services/telephony/CdmaConferenceController.java
index 0a7c18b..846df61 100644
--- a/src/com/android/services/telephony/CdmaConferenceController.java
+++ b/src/com/android/services/telephony/CdmaConferenceController.java
@@ -122,8 +122,18 @@
}
}, ADD_OUTGOING_CONNECTION_DELAY_MILLIS);
} else {
- // This is the first connection, or it is incoming, so let it flow through.
- addInternal(connection);
+ // Post the call to addInternal to the handler with no delay.
+ // Why you ask? In TelephonyConnectionService#
+ // onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest) or
+ // TelephonyConnectionService#onCreateOutgoingConnection(PhoneAccountHandle,
+ // ConnectionRequest) we can create a new connection it will trigger a call to
+ // TelephonyConnectionService#addConnectionToConferenceController, which will cause us
+ // to get here. HOWEVER, at this point ConnectionService#addConnection has not yet run,
+ // so if we end up calling ConnectionService#addConference, the connection service will
+ // not yet know about the new connection, so it won't get added to the conference.
+ // Posting to the handler ensures addConnection has a chance to happen before we add the
+ // conference.
+ mHandler.post(() -> addInternal(connection));
}
}