Fixes for IMS Conferences via the RemoteConnectionService API.
IMS Conferences are problematic to Telecom when a connection manager is
used. Both addExistingConnection and addConference will result in the
addition of duplicate conference participants and conferences to Telecom.
This is because Telecom does not have a means of de-duping the two, which
have new IDs created for them when they're added via a ConnectionService.
To fix this, added a workaround which packages the original existing
connection or conference id into the connection/conference extras which
are sent to the connection manager. This way, the connection mgr can use
the same connection/conference ID was was used by the original
ConnectionService, and also perform some de-duping.
Its not optimal, and this should be fixed better in the future.
Bug: 31464792
Change-Id: I7b63f145c741c29e1735f50a473585f26ef70fc7
diff --git a/src/com/android/server/telecom/ServiceBinder.java b/src/com/android/server/telecom/ServiceBinder.java
index 9a0f7b4..05f0bcb 100644
--- a/src/com/android/server/telecom/ServiceBinder.java
+++ b/src/com/android/server/telecom/ServiceBinder.java
@@ -169,7 +169,7 @@
private final String mServiceAction;
/** The component name of the service to bind to. */
- private final ComponentName mComponentName;
+ protected final ComponentName mComponentName;
/** The set of callbacks waiting for notification of the binding's success or failure. */
private final Set<BindCallback> mCallbacks = new ArraySet<>();
@@ -227,12 +227,16 @@
}
final void decrementAssociatedCallCount() {
+ decrementAssociatedCallCount(false /*isSuppressingUnbind*/);
+ }
+
+ final void decrementAssociatedCallCount(boolean isSuppressingUnbind) {
if (mAssociatedCallCount > 0) {
mAssociatedCallCount--;
Log.v(this, "Call count decrement %d, %s", mAssociatedCallCount,
mComponentName.flattenToShortString());
- if (mAssociatedCallCount == 0) {
+ if (!isSuppressingUnbind && mAssociatedCallCount == 0) {
unbind();
}
} else {