Home | History | Annotate | Download | only in telecom

Lines Matching refs:Connection

70  * should provide a new instance of a {@link Connection} object.  It is through this
71 * {@link Connection} object that telecom receives state updates and the {@code ConnectionService}
110 private static Connection sNullConnection;
112 private final Map<String, Connection> mConnectionById = new ConcurrentHashMap<>();
113 private final Map<Connection, String> mIdByConnection = new ConcurrentHashMap<>();
448 case Connection.STATE_ACTIVE:
451 case Connection.STATE_HOLDING:
454 case Connection.STATE_DISCONNECTED:
467 public void onConnectionAdded(Conference conference, Connection connection) {
471 public void onConnectionRemoved(Conference conference, Connection connection) {
476 Conference conference, List<Connection> conferenceableConnections) {
493 Connection.capabilitiesToString(connectionCapabilities));
503 Connection.propertiesToString(connectionProperties));
515 public void onVideoProviderChanged(Conference c, Connection.VideoProvider videoProvider) {
517 Log.d(this, "onVideoProviderChanged: Connection: %s, VideoProvider: %s", c,
547 private final Connection.Listener mConnectionListener = new Connection.Listener() {
549 public void onStateChanged(Connection c, int state) {
551 Log.d(this, "Adapter set state %s %s", id, Connection.stateToString(state));
553 case Connection.STATE_ACTIVE:
556 case Connection.STATE_DIALING:
559 case Connection.STATE_DISCONNECTED:
562 case Connection.STATE_HOLDING:
565 case Connection.STATE_NEW:
568 case Connection.STATE_RINGING:
575 public void onDisconnected(Connection c, DisconnectCause disconnectCause) {
582 public void onVideoStateChanged(Connection c, int videoState) {
589 public void onAddressChanged(Connection c, Uri address, int presentation) {
596 Connection c, String callerDisplayName, int presentation) {
602 public void onDestroyed(Connection c) {
607 public void onPostDialWait(Connection c, String remaining) {
614 public void onPostDialChar(Connection c, char nextChar) {
621 public void onRingbackRequested(Connection c, boolean ringback) {
628 public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {
631 Connection.capabilitiesToString(capabilities));
636 public void onConnectionPropertiesChanged(Connection c, int properties) {
639 Connection.propertiesToString(properties));
644 public void onVideoProviderChanged(Connection c, Connection.VideoProvider videoProvider) {
646 Log.d(this, "onVideoProviderChanged: Connection: %s, VideoProvider: %s", c,
652 public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {
658 public void onStatusHintsChanged(Connection c, StatusHints statusHints) {
665 Connection connection, List<Conferenceable> conferenceables) {
667 mIdByConnection.get(connection),
672 public void onConferenceChanged(Connection connection, Conference conference) {
673 String id = mIdByConnection.get(connection);
684 public void onConferenceMergeFailed(Connection connection) {
685 String id = mIdByConnection.get(connection);
692 public void onExtrasChanged(Connection c, Bundle extras) {
699 public void onExtrasRemoved(Connection c, List<String> keys) {
708 public void onConnectionEvent(Connection connection, String event, Bundle extras) {
709 String id = mIdByConnection.get(connection);
732 * createConnection util a connection service cancels the process or completes it successfully.
745 Connection connection = isUnknown ? onCreateUnknownConnection(callManagerAccount, request)
748 Log.d(this, "createConnection, connection: %s", connection);
749 if (connection == null) {
750 connection = Connection.createFailedConnection(
754 connection.setTelecomCallId(callId);
755 if (connection.getState() != Connection.STATE_DISCONNECTED) {
756 addConnection(callId, connection);
759 Uri address = connection.getAddress();
762 Connection.toLogSafePhoneNumber(number),
763 Connection.stateToString(connection.getState()),
764 Connection.capabilitiesToString(connection.getConnectionCapabilities()),
765 Connection.propertiesToString(connection.getConnectionProperties()));
773 connection.getState(),
774 connection.getConnectionCapabilities(),
775 connection.getConnectionProperties(),
776 connection.getAddress(),
777 connection.getAddressPresentation(),
778 connection.getCallerDisplayName(),
779 connection.getCallerDisplayNamePresentation(),
780 connection.getVideoProvider() == null ?
781 null : connection.getVideoProvider().getInterface(),
782 connection.getVideoState(),
783 connection.isRingbackRequested(),
784 connection.getAudioModeIsVoip(),
785 connection.getConnectTimeMillis(),
786 connection.getStatusHints(),
787 connection.getDisconnectCause(),
788 createIdList(connection.getConferenceables()),
789 connection.getExtras()));
884 // Attempt to get second connection or conference.
885 Connection connection2 = findConnectionForAction(callId2, "conference");
896 // Attempt to get first connection or conference and perform merge.
897 Connection connection1 = findConnectionForAction(callId1, "conference");
907 // Call 2 is a connection so merge via call 1 (conference).
917 // Call 1 is a connection.
922 // Call 2 is a connection, so merge together.
931 Connection connection = findConnectionForAction(callId, "splitFromConference");
932 if (connection == getNullConnection()) {
933 Log.w(this, "Connection missing in conference request %s.", callId);
937 Conference conference = connection.getConference();
939 conference.onSeparate(connection);
960 * Notifies a {@link Connection} of a request to pull an external call.
968 Connection connection = findConnectionForAction(callId, "pullExternalCall");
969 if (connection != null) {
970 connection.onPullExternalCall();
975 * Notifies a {@link Connection} of a call event.
985 Connection connection = findConnectionForAction(callId, "sendCallEvent");
986 if (connection != null) {
987 connection.onCallEvent(event, extras);
993 * Notifies a {@link Connection} or {@link Conference} of a change to the extras from Telecom.
1038 Log.d(this, "remote connection services found: " + services);
1064 * @return The {@code Connection} object to satisfy this call, or {@code null} to
1083 * @return The {@code Connection} object to satisfy this call, or {@code null} to
1111 * explicit request via {@link #onConference} or otherwise, the connection service should supply
1123 for (Connection connection : conference.getConnections()) {
1124 if (mIdByConnection.containsKey(connection)) {
1125 connectionIds.add(mIdByConnection.get(connection));
1147 for (Connection connection : conference.getConnections()) {
1148 String connectionId = mIdByConnection.get(connection);
1157 * Adds a connection created by the {@link ConnectionService} and informs telecom of the new
1158 * connection.
1160 * @param phoneAccountHandle The phone account handle for the connection.
1161 * @param connection The connection to add.
1164 Connection connection) {
1166 String id = addExistingConnectionInternal(phoneAccountHandle, connection);
1172 connection.getState(),
1173 connection.getConnectionCapabilities(),
1174 connection.getConnectionProperties(),
1175 connection.getAddress(),
1176 connection.getAddressPresentation(),
1177 connection.getCallerDisplayName(),
1178 connection.getCallerDisplayNamePresentation(),
1179 connection.getVideoProvider() == null ?
1180 null : connection.getVideoProvider().getInterface(),
1181 connection.getVideoState(),
1182 connection.isRingbackRequested(),
1183 connection.getAudioModeIsVoip(),
1184 connection.getConnectTimeMillis(),
1185 connection.getStatusHints(),
1186 connection.getDisconnectCause(),
1188 connection.getExtras());
1194 * Returns all the active {@code Connection}s for which this {@code ConnectionService}
1197 * @return A collection of {@code Connection}s created by this {@code ConnectionService}.
1199 public final Collection<Connection> getAllConnections() {
1214 * Create a {@code Connection} given an incoming request. This is used to attach to existing
1220 * @return The {@code Connection} object to satisfy this call, or {@code null} to
1223 public Connection onCreateIncomingConnection(
1231 * Connection is part of a conference controller but is not yet added to Connection
1240 * Create a {@code Connection} given an outgoing request. This is used to initiate new
1243 * @param connectionManagerPhoneAccount The connection manager account to use for managing
1251 * making the connection.
1254 * being asked to make a direct connection. The
1257 * making the connection.
1259 * @return The {@code Connection} object to satisfy this call, or the result of an invocation
1260 * of {@link Connection#createFailedConnection(DisconnectCause)} to not handle the call.
1262 public Connection onCreateOutgoingConnection(
1269 * Create a {@code Connection} for a new unknown call. An unknown call is a call originating
1280 public Connection onCreateUnknownConnection(PhoneAccountHandle connectionManagerPhoneAccount,
1287 * specified connections into a conference call. In response, the connection service should
1290 * @param connection1 A connection to merge into a conference call.
1291 * @param connection2 A connection to merge into a conference call.
1293 public void onConference(Connection connection1, Connection connection2) {}
1308 * Called when an existing connection is added remotely.
1309 * @param connection The existing connection which was added.
1311 public void onRemoteExistingConnectionAdded(RemoteConnection connection) {}
1339 * Adds an existing connection to the list of connections, identified by a new call ID unique
1340 * to this connection service.
1342 * @param connection The connection.
1343 * @return The ID of the connection (e.g. the call-id).
1345 private String addExistingConnectionInternal(PhoneAccountHandle handle, Connection connection) {
1356 addConnection(id, connection);
1360 private void addConnection(String callId, Connection connection) {
1361 connection.setTelecomCallId(callId);
1362 mConnectionById.put(callId, connection);
1363 mIdByConnection.put(connection, callId);
1364 connection.addConnectionListener(mConnectionListener);
1365 connection.setConnectionService(this);
1369 protected void removeConnection(Connection connection) {
1370 connection.unsetConnectionService(this);
1371 connection.removeConnectionListener(mConnectionListener);
1372 String id = mIdByConnection.get(connection);
1375 mIdByConnection.remove(connection);
1408 private Connection findConnectionForAction(String callId, String action) {
1412 Log.w(this, "%s - Cannot find Connection %s", action, callId);
1416 static synchronized Connection getNullConnection() {
1418 sNullConnection = new Connection() {};
1431 private List<String> createConnectionIdList(List<Connection> connections) {
1433 for (Connection c : connections) {
1443 * Builds a list of {@link Connection} and {@link Conference} IDs based on the list of
1452 // Only allow Connection and Conference conferenceables.
1453 if (c instanceof Connection) {
1454 Connection connection = (Connection) c;
1455 if (mIdByConnection.containsKey(connection)) {
1456 ids.add(mIdByConnection.get(connection));
1478 for (Connection connection : mIdByConnection.keySet()) {
1480 if (connection.getConference() == null) {
1481 connection.onDisconnect();
1490 * Retrieves the next call ID as maintainted by the connection service.