diff options
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
| -rw-r--r-- | telecomm/java/android/telecom/ConnectionService.java | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index dfdc3e1..9812815 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -17,7 +17,6 @@ package android.telecom; import android.annotation.SdkConstant; -import android.annotation.SystemApi; import android.app.Service; import android.content.ComponentName; import android.content.Intent; @@ -72,9 +71,7 @@ import java.util.concurrent.ConcurrentHashMap; * receives call-commands such as answer, reject, hold and disconnect. * <p> * When there are no more live calls, telecom will unbind from the {@code ConnectionService}. - * @hide */ -@SystemApi public abstract class ConnectionService extends Service { /** * The {@link Intent} that must be declared as handled by the service. @@ -415,6 +412,21 @@ public abstract class ConnectionService extends Service { Connection.capabilitiesToString(connectionCapabilities)); mAdapter.setConnectionCapabilities(id, connectionCapabilities); } + + @Override + public void onVideoStateChanged(Conference c, int videoState) { + String id = mIdByConference.get(c); + Log.d(this, "onVideoStateChanged set video state %d", videoState); + mAdapter.setVideoState(id, videoState); + } + + @Override + public void onVideoProviderChanged(Conference c, Connection.VideoProvider videoProvider) { + String id = mIdByConference.get(c); + Log.d(this, "onVideoProviderChanged: Connection: %s, VideoProvider: %s", c, + videoProvider); + mAdapter.setVideoProvider(id, videoProvider); + } }; private final Connection.Listener mConnectionListener = new Connection.Listener() { @@ -508,6 +520,8 @@ public abstract class ConnectionService extends Service { @Override public void onVideoProviderChanged(Connection c, Connection.VideoProvider videoProvider) { String id = mIdByConnection.get(c); + Log.d(this, "onVideoProviderChanged: Connection: %s, VideoProvider: %s", c, + videoProvider); mAdapter.setVideoProvider(id, videoProvider); } @@ -525,7 +539,7 @@ public abstract class ConnectionService extends Service { @Override public void onConferenceablesChanged( - Connection connection, List<IConferenceable> conferenceables) { + Connection connection, List<Conferenceable> conferenceables) { mAdapter.setConferenceableConnections( mIdByConnection.get(connection), createIdList(conferenceables)); @@ -871,6 +885,8 @@ public abstract class ConnectionService extends Service { * @param conference The new conference object. */ public final void addConference(Conference conference) { + Log.d(this, "addConference: conference=%s", conference); + String id = addConferenceInternal(conference); if (id != null) { List<String> connectionIds = new ArrayList<>(2); @@ -884,8 +900,14 @@ public abstract class ConnectionService extends Service { conference.getState(), conference.getConnectionCapabilities(), connectionIds, - conference.getConnectTimeMillis()); + conference.getVideoProvider() == null ? + null : conference.getVideoProvider().getInterface(), + conference.getVideoState(), + conference.getConnectTimeMillis() + ); mAdapter.addConferenceCall(id, parcelableConference); + mAdapter.setVideoProvider(id, conference.getVideoProvider()); + mAdapter.setVideoState(id, conference.getVideoState()); // Go through any child calls and set the parent. for (Connection connection : conference.getConnections()) { @@ -1146,14 +1168,14 @@ public abstract class ConnectionService extends Service { /** * Builds a list of {@link Connection} and {@link Conference} IDs based on the list of - * {@link IConferenceable}s passed in. + * {@link Conferenceable}s passed in. * - * @param conferenceables The {@link IConferenceable} connections and conferences. + * @param conferenceables The {@link Conferenceable} connections and conferences. * @return List of string conference and call Ids. */ - private List<String> createIdList(List<IConferenceable> conferenceables) { + private List<String> createIdList(List<Conferenceable> conferenceables) { List<String> ids = new ArrayList<>(); - for (IConferenceable c : conferenceables) { + for (Conferenceable c : conferenceables) { // Only allow Connection and Conference conferenceables. if (c instanceof Connection) { Connection connection = (Connection) c; |
