Make connection events work for conferences
Pipe through the onConnectionEvent call between the conference host
connection and the android.telecom.Conference object.
Fixes: 130404376
Test: manual
Change-Id: Ifad3e59dc9764aa2efb2b9766271e18853bf1c76
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index 6382acf..6000b56 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -68,6 +68,7 @@
public void onExtrasRemoved(Conference c, List<String> keys) {}
public void onConferenceStateChanged(Conference c, boolean isConference) {}
public void onAddressChanged(Conference c, Uri newAddress, int presentation) {}
+ public void onConnectionEvent(Conference c, String event, Bundle extras) {}
public void onCallerDisplayNameChanged(
Conference c, String callerDisplayName, int presentation) {}
}
@@ -1024,4 +1025,14 @@
}
onExtrasChanged(b);
}
+
+ /**
+ * See {@link Connection#sendConnectionEvent(String, Bundle)}
+ * @hide
+ */
+ public void sendConnectionEvent(String event, Bundle extras) {
+ for (Listener l : mListeners) {
+ l.onConnectionEvent(this, event, extras);
+ }
+ }
}
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 9bafbe0..49b34b3 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -1279,6 +1279,14 @@
mAdapter.setCallerDisplayName(id, callerDisplayName, presentation);
}
}
+
+ @Override
+ public void onConnectionEvent(Conference c, String event, Bundle extras) {
+ String id = mIdByConference.get(c);
+ if (id != null) {
+ mAdapter.onConnectionEvent(id, event, extras);
+ }
+ }
};
private final Connection.Listener mConnectionListener = new Connection.Listener() {