Enhancements to conference for non-conference host scenarios.
When a device A creates a conference call containing device B and C, both
B and C can receive IMS signaling to indicate that they are in a conference
call. This occurs on most domestic carriers; the Telephony framework
uses the "multiparty" indicator on the IMS call to switch the call to a
conference call.
We made some changes to how conference calls are logged in Q which improves
the accuracy of the call durations. We used to log calls as they're merged
into a conference. In the case of a participant in a remotely hosted
conference call, we'd log the call as soon as they are remotely added
to the conference. This is unfortunate as the call durations are grossly
under-reported.
The conference call logging changes now assume we'll log the conference
event package children in the conference instead of the participants which
merge into the conference itself. On domestic carriers, since the
call on B (or C) becomes a conference, we would then no longer log the
call.
This is FURTHER complicated because on some carriers, B and C will ALSO
receive a conference event package from the network showing all the
participants in the conference. So if B hangs up on the conference, they
will have entries in their call log for A and C, which is really strange
because a call to C was never originated on their device.
In Telecom we need to ensure we do not log remotely hosted conference
participants, and we need to ensure that we DO log a remotely hosted
conference as if its just a single party call.
To accomplish this we need:
1. the address and name display information associated with the call from
A-B / A-C prior to the call turning into a remotely hosted conference.
We need this to log to the call log
2. the remotely hosted conference and participants need to be marked in a
manner that Telecom can identify them.
Test: Manual test.
Test: Add unit test to cover this logging scenario.
Bug: 132325382
Change-Id: I65e713f68d1695a48d96dacbf7faa4476cd8d815
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 6000b56..cd5fd97 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -95,6 +95,10 @@
private Bundle mExtras;
private Set<String> mPreviousExtraKeys;
private final Object mExtrasLock = new Object();
+ private Uri mAddress;
+ private int mAddressPresentation;
+ private String mCallerDisplayName;
+ private int mCallerDisplayNamePresentation;
private final Connection.Listener mConnectionDeathListener = new Connection.Listener() {
@Override
@@ -987,12 +991,67 @@
*/
public final void setAddress(Uri address, int presentation) {
Log.d(this, "setAddress %s", address);
+ mAddress = address;
+ mAddressPresentation = presentation;
for (Listener l : mListeners) {
l.onAddressChanged(this, address, presentation);
}
}
/**
+ * Returns the "address" associated with the conference. This is applicable in two cases:
+ * <ol>
+ * <li>When {@link #setConferenceState(boolean)} is used to mark a conference as
+ * temporarily "not a conference"; we need to present the correct address in the in-call
+ * UI.</li>
+ * <li>When the conference is not hosted on the current device, we need to know the address
+ * information for the purpose of showing the original address to the user, as well as for
+ * logging to the call log.</li>
+ * </ol>
+ * @return The address of the conference, or {@code null} if not applicable.
+ * @hide
+ */
+ public final Uri getAddress() {
+ return mAddress;
+ }
+
+ /**
+ * Returns the address presentation associated with the conference.
+ * <p>
+ * This is applicable in two cases:
+ * <ol>
+ * <li>When {@link #setConferenceState(boolean)} is used to mark a conference as
+ * temporarily "not a conference"; we need to present the correct address in the in-call
+ * UI.</li>
+ * <li>When the conference is not hosted on the current device, we need to know the address
+ * information for the purpose of showing the original address to the user, as well as for
+ * logging to the call log.</li>
+ * </ol>
+ * @return The address of the conference, or {@code null} if not applicable.
+ * @hide
+ */
+ public final int getAddressPresentation() {
+ return mAddressPresentation;
+ }
+
+ /**
+ * @return The caller display name (CNAP).
+ * @hide
+ */
+ public final String getCallerDisplayName() {
+ return mCallerDisplayName;
+ }
+
+ /**
+ * @return The presentation requirements for the handle.
+ * See {@link TelecomManager} for valid values.
+ * @hide
+ */
+ public final int getCallerDisplayNamePresentation() {
+ return mCallerDisplayNamePresentation;
+ }
+
+ /**
* Sets the caller display name (CNAP) of this {@link Conference}. Used when
* {@link #setConferenceState(boolean)} is called to mark a conference temporarily as NOT a
* conference.
@@ -1004,6 +1063,8 @@
*/
public final void setCallerDisplayName(String callerDisplayName, int presentation) {
Log.d(this, "setCallerDisplayName %s", callerDisplayName);
+ mCallerDisplayName = callerDisplayName;
+ mCallerDisplayNamePresentation = presentation;
for (Listener l : mListeners) {
l.onCallerDisplayNameChanged(this, callerDisplayName, presentation);
}