| java.lang.Object | ||
| ↳ | android.telecom.Conferenceable | |
| ↳ | android.telecom.Connection | |
Represents a phone call or connection to a remote endpoint that carries voice and/or video traffic.
 Implementations create a custom subclass of Connection and return it to the framework
 as the return value of
 onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)
 or
 onCreateOutgoingConnection(PhoneAccountHandle, ConnectionRequest).
 Implementations are then responsible for updating the state of the Connection, and
 must call destroy() to signal to the framework that the Connection is no
 longer used and associated resources may be recovered.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Connection.VideoProvider | Provides a means of controlling the video session associated with a Connection. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | CAPABILITY_CAN_PAUSE_VIDEO | For video calls, indicates whether the outgoing video for the call can be paused using
 the STATE_PAUSEDVideoState. | |||||||||
| int | CAPABILITY_CAN_UPGRADE_TO_VIDEO | Call can be upgraded to a video call. | |||||||||
| int | CAPABILITY_DISCONNECT_FROM_CONFERENCE | Connection is able to be individually disconnected when in a Conference. | |||||||||
| int | CAPABILITY_HOLD | Connection can currently be put on hold or unheld. | |||||||||
| int | CAPABILITY_MANAGE_CONFERENCE | Connection supports conference management. | |||||||||
| int | CAPABILITY_MERGE_CONFERENCE | Connections within a conference can be merged. | |||||||||
| int | CAPABILITY_MUTE | Connection can be muted. | |||||||||
| int | CAPABILITY_RESPOND_VIA_TEXT | Connection supports responding via text option. | |||||||||
| int | CAPABILITY_SEPARATE_FROM_CONFERENCE | Connection is able to be separated from its parent Conference, if any. | |||||||||
| int | CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL | Local device supports bidirectional video calling. | |||||||||
| int | CAPABILITY_SUPPORTS_VT_LOCAL_RX | Local device supports receiving video. | |||||||||
| int | CAPABILITY_SUPPORTS_VT_LOCAL_TX | Local device supports transmitting video. | |||||||||
| int | CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL | Remote device supports bidirectional video calling. | |||||||||
| int | CAPABILITY_SUPPORTS_VT_REMOTE_RX | Remote device supports receiving video. | |||||||||
| int | CAPABILITY_SUPPORTS_VT_REMOTE_TX | Remote device supports transmitting video. | |||||||||
| int | CAPABILITY_SUPPORT_HOLD | Connection supports the hold feature. | |||||||||
| int | CAPABILITY_SWAP_CONFERENCE | Connections within a conference can be swapped between foreground and background. | |||||||||
| String | EXTRA_CALL_SUBJECT | Connection extra key used to store the subject for an incoming call. | |||||||||
| String | EXTRA_CHILD_ADDRESS | Connection extra key used to store a child number associated with the current connection. | |||||||||
| String | EXTRA_LAST_FORWARDED_NUMBER | Connection extra key used to store the last forwarded number associated with the current connection. | |||||||||
| int | STATE_ACTIVE | A connection is active. | |||||||||
| int | STATE_DIALING | An outgoing connection is in the dialing state. | |||||||||
| int | STATE_DISCONNECTED | A connection has been disconnected. | |||||||||
| int | STATE_HOLDING | A connection is on hold. | |||||||||
| int | STATE_INITIALIZING | The connection is initializing. | |||||||||
| int | STATE_NEW | The connection is new and not connected. | |||||||||
| int | STATE_RINGING | An incoming connection is in the ringing state. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 
          Create a new Connection.
          
    
         | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 
          Return a  Connectionwhich represents a canceled connection attempt. | |||||||||||
| 
          Return a  Connectionwhich represents a failed connection attempt. | |||||||||||
| 
          Tears down the Connection object.
          
    
         | |||||||||||
| 
          Returns the connections or conferences with which this connection can be conferenced.
          
    
         | |||||||||||
| 
          Returns the connection's capabilities, as a bit mask of the  CAPABILITY_*constants. | |||||||||||
| 
          Returns whether this connection is requesting that the system play a ringback tone
 on its behalf.
          
    
         | |||||||||||
| 
          Notifies this Connection of a request to abort.
          
    
         | |||||||||||
| 
          Notifies this Connection, which is in  STATE_RINGING, of
 a request to accept. | |||||||||||
| 
          Notifies this Connection, which is in  STATE_RINGING, of
 a request to accept. | |||||||||||
| 
          Notifies this Connection that the  getCallAudioState()property has a new value. | |||||||||||
| 
          Notifies this Connection of a request to disconnect.
          
    
         | |||||||||||
| 
          Notifies this Connection of a request to hold.
          
    
         | |||||||||||
| 
          Notifies this Connection of a request to play a DTMF tone.
          
    
         | |||||||||||
| 
          Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes.
          
    
         | |||||||||||
| 
          Notifies this Connection, which is in  STATE_RINGING, of
 a request to reject. | |||||||||||
| 
          Notifies this Connection of a request to separate from its parent conference.
          
    
         | |||||||||||
| 
          Notifies this Connection of an internal state change.
          
    
         | |||||||||||
| 
          Notifies this Connection of a request to stop any currently playing DTMF tones.
          
    
         | |||||||||||
| 
          Notifies this Connection of a request to exit a hold state.
          
    
         | |||||||||||
| 
          Sets state to active (e.g., an ongoing connection where two or more parties can actively
 communicate).
          
    
         | |||||||||||
| 
          Sets the value of the  getAddress()property. | |||||||||||
| 
          Requests that the framework use VOIP audio mode for this connection.
          
    
         | |||||||||||
| 
          Sets the caller display name (CNAP).
          
    
         | |||||||||||
| 
          Sets the connections with which this connection can be conferenced.
          
    
         | |||||||||||
| 
          Similar to  setConferenceableConnections(java.util.List), sets a list of connections
 or conferences with which this connection can be conferenced. | |||||||||||
| 
          Sets the connection's capabilities as a bit mask of the  CAPABILITY_*constants. | |||||||||||
| 
          Sets state to dialing (e.g., dialing an outbound connection).
          
    
         | |||||||||||
| 
          Sets state to disconnected.
          
    
         | |||||||||||
| 
          Set some extras that can be associated with this  Connection. | |||||||||||
| 
          Sets state to initialized (the Connection has been set up and is now ready to be used).
          
    
         | |||||||||||
| 
          Sets state to initializing (this Connection is not yet ready to be used).
          
    
         | |||||||||||
| 
          Informs listeners that this  Connectionhas processed a character in the post-dial
 started state. | |||||||||||
| 
          Sets state to be on hold.
          
    
         | |||||||||||
| 
          Informs listeners that this  Connectionis in a post-dial wait state. | |||||||||||
| 
          Requests that the framework play a ringback tone.
          
    
         | |||||||||||
| 
          Sets state to ringing (e.g., an inbound ringing connection).
          
    
         | |||||||||||
| 
          Sets the label and icon status to display in the in-call UI.
          
    
         | |||||||||||
| 
          Sets the video connection provider.
          
    
         | |||||||||||
| 
          Set the video state for the connection.
          
    
         | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  java.lang.Object | |||||||||||
For video calls, indicates whether the outgoing video for the call can be paused using
 the STATE_PAUSED VideoState.
Call can be upgraded to a video call.
Connection is able to be individually disconnected when in a Conference.
Connection can currently be put on hold or unheld. This is distinct from
 CAPABILITY_SUPPORT_HOLD in that although a connection may support 'hold' most times,
 it does not at the moment support the function. This can be true while the call is in the
 state STATE_DIALING, for example. During this condition, an in-call UI may
 display a disabled 'hold' button.
Connection supports conference management. This capability only applies to
 Conferences which can have Connections as children.
Connections within a conference can be merged. A ConnectionService has the option to
 add a Conference before the child Connections are merged. This is how
 CDMA-based Connections are implemented. For these unmerged Conferences, this
 capability allows a merge button to be shown while the conference is in the foreground
 of the in-call UI.
 
 This is only intended for use by a Conference.
Connection can be muted.
Connection supports responding via text option.
Connection is able to be separated from its parent Conference, if any.
Local device supports bidirectional video calling.
Local device supports receiving video.
Local device supports transmitting video.
Remote device supports bidirectional video calling.
Remote device supports receiving video.
Remote device supports transmitting video.
Connection supports the hold feature.
Connections within a conference can be swapped between foreground and background.
 See CAPABILITY_MERGE_CONFERENCE for additional information.
 
 This is only intended for use by a Conference.
Connection extra key used to store the subject for an incoming call.  The user interface can
 query this extra and display its contents for incoming calls.  Will only be used if the
 PhoneAccount supports the capability CAPABILITY_CALL_SUBJECT.
Connection extra key used to store a child number associated with the current connection.
 Used to communicate to the user interface that the connection was received via
 a child address (i.e. phone number) associated with the PhoneAccount's primary
 address.
Connection extra key used to store the last forwarded number associated with the current connection. Used to communicate to the user interface that the connection was forwarded via the specified number.
A connection is active. Both parties are connected to the call and can actively communicate.
An outgoing connection is in the dialing state. In this state the other party has not yet answered the call and the user traditionally hears a ringback tone.
A connection has been disconnected. This is the final state once the user has been disconnected from a call either locally, remotely or by an error in the service.
A connection is on hold.
The connection is initializing. This is generally the first state for a Connection
 returned by a ConnectionService.
The connection is new and not connected.
An incoming connection is in the ringing state. During this state, the user's ringer or vibration feature will be activated.
Return a Connection which represents a canceled connection attempt. The returned
 Connection will have state STATE_DISCONNECTED, and cannot be moved out of
 that state. This connection should not be used for anything, and no other
 Connections should be attempted.
 
so users of this method need not maintain a reference to its return value to destroy it.
Connection which indicates that the underlying connection should
 be canceled.
Return a Connection which represents a failed connection attempt. The returned
 Connection will have a DisconnectCause and as specified,
 and a getState() of STATE_DISCONNECTED.
 
 The returned Connection can be assumed to destroy() itself when appropriate,
 so users of this method need not maintain a reference to its return value to destroy it.
| disconnectCause | The disconnect cause, (). | 
|---|
Connection which indicates failure.
TelecomManager for valid values.
null if this Connection
         does not directly know about its audio state.
TelecomManager for valid values.
Returns the connections or conferences with which this connection can be conferenced.
Returns the connection's capabilities, as a bit mask of the CAPABILITY_* constants.
DisconnectCause for this connection.
Returns whether this connection is requesting that the system play a ringback tone on its behalf.
Notifies this Connection, which is in STATE_RINGING, of
 a request to accept.
| videoState | The video state in which to answer the connection. | 
|---|
Notifies this Connection, which is in STATE_RINGING, of
 a request to accept.
Notifies this Connection that the getCallAudioState() property has a new value.
| state | The new connection audio state. | 
|---|
Notifies this Connection of a request to disconnect.
Notifies this Connection of a request to play a DTMF tone.
| c | A DTMF character. | 
|---|
Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes.
Notifies this Connection, which is in STATE_RINGING, of
 a request to reject.
Notifies this Connection of a request to separate from its parent conference.
Notifies this Connection of an internal state change. This method is called after the state is changed.
| state | The new state, one of the STATE_*constants. | 
|---|
Notifies this Connection of a request to stop any currently playing DTMF tones.
Notifies this Connection of a request to exit a hold state.
Sets state to active (e.g., an ongoing connection where two or more parties can actively communicate).
Sets the value of the getAddress() property.
| address | The new address. | 
|---|---|
| presentation | The presentation requirements for the address.
        See TelecomManagerfor valid values. | 
Requests that the framework use VOIP audio mode for this connection.
| isVoip | True if the audio mode is VOIP. | 
|---|
Sets the caller display name (CNAP).
| callerDisplayName | The new display name. | 
|---|---|
| presentation | The presentation requirements for the handle.
        See TelecomManagerfor valid values. | 
Sets the connections with which this connection can be conferenced.
| conferenceableConnections | The set of connections this connection can conference with. | 
|---|
Similar to setConferenceableConnections(java.util.List), sets a list of connections
 or conferences with which this connection can be conferenced.
| conferenceables | The conferenceables. | 
|---|
Sets the connection's capabilities as a bit mask of the CAPABILITY_* constants.
| connectionCapabilities | The new connection capabilities. | 
|---|
Sets state to dialing (e.g., dialing an outbound connection).
Sets state to disconnected.
| disconnectCause | The reason for the disconnection, as specified by DisconnectCause. | 
|---|
Set some extras that can be associated with this Connection. No assumptions should
 be made as to how an In-Call UI or service will handle these extras.
 Keys should be fully qualified (e.g., com.example.MY_EXTRA) to avoid conflicts.
| extras | The extras associated with this Connection. | 
|---|
Sets state to initialized (the Connection has been set up and is now ready to be used).
Sets state to initializing (this Connection is not yet ready to be used).
Informs listeners that this Connection has processed a character in the post-dial
 started state. This is done when (a) the Connection is issuing a DTMF sequence;
 and (b) it wishes to signal Telecom to play the corresponding DTMF tone locally.
| nextChar | The DTMF character that was just processed by the Connection. | 
|---|
Informs listeners that this Connection is in a post-dial wait state. This is done
 when (a) the Connection is issuing a DTMF sequence; (b) it has encountered a "wait"
 character; and (c) it wishes to inform the In-Call app that it is waiting for the end-user
 to send an onPostDialContinue(boolean) signal.
| remaining | The DTMF character sequence remaining to be emitted once the onPostDialContinue(boolean)is received, including any "wait" characters
         that remaining sequence may contain. | 
|---|
Requests that the framework play a ringback tone. This is to be invoked by implementations that do not play a ringback tone themselves in the connection's audio stream.
| ringback | Whether the ringback tone is to be played. | 
|---|
Sets state to ringing (e.g., an inbound ringing connection).
Sets the label and icon status to display in the in-call UI.
| statusHints | The status label and icon to set. | 
|---|
Sets the video connection provider.
| videoProvider | The video provider. | 
|---|
Set the video state for the connection.
 Valid values: STATE_AUDIO_ONLY,
 STATE_BIDIRECTIONAL,
 STATE_TX_ENABLED,
 STATE_RX_ENABLED.
| videoState | The new video state. | 
|---|
| state | An integer value of a STATE_*constant. | 
|---|