Connection
abstract class Connection : Conferenceable
kotlin.Any | ||
↳ | 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 ConnectionService.onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)
or ConnectionService.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.
Subclasses of Connection
override the on*
methods to provide the ConnectionService
's implementation of calling functionality. The on*
methods are called by Telecom to inform an instance of a Connection
of actions specific to that Connection
instance.
Basic call support requires overriding the following methods: onAnswer()
, onDisconnect()
, onReject()
, onAbort()
Where a Connection
has CAPABILITY_SUPPORT_HOLD
, the onHold()
and onUnhold()
methods should be overridden to provide hold support for the Connection
.
Where a Connection
supports a variation of video calling (e.g. the CAPABILITY_SUPPORTS_VT_*
capability bits), onAnswer(int)
should be overridden to support answering a call as a video call.
Where a Connection
has PROPERTY_IS_EXTERNAL_CALL
and CAPABILITY_CAN_PULL_CALL
, onPullExternalCall()
should be overridden to provide support for pulling the external call.
Where a Connection
supports conference calling onSeparate()
should be overridden.
There are a number of other on*
methods which a Connection
can choose to implement, depending on whether it is concerned with the associated calls from Telecom. If, for example, call events from a InCallService
are handled, onCallEvent(java.lang.String,android.os.Bundle)
should be overridden. Another example is onExtrasChanged(android.os.Bundle)
, which should be overridden if the Connection
wishes to make use of extra information provided via the Call.putExtras(Bundle)
and Call.removeExtras(String...)
methods.
Summary
Nested classes | |
---|---|
Provides constants to represent the results of responses to session modify requests sent via |
|
Provides methods to read and write RTT data to/from the in-call app. |
|
abstract |
Provides a means of controlling the video session associated with a |
Constants | |
---|---|
static Int |
Adaptive Multi-rate audio codec. |
static Int |
Adaptive Multi-rate wideband audio codec. |
static Int |
Enhanced Variable Rate Codec. |
static Int |
Enhanced Variable Rate Codec B. |
static Int |
Enhanced Variable Rate Narrowband-Wideband Codec. |
static Int |
Enhanced Variable Rate Wideband Codec. |
static Int |
Enhanced Voice Services Fullband audio codec. |
static Int |
Enhanced Voice Services Narrowband audio codec. |
static Int |
Enhanced Voice Services Super-Wideband audio codec. |
static Int |
Enhanced Voice Services Wideband audio codec. |
static Int |
ITU-T G711A audio codec. |
static Int |
ITU-T G711AB audio codec. |
static Int |
ITU-T G711U audio codec. |
static Int |
ITU-T G722 audio codec. |
static Int |
ITU-T G723 audio codec. |
static Int |
ITU-T G729 audio codec. |
static Int |
GSM Enhanced Full-Rate audio codec, also known as GSM-EFR, GSM 06. |
static Int |
GSM Full-Rate audio codec, also known as GSM-FR, GSM 06. |
static Int |
GSM Half Rate audio codec. |
static Int |
Indicates that the audio codec is currently not specified or is unknown. |
static Int |
Qualcomm code-excited linear prediction 13 kilobit audio codec. |
static Int |
When set, indicates that this |
static Int |
When set, prevents a video call from being downgraded to an audio-only call. |
static Int |
For video calls, indicates whether the outgoing video for the call can be paused using the |
static Int |
When set for an external connection, indicates that this |
static Int |
Indicates that the connection itself wants to handle any sort of reply response, rather than relying on SMS. |
static Int |
Call can be upgraded to a video call. |
static Int |
Connection is able to be individually disconnected when in a |
static Int |
Connection can currently be put on hold or unheld. |
static Int |
Connection supports conference management. |
static Int |
Connections within a conference can be merged. |
static Int |
Connection can be muted. |
static Int |
Indicates whether the remote party supports RTT or not to the UI. |
static Int |
Connection supports responding via text option. |
static Int |
Connection is able to be separated from its parent |
static Int |
Local device supports bidirectional video calling. |
static Int |
Local device supports receiving video. |
static Int |
Local device supports transmitting video. |
static Int |
Remote device supports bidirectional video calling. |
static Int |
Remote device supports receiving video. |
static Int |
Remote device supports transmitting video. |
static Int |
Call supports the deflect feature. |
static Int |
Connection supports the hold feature. |
static Int |
Connections within a conference can be swapped between foreground and background. |
static String |
Connection event used to inform Telecom when a hold operation on a call has failed. |
static String |
Connection event used to inform |
static String |
Connection event used to inform |
static String |
Connection event used to inform |
static String |
Connection event used to inform |
static String |
Connection event used to inform Telecom when a switch operation on a call has failed. |
static String |
Connection event used to inform |
static String |
Connection event used to inform |
static String |
Connection event used to inform Telecom that it should stop the on hold tone. |
static String |
Connection event used to inform Telecom that it should play the on hold tone. |
static String |
Connection event used to inform an |
static String |
Boolean connection extra key set on a |
static String |
String connection extra key set on a |
static String |
The audio codec in use for the current |
static String |
Float connection extra key used to store the audio codec bandwidth in khz for the current |
static String |
Float connection extra key used to store the audio codec bitrate in kbps for the current |
static String |
Connection extra key used to store the subject for an incoming call. |
static String |
Connection extra key used to store a child number associated with the current connection. |
static String |
Boolean connection extra key set on the extras passed to |
static String |
Connection extra key used to store the last forwarded number associated with the current connection. |
static String |
Last known cell identity key |
static String |
String Connection extra key used to store SIP invite fields for an incoming call for IMS call |
static Int |
Set by the framework to indicate that a connection is using assisted dialing. |
static Int |
Connection is using cross sim technology. |
static Int |
Indicates that the connection has CDMA Enhanced Voice Privacy enabled. |
static Int |
Connection is using high definition audio. |
static Int |
Set by the framework to indicate that a call is an adhoc conference call. |
static Int |
When set, indicates that the |
static Int |
Set by the framework to indicate that a connection has an active RTT session associated with it. |
static Int |
Set by the framework to indicate that the network has identified a Connection as an emergency call. |
static Int |
Set by the framework to indicate that the |
static Int |
Connection is using WIFI. |
static Int |
A connection is active. |
static Int |
An outgoing connection is in the dialing state. |
static Int |
A connection has been disconnected. |
static Int |
A connection is on hold. |
static Int |
The connection is initializing. |
static Int |
The connection is new and not connected. |
static Int |
The state of an external connection which is in the process of being pulled from a remote device to the local device. |
static Int |
An incoming connection is in the ringing state. |
static Int |
Indicates that verification by the network failed. |
static Int |
Indicates that the network could not perform verification. |
static Int |
Indicates that verification by the network passed. |
Public constructors | |
---|---|
Create a new Connection. |
Public methods | |
---|---|
open static String! |
capabilitiesToString(capabilities: Int) Renders a set of capability bits ( |
open static Connection! |
Return a |
open static Connection! |
createFailedConnection(disconnectCause: DisconnectCause!) Return a |
Unit |
destroy() Tears down the Connection object. |
Uri! | |
Int | |
Boolean | |
CallAudioState! | |
String! | |
Int | |
Int |
Gets the verification status for the phone number of an incoming call as identified in ATIS-1000082. |
Conference! | |
MutableList<Conferenceable!>! |
Returns the connections or conferences with which this connection can be conferenced. |
Int |
Returns the connection's capabilities, as a bit mask of the |
Int |
Returns the connection's properties, as a bit mask of the |
CallEndpoint |
Obtains the current CallEndpoint. |
DisconnectCause! | |
Bundle! |
Returns the extras associated with this connection. |
Int |
getState() |
StatusHints! | |
Connection.VideoProvider! | |
Int |
Returns the video state of the connection. |
open Unit |
handleRttUpgradeResponse(rttTextStream: Connection.RttTextStream?) Notifies this connection of a response to a previous remotely-initiated RTT upgrade request sent via |
Boolean |
Returns whether this connection is requesting that the system play a ringback tone on its behalf. |
Unit |
Called by a |
open Unit |
onAbort() Notifies this Connection of a request to abort. |
open Unit |
onAddConferenceParticipants(participants: MutableList<Uri!>) Supports initiation of a conference call by directly adding participants to an ongoing call. |
open Unit |
onAnswer() Notifies this Connection, which is in |
open Unit |
Notifies this Connection, which is in |
open Unit |
onAvailableCallEndpointsChanged(availableEndpoints: MutableList<CallEndpoint!>) Notifies this Connection that the available call endpoints have been changed. |
open Unit |
onCallAudioStateChanged(state: CallAudioState!) Notifies this Connection that the |
open Unit |
onCallEndpointChanged(callEndpoint: CallEndpoint) Notifies this Connection that the audio endpoint has been changed. |
open Unit |
onCallEvent(event: String!, extras: Bundle!) Notifies this Connection of a |
open Unit |
Notifies this Connection, which is in |
open Unit |
Notifies this Connection of a request to disconnect. |
open Unit |
onExtrasChanged(extras: Bundle!) Notifies this |
open Unit |
Notifies this |
open Unit |
onHold() Notifies this Connection of a request to hold. |
open Unit |
onMuteStateChanged(isMuted: Boolean) Notifies this Connection that its audio mute state has been changed. |
open Unit |
onPlayDtmfTone(c: Char) Notifies this Connection of a request to play a DTMF tone. |
open Unit |
onPostDialContinue(proceed: Boolean) Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes. |
open Unit |
Notifies this Connection of a request to pull an external call to the local device. |
open Unit |
onReject() Notifies this Connection, which is in |
open Unit |
Notifies this Connection, which is in |
open Unit |
Notifies this Connection, which is in |
open Unit |
Notifies this Connection of a request to separate from its parent conference. |
open Unit |
Notifies this |
open Unit |
Notifies this Connection of a request to silence the ringer. |
open Unit |
onStartRtt(rttTextStream: Connection.RttTextStream) Notifies this |
open Unit |
onStateChanged(state: Int) Notifies this Connection of an internal state change. |
open Unit |
Notifies this Connection of a request to stop any currently playing DTMF tones. |
open Unit |
Notifies this |
open Unit |
onTrackedByNonUiService(isTracked: Boolean) Inform this Conenection when it will or will not be tracked by an non-UI |
open Unit |
onUnhold() Notifies this Connection of a request to exit a hold state. |
open Unit |
onUsingAlternativeUi(isUsingAlternativeUi: Boolean) Inform this Connection when it will or will not be tracked by an |
open static String! |
propertiesToString(properties: Int) Renders a set of property bits ( |
Unit |
Adds some extras to this |
Unit |
queryLocationForEmergency(timeoutMillis: Long, provider: String, executor: Executor, callback: OutcomeReceiver<Location!, QueryLocationException!>) Query the device's location in order to place an Emergency Call. |
Unit |
removeExtras(vararg keys: String!) Removes extras from this |
Unit |
removeExtras(keys: MutableList<String!>!) Removes extras from this |
open Unit |
requestBluetoothAudio(bluetoothDevice: BluetoothDevice) Request audio routing to a specific bluetooth device. |
Unit |
requestCallEndpointChange(endpoint: CallEndpoint, executor: Executor, callback: OutcomeReceiver<Void!, CallEndpointException!>) Request audio routing to a specific CallEndpoint. |
open Unit |
sendConnectionEvent(event: String!, extras: Bundle!) Sends an event associated with this |
Unit |
Informs listeners that the remote side of the call has requested an upgrade to include an RTT session in the call. |
Unit |
sendRttInitiationFailure(reason: Int) Informs listeners that a previously requested RTT session via |
Unit |
Informs listeners that a previously requested RTT session via |
Unit |
Informs listeners that a currently active RTT session has been terminated by the remote side of the coll. |
Unit |
Sets state to active (e.g., an ongoing connection where two or more parties can actively communicate). |
Unit |
setAddress(address: Uri!, presentation: Int) Sets the value of the |
Unit |
setAudioModeIsVoip(isVoip: Boolean) Requests that the framework use VOIP audio mode for this connection. |
Unit |
setAudioRoute(route: Int) Sets the audio route (speaker, bluetooth, etc...). |
Unit |
setCallerDisplayName(callerDisplayName: String!, presentation: Int) Sets the caller display name (CNAP). |
Unit |
setCallerNumberVerificationStatus(callerNumberVerificationStatus: Int) Sets the verification status for the phone number of an incoming call as identified in ATIS-1000082. |
Unit |
setConferenceableConnections(conferenceableConnections: MutableList<Connection!>!) Sets the connections with which this connection can be conferenced. |
Unit |
setConferenceables(conferenceables: MutableList<Conferenceable!>!) Similar to |
Unit |
setConnectionCapabilities(connectionCapabilities: Int) Sets the connection's capabilities as a bit mask of the |
Unit |
setConnectionProperties(connectionProperties: Int) Sets the connection's properties as a bit mask of the |
Unit |
Sets state to dialing (e.g., dialing an outbound connection). |
Unit |
setDisconnected(disconnectCause: DisconnectCause!) Sets state to disconnected. |
Unit |
Set some extras that can be associated with this |
Unit |
Sets state to initialized (the Connection has been set up and is now ready to be used). |
Unit |
Sets state to initializing (this Connection is not yet ready to be used). |
Unit |
setNextPostDialChar(nextChar: Char) Informs listeners that this |
Unit |
Sets state to be on hold. |
Unit |
setPostDialWait(remaining: String!) Informs listeners that this |
Unit |
Sets state to pulling (e.g. the connection is being pulled to the local device from another device). |
Unit |
setRingbackRequested(ringback: Boolean) Requests that the framework play a ringback tone. |
Unit |
Sets state to ringing (e.g., an inbound ringing connection). |
Unit |
setStatusHints(statusHints: StatusHints!) Sets the label and icon status to display in the in-call UI. |
Unit |
setVideoProvider(videoProvider: Connection.VideoProvider!) Sets the video connection provider. |
Unit |
setVideoState(videoState: Int) Set the video state for the connection. |
open static String! |
stateToString(state: Int) |
Constants
AUDIO_CODEC_AMR
static val AUDIO_CODEC_AMR: Int
Adaptive Multi-rate audio codec.
Value: 1
AUDIO_CODEC_AMR_WB
static val AUDIO_CODEC_AMR_WB: Int
Adaptive Multi-rate wideband audio codec.
Value: 2
AUDIO_CODEC_EVRC
static val AUDIO_CODEC_EVRC: Int
Enhanced Variable Rate Codec. See 3GPP2 C.S0014-A.
Value: 4
AUDIO_CODEC_EVRC_B
static val AUDIO_CODEC_EVRC_B: Int
Enhanced Variable Rate Codec B. Commonly used on CDMA networks.
Value: 5
AUDIO_CODEC_EVRC_NW
static val AUDIO_CODEC_EVRC_NW: Int
Enhanced Variable Rate Narrowband-Wideband Codec.
Value: 7
AUDIO_CODEC_EVRC_WB
static val AUDIO_CODEC_EVRC_WB: Int
Enhanced Variable Rate Wideband Codec. See RFC5188.
Value: 6
AUDIO_CODEC_EVS_FB
static val AUDIO_CODEC_EVS_FB: Int
Enhanced Voice Services Fullband audio codec. See 3GPP TS 26.441.
Value: 20
AUDIO_CODEC_EVS_NB
static val AUDIO_CODEC_EVS_NB: Int
Enhanced Voice Services Narrowband audio codec. See 3GPP TS 26.441.
Value: 17
AUDIO_CODEC_EVS_SWB
static val AUDIO_CODEC_EVS_SWB: Int
Enhanced Voice Services Super-Wideband audio codec. See 3GPP TS 26.441.
Value: 19
AUDIO_CODEC_EVS_WB
static val AUDIO_CODEC_EVS_WB: Int
Enhanced Voice Services Wideband audio codec. See 3GPP TS 26.441.
Value: 18
AUDIO_CODEC_G711A
static val AUDIO_CODEC_G711A: Int
ITU-T G711A audio codec.
Value: 13
AUDIO_CODEC_G711AB
static val AUDIO_CODEC_G711AB: Int
ITU-T G711AB audio codec.
Value: 15
AUDIO_CODEC_G711U
static val AUDIO_CODEC_G711U: Int
ITU-T G711U audio codec.
Value: 11
AUDIO_CODEC_G722
static val AUDIO_CODEC_G722: Int
ITU-T G722 audio codec.
Value: 14
AUDIO_CODEC_G723
static val AUDIO_CODEC_G723: Int
ITU-T G723 audio codec.
Value: 12
AUDIO_CODEC_G729
static val AUDIO_CODEC_G729: Int
ITU-T G729 audio codec.
Value: 16
AUDIO_CODEC_GSM_EFR
static val AUDIO_CODEC_GSM_EFR: Int
GSM Enhanced Full-Rate audio codec, also known as GSM-EFR, GSM 06.60, or simply EFR.
Value: 8
AUDIO_CODEC_GSM_FR
static val AUDIO_CODEC_GSM_FR: Int
GSM Full-Rate audio codec, also known as GSM-FR, GSM 06.10, GSM, or simply FR.
Value: 9
AUDIO_CODEC_GSM_HR
static val AUDIO_CODEC_GSM_HR: Int
GSM Half Rate audio codec.
Value: 10
AUDIO_CODEC_NONE
static val AUDIO_CODEC_NONE: Int
Indicates that the audio codec is currently not specified or is unknown.
Value: 0
AUDIO_CODEC_QCELP13K
static val AUDIO_CODEC_QCELP13K: Int
Qualcomm code-excited linear prediction 13 kilobit audio codec.
Value: 3
CAPABILITY_ADD_PARTICIPANT
static val CAPABILITY_ADD_PARTICIPANT: Int
When set, indicates that this Connection
supports initiation of a conference call by directly adding participants using onAddConferenceParticipants(java.util.List)
. When participants are added to a Connection
, it will be replaced by a Conference
instance with PROPERTY_IS_ADHOC_CONFERENCE
set to indicate that it is an adhoc conference call.
Value: 67108864
CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO
static val CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO: Int
When set, prevents a video call from being downgraded to an audio-only call.
Should be set when the VideoState has the VideoProfile.STATE_TX_ENABLED
or VideoProfile.STATE_RX_ENABLED
bits set to indicate that the connection cannot be downgraded from a video call back to a VideoState of VideoProfile.STATE_AUDIO_ONLY
.
Intuitively, a call which can be downgraded to audio should also have local and remote video capabilities (see CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL
and CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL
).
Value: 8388608
CAPABILITY_CAN_PAUSE_VIDEO
static val CAPABILITY_CAN_PAUSE_VIDEO: Int
For video calls, indicates whether the outgoing video for the call can be paused using the android.telecom.VideoProfile#STATE_PAUSED
VideoState.
Value: 1048576
CAPABILITY_CAN_PULL_CALL
static val CAPABILITY_CAN_PULL_CALL: Int
When set for an external connection, indicates that this Connection
can be pulled from a remote device to the current device.
Should only be set on a Connection
where PROPERTY_IS_EXTERNAL_CALL
is set.
Value: 16777216
CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION
static val CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION: Int
Indicates that the connection itself wants to handle any sort of reply response, rather than relying on SMS.
Value: 4194304
CAPABILITY_CAN_UPGRADE_TO_VIDEO
static valCAPABILITY_CAN_UPGRADE_TO_VIDEO: Int
Deprecated: Use CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL
and CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL
to indicate for a call whether or not video calling is supported.
Call can be upgraded to a video call.
Value: 524288
CAPABILITY_DISCONNECT_FROM_CONFERENCE
static val CAPABILITY_DISCONNECT_FROM_CONFERENCE: Int
Connection is able to be individually disconnected when in a Conference
.
Value: 8192
CAPABILITY_HOLD
static val CAPABILITY_HOLD: Int
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.
Value: 1
CAPABILITY_MANAGE_CONFERENCE
static val CAPABILITY_MANAGE_CONFERENCE: Int
Connection supports conference management. This capability only applies to Conference
s which can have Connection
s as children.
Value: 128
CAPABILITY_MERGE_CONFERENCE
static val CAPABILITY_MERGE_CONFERENCE: Int
Connections within a conference can be merged. A ConnectionService
has the option to add a Conference
before the child Connection
s are merged. This is how CDMA-based Connection
s are implemented. For these unmerged Conference
s, 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
.
Value: 4
CAPABILITY_MUTE
static val CAPABILITY_MUTE: Int
Connection can be muted.
Value: 64
CAPABILITY_REMOTE_PARTY_SUPPORTS_RTT
static val CAPABILITY_REMOTE_PARTY_SUPPORTS_RTT: Int
Indicates whether the remote party supports RTT or not to the UI.
Value: 536870912
CAPABILITY_RESPOND_VIA_TEXT
static val CAPABILITY_RESPOND_VIA_TEXT: Int
Connection supports responding via text option.
Value: 32
CAPABILITY_SEPARATE_FROM_CONFERENCE
static val CAPABILITY_SEPARATE_FROM_CONFERENCE: Int
Connection is able to be separated from its parent Conference
, if any.
Value: 4096
CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL
static val CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL: Int
Local device supports bidirectional video calling.
Value: 768
CAPABILITY_SUPPORTS_VT_LOCAL_RX
static val CAPABILITY_SUPPORTS_VT_LOCAL_RX: Int
Local device supports receiving video.
Value: 256
CAPABILITY_SUPPORTS_VT_LOCAL_TX
static val CAPABILITY_SUPPORTS_VT_LOCAL_TX: Int
Local device supports transmitting video.
Value: 512
CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL
static val CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL: Int
Remote device supports bidirectional video calling.
Value: 3072
CAPABILITY_SUPPORTS_VT_REMOTE_RX
static val CAPABILITY_SUPPORTS_VT_REMOTE_RX: Int
Remote device supports receiving video.
Value: 1024
CAPABILITY_SUPPORTS_VT_REMOTE_TX
static val CAPABILITY_SUPPORTS_VT_REMOTE_TX: Int
Remote device supports transmitting video.
Value: 2048
CAPABILITY_SUPPORT_DEFLECT
static val CAPABILITY_SUPPORT_DEFLECT: Int
Call supports the deflect feature.
Value: 33554432
CAPABILITY_SUPPORT_HOLD
static val CAPABILITY_SUPPORT_HOLD: Int
Connection supports the hold feature.
Value: 2
CAPABILITY_SWAP_CONFERENCE
static val CAPABILITY_SWAP_CONFERENCE: Int
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
.
Value: 8
EVENT_CALL_HOLD_FAILED
static val EVENT_CALL_HOLD_FAILED: String
Connection event used to inform Telecom when a hold operation on a call has failed.
Sent via sendConnectionEvent(java.lang.String,android.os.Bundle)
. The Bundle
parameter is expected to be null when this connection event is used.
Value: "android.telecom.event.CALL_HOLD_FAILED"
EVENT_CALL_MERGE_FAILED
static val EVENT_CALL_MERGE_FAILED: String
Connection event used to inform InCallService
s when the merging of two calls has failed. The User Interface should use this message to inform the user of the error.
Sent via sendConnectionEvent(java.lang.String,android.os.Bundle)
. The Bundle
parameter is expected to be null when this connection event is used.
Value: "android.telecom.event.CALL_MERGE_FAILED"
EVENT_CALL_PULL_FAILED
static val EVENT_CALL_PULL_FAILED: String
Connection event used to inform InCallService
s when pulling of an external call has failed. The user interface should inform the user of the error.
Expected to be used by the ConnectionService
when the Call.pullExternalCall()
API is called on a Call
with the properties Call.Details.PROPERTY_IS_EXTERNAL_CALL
and Call.Details.CAPABILITY_CAN_PULL_CALL
, but the ConnectionService
could not pull the external call due to an error condition.
Sent via sendConnectionEvent(java.lang.String,android.os.Bundle)
. The Bundle
parameter is expected to be null when this connection event is used.
Value: "android.telecom.event.CALL_PULL_FAILED"
EVENT_CALL_REMOTELY_HELD
static val EVENT_CALL_REMOTELY_HELD: String
Connection event used to inform InCallService
s when a call has been put on hold by the remote party.
This is different than the Connection.STATE_HOLDING
state which indicates that the call is being held locally on the device. When a capable ConnectionService
receives signalling to indicate that the remote party has put the call on hold, it can send this connection event.
Value: "android.telecom.event.CALL_REMOTELY_HELD"
EVENT_CALL_REMOTELY_UNHELD
static val EVENT_CALL_REMOTELY_UNHELD: String
Connection event used to inform InCallService
s when a call which was remotely held (see EVENT_CALL_REMOTELY_HELD
) has been un-held by the remote party.
This is different than the Connection.STATE_HOLDING
state which indicates that the call is being held locally on the device. When a capable ConnectionService
receives signalling to indicate that the remote party has taken the call off hold, it can send this connection event.
Value: "android.telecom.event.CALL_REMOTELY_UNHELD"
EVENT_CALL_SWITCH_FAILED
static val EVENT_CALL_SWITCH_FAILED: String
Connection event used to inform Telecom when a switch operation on a call has failed.
Sent via sendConnectionEvent(java.lang.String,android.os.Bundle)
. The Bundle
parameter is expected to be null when this connection event is used.
Value: "android.telecom.event.CALL_SWITCH_FAILED"
EVENT_MERGE_COMPLETE
static val EVENT_MERGE_COMPLETE: String
Connection event used to inform InCallService
s when the process of merging a Connection into a conference has completed.
Sent via sendConnectionEvent(java.lang.String,android.os.Bundle)
. The Bundle
parameter is expected to be null when this connection event is used.
Value: "android.telecom.event.MERGE_COMPLETE"
EVENT_MERGE_START
static val EVENT_MERGE_START: String
Connection event used to inform InCallService
s when the process of merging a Connection into a conference has begun.
Sent via sendConnectionEvent(java.lang.String,android.os.Bundle)
. The Bundle
parameter is expected to be null when this connection event is used.
Value: "android.telecom.event.MERGE_START"
EVENT_ON_HOLD_TONE_END
static val EVENT_ON_HOLD_TONE_END: String
Connection event used to inform Telecom that it should stop the on hold tone. This is used to stop a tone when the peer puts the current call on hold. Sent to Telecom via sendConnectionEvent(java.lang.String,android.os.Bundle)
.
Value: "android.telecom.event.ON_HOLD_TONE_END"
EVENT_ON_HOLD_TONE_START
static val EVENT_ON_HOLD_TONE_START: String
Connection event used to inform Telecom that it should play the on hold tone. This is used to play a tone when the peer puts the current call on hold. Sent to Telecom via sendConnectionEvent(java.lang.String,android.os.Bundle)
.
Value: "android.telecom.event.ON_HOLD_TONE_START"
EVENT_RTT_AUDIO_INDICATION_CHANGED
static val EVENT_RTT_AUDIO_INDICATION_CHANGED: String
Connection event used to inform an InCallService
that the RTT audio indication has changed.
Value: "android.telecom.event.RTT_AUDIO_INDICATION_CHANGED"
EXTRA_ANSWERING_DROPS_FG_CALL
static val EXTRA_ANSWERING_DROPS_FG_CALL: String
Boolean connection extra key set on a Connection
in Connection.STATE_RINGING
state to indicate that answering the call will cause the current active foreground call to be dropped.
Value: "android.telecom.extra.ANSWERING_DROPS_FG_CALL"
EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME
static val EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME: String
String connection extra key set on a Connection
in Connection.STATE_RINGING
state to indicate the name of the third-party app which is responsible for the current foreground call.
Used when EXTRA_ANSWERING_DROPS_FG_CALL
is true to ensure that the default Phone app is able to inform the user that answering the new incoming call will cause a call owned by another app to be dropped when the incoming call is answered.
Value: "android.telecom.extra.ANSWERING_DROPS_FG_CALL_APP_NAME"
EXTRA_AUDIO_CODEC
static val EXTRA_AUDIO_CODEC: String
The audio codec in use for the current Connection
, if known. Examples of valid values include AUDIO_CODEC_AMR_WB
and AUDIO_CODEC_EVS_WB
.
Value is android.telecom.Connection#AUDIO_CODEC_NONE
, android.telecom.Connection#AUDIO_CODEC_AMR
, android.telecom.Connection#AUDIO_CODEC_AMR_WB
, android.telecom.Connection#AUDIO_CODEC_QCELP13K
, android.telecom.Connection#AUDIO_CODEC_EVRC
, android.telecom.Connection#AUDIO_CODEC_EVRC_B
, android.telecom.Connection#AUDIO_CODEC_EVRC_WB
, android.telecom.Connection#AUDIO_CODEC_EVRC_NW
, android.telecom.Connection#AUDIO_CODEC_GSM_EFR
, android.telecom.Connection#AUDIO_CODEC_GSM_FR
, android.telecom.Connection#AUDIO_CODEC_GSM_HR
, android.telecom.Connection#AUDIO_CODEC_G711U
, android.telecom.Connection#AUDIO_CODEC_G723
, android.telecom.Connection#AUDIO_CODEC_G711A
, android.telecom.Connection#AUDIO_CODEC_G722
, android.telecom.Connection#AUDIO_CODEC_G711AB
, android.telecom.Connection#AUDIO_CODEC_G729
, android.telecom.Connection#AUDIO_CODEC_EVS_NB
, android.telecom.Connection#AUDIO_CODEC_EVS_SWB
, or android.telecom.Connection#AUDIO_CODEC_EVS_FB
Value: "android.telecom.extra.AUDIO_CODEC"
EXTRA_AUDIO_CODEC_BANDWIDTH_KHZ
static val EXTRA_AUDIO_CODEC_BANDWIDTH_KHZ: String
Float connection extra key used to store the audio codec bandwidth in khz for the current Connection
.
Value: "android.telecom.extra.AUDIO_CODEC_BANDWIDTH_KHZ"
EXTRA_AUDIO_CODEC_BITRATE_KBPS
static val EXTRA_AUDIO_CODEC_BITRATE_KBPS: String
Float connection extra key used to store the audio codec bitrate in kbps for the current Connection
.
Value: "android.telecom.extra.AUDIO_CODEC_BITRATE_KBPS"
EXTRA_CALL_SUBJECT
static val EXTRA_CALL_SUBJECT: String
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 PhoneAccount.CAPABILITY_CALL_SUBJECT
.
Value: "android.telecom.extra.CALL_SUBJECT"
EXTRA_CHILD_ADDRESS
static val EXTRA_CHILD_ADDRESS: String
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.
Value: "android.telecom.extra.CHILD_ADDRESS"
EXTRA_IS_RTT_AUDIO_PRESENT
static val EXTRA_IS_RTT_AUDIO_PRESENT: String
Boolean connection extra key set on the extras passed to Connection.sendConnectionEvent
which indicates that audio is present on the RTT call when the extra value is true.
Value: "android.telecom.extra.IS_RTT_AUDIO_PRESENT"
EXTRA_LAST_FORWARDED_NUMBER
static val EXTRA_LAST_FORWARDED_NUMBER: String
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.
Value: "android.telecom.extra.LAST_FORWARDED_NUMBER"
EXTRA_LAST_KNOWN_CELL_IDENTITY
static val EXTRA_LAST_KNOWN_CELL_IDENTITY: String
Last known cell identity key CellIdentity
to be used to fill geo location header in case of an emergency call. This entry will not be filled if call is not identified as an emergency call. Only provided to the ConnectionService
for the purpose of placing an emergency call; will not be present in the InCallService
layer. The ConnectionService
's implementation will be logged for fine location access when an outgoing call is placed in this case.
Value: "android.telecom.extra.LAST_KNOWN_CELL_IDENTITY"
EXTRA_SIP_INVITE
static val EXTRA_SIP_INVITE: String
String Connection extra key used to store SIP invite fields for an incoming call for IMS call
Value: "android.telecom.extra.SIP_INVITE"
PROPERTY_ASSISTED_DIALING
static val PROPERTY_ASSISTED_DIALING: Int
Set by the framework to indicate that a connection is using assisted dialing.
This is used for outgoing calls.
Value: 512
PROPERTY_CROSS_SIM
static val PROPERTY_CROSS_SIM: Int
Connection is using cross sim technology.
Indicates that the Connection
is using a cross sim technology which would register IMS over internet APN of default data subscription.
Value: 8192
PROPERTY_HAS_CDMA_VOICE_PRIVACY
static val PROPERTY_HAS_CDMA_VOICE_PRIVACY: Int
Indicates that the connection has CDMA Enhanced Voice Privacy enabled.
Value: 32
PROPERTY_HIGH_DEF_AUDIO
static val PROPERTY_HIGH_DEF_AUDIO: Int
Connection is using high definition audio.
Indicates that the Connection
is using a "high definition" audio codec. This usually implies something like AMR wideband, but the interpretation of when a call is considered high definition is left to the ConnectionService
to decide.
Translates to android.telecom.Call.Details#PROPERTY_HIGH_DEF_AUDIO
.
Value: 4
PROPERTY_IS_ADHOC_CONFERENCE
static val PROPERTY_IS_ADHOC_CONFERENCE: Int
Set by the framework to indicate that a call is an adhoc conference call.
This is used for outgoing and incoming conference calls.
Value: 4096
PROPERTY_IS_EXTERNAL_CALL
static val PROPERTY_IS_EXTERNAL_CALL: Int
When set, indicates that the Connection
does not actually exist locally for the ConnectionService
.
Consider, for example, a scenario where a user has two devices with the same phone number. When a user places a call on one devices, the telephony stack can represent that call on the other device by adding is to the ConnectionService
with the PROPERTY_IS_EXTERNAL_CALL
capability set.
An ConnectionService
should not assume that all InCallService
s will handle external connections. Only those InCallService
s which have the TelecomManager.METADATA_INCLUDE_EXTERNAL_CALLS
metadata set to true
in its manifest will see external connections.
Value: 16
PROPERTY_IS_RTT
static val PROPERTY_IS_RTT: Int
Set by the framework to indicate that a connection has an active RTT session associated with it.
Value: 256
PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL
static val PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL: Int
Set by the framework to indicate that the network has identified a Connection as an emergency call.
This is used for incoming (mobile-terminated) calls to indicate the call is from emergency services.
Value: 1024
PROPERTY_SELF_MANAGED
static val PROPERTY_SELF_MANAGED: Int
Set by the framework to indicate that the Connection
originated from a self-managed ConnectionService
.
See PhoneAccount.CAPABILITY_SELF_MANAGED
.
Value: 128
PROPERTY_WIFI
static val PROPERTY_WIFI: Int
Connection is using WIFI.
Used to indicate that a call is taking place over WIFI versus a carrier network.
Translates to android.telecom.Call.Details#PROPERTY_WIFI
.
Value: 8
STATE_ACTIVE
static val STATE_ACTIVE: Int
A connection is active. Both parties are connected to the call and can actively communicate.
Value: 4
STATE_DIALING
static val STATE_DIALING: Int
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.
Value: 3
STATE_DISCONNECTED
static val STATE_DISCONNECTED: Int
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.
Value: 6
STATE_INITIALIZING
static val STATE_INITIALIZING: Int
The connection is initializing. This is generally the first state for a Connection
returned by a ConnectionService
.
Value: 0
STATE_NEW
static val STATE_NEW: Int
The connection is new and not connected.
Value: 1
STATE_PULLING_CALL
static val STATE_PULLING_CALL: Int
The state of an external connection which is in the process of being pulled from a remote device to the local device.
A connection can only be in this state if the PROPERTY_IS_EXTERNAL_CALL
property and CAPABILITY_CAN_PULL_CALL
capability bits are set on the connection.
Value: 7
STATE_RINGING
static val STATE_RINGING: Int
An incoming connection is in the ringing state. During this state, the user's ringer or vibration feature will be activated.
Value: 2
VERIFICATION_STATUS_FAILED
static val VERIFICATION_STATUS_FAILED: Int
Indicates that verification by the network failed. This indicates there is a high likelihood that the call did not originate from a valid source.
Value: 2
VERIFICATION_STATUS_NOT_VERIFIED
static val VERIFICATION_STATUS_NOT_VERIFIED: Int
Indicates that the network could not perform verification.
Value: 0
VERIFICATION_STATUS_PASSED
static val VERIFICATION_STATUS_PASSED: Int
Indicates that verification by the network passed. This indicates there is a high likelihood that the call originated from a valid source.
Value: 1
Public constructors
Public methods
capabilitiesToString
open static fun capabilitiesToString(capabilities: Int): String!
Renders a set of capability bits (CAPABILITY_*
) as a human readable string.
Parameters | |
---|---|
capabilities |
Int: A capability bit field. |
Return | |
---|---|
String! |
A human readable string representation. |
createCanceledConnection
open static fun createCanceledConnection(): Connection!
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 Connection
s should be attempted.
so users of this method need not maintain a reference to its return value to destroy it.
Return | |
---|---|
Connection! |
A Connection which indicates that the underlying connection should be canceled. |
createFailedConnection
open static fun createFailedConnection(disconnectCause: DisconnectCause!): Connection!
Return a Connection
which represents a failed connection attempt. The returned Connection
will have a android.telecom.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.
Parameters | |
---|---|
disconnectCause |
DisconnectCause!: The disconnect cause, ({@see android.telecomm.DisconnectCause}). |
Return | |
---|---|
Connection! |
A Connection which indicates failure. |
getAddress
fun getAddress(): Uri!
Return | |
---|---|
Uri! |
The address (e.g., phone number) to which this Connection is currently communicating. |
getAddressPresentation
fun getAddressPresentation(): Int
Return | |
---|---|
Int |
The presentation requirements for the address. See TelecomManager for valid values. |
getAudioModeIsVoip
fun getAudioModeIsVoip(): Boolean
Return | |
---|---|
Boolean |
True if the connection's audio mode is VOIP. |
getCallAudioState
fungetCallAudioState(): CallAudioState!
Deprecated: Use getCurrentCallEndpoint()
, onAvailableCallEndpointsChanged(java.util.List)
and onMuteStateChanged(boolean)
instead.
Return | |
---|---|
CallAudioState! |
The audio state of the connection, describing how its audio is currently being routed by the system. This is null if this Connection does not directly know about its audio state. |
getCallerDisplayName
fun getCallerDisplayName(): String!
Return | |
---|---|
String! |
The caller display name (CNAP). |
getCallerDisplayNamePresentation
fun getCallerDisplayNamePresentation(): Int
Return | |
---|---|
Int |
The presentation requirements for the handle. See TelecomManager for valid values. |
getCallerNumberVerificationStatus
fun getCallerNumberVerificationStatus(): Int
Gets the verification status for the phone number of an incoming call as identified in ATIS-1000082.
Return | |
---|---|
Int |
the verification status. Value is android.telecom.Connection#VERIFICATION_STATUS_NOT_VERIFIED , android.telecom.Connection#VERIFICATION_STATUS_PASSED , or android.telecom.Connection#VERIFICATION_STATUS_FAILED |
getConference
fun getConference(): Conference!
Return | |
---|---|
Conference! |
The conference that this connection is a part of. Null if it is not part of any conference. |
getConferenceables
fun getConferenceables(): MutableList<Conferenceable!>!
Returns the connections or conferences with which this connection can be conferenced.
getConnectionCapabilities
fun getConnectionCapabilities(): Int
Returns the connection's capabilities, as a bit mask of the CAPABILITY_*
constants.
getConnectionProperties
fun getConnectionProperties(): Int
Returns the connection's properties, as a bit mask of the PROPERTY_*
constants.
getCurrentCallEndpoint
fun getCurrentCallEndpoint(): CallEndpoint
Obtains the current CallEndpoint.
Return | |
---|---|
CallEndpoint |
An object encapsulating the CallEndpoint. This value cannot be null . |
getDisconnectCause
fun getDisconnectCause(): DisconnectCause!
Return | |
---|---|
DisconnectCause! |
The DisconnectCause for this connection. |
getExtras
fun getExtras(): Bundle!
Returns the extras associated with this connection.
Extras should be updated using putExtras(android.os.Bundle)
.
Telecom or an InCallService
can also update the extras via android.telecom.Call#putExtras(Bundle)
, and Call.removeExtras(List)
.
The connection is notified of changes to the extras made by Telecom or an InCallService
by onExtrasChanged(android.os.Bundle)
.
Return | |
---|---|
Bundle! |
The extras associated with this connection. |
getStatusHints
fun getStatusHints(): StatusHints!
Return | |
---|---|
StatusHints! |
The status hints for this connection. |
getVideoState
fun getVideoState(): Int
Returns the video state of the connection. Valid values: VideoProfile.STATE_AUDIO_ONLY
, VideoProfile.STATE_BIDIRECTIONAL
, VideoProfile.STATE_TX_ENABLED
, VideoProfile.STATE_RX_ENABLED
.
Return | |
---|---|
Int |
The video state of the connection. Value is either 0 or a combination of android.telecom.VideoProfile#STATE_AUDIO_ONLY , android.telecom.VideoProfile#STATE_TX_ENABLED , android.telecom.VideoProfile#STATE_RX_ENABLED , android.telecom.VideoProfile#STATE_BIDIRECTIONAL , and android.telecom.VideoProfile#STATE_PAUSED |
handleRttUpgradeResponse
open fun handleRttUpgradeResponse(rttTextStream: Connection.RttTextStream?): Unit
Notifies this connection of a response to a previous remotely-initiated RTT upgrade request sent via sendRemoteRttRequest
. Acceptance of the request is indicated by the supplied RttTextStream
being non-null, and rejection is indicated by rttTextStream
being null
Parameters | |
---|---|
rttTextStream |
Connection.RttTextStream?: The object that should be used to send text to or receive text from the in-call app. This value may be null . |
isRingbackRequested
fun isRingbackRequested(): Boolean
Returns whether this connection is requesting that the system play a ringback tone on its behalf.
notifyConferenceMergeFailed
fun notifyConferenceMergeFailed(): Unit
Called by a ConnectionService
to notify Telecom that a Conference.onMerge()
request failed.
onAbort
open fun onAbort(): Unit
Notifies this Connection of a request to abort.
onAddConferenceParticipants
open fun onAddConferenceParticipants(participants: MutableList<Uri!>): Unit
Supports initiation of a conference call by directly adding participants to an ongoing call.
Parameters | |
---|---|
participants |
MutableList<Uri!>: with which conference call will be formed. This value cannot be null . |
onAnswer
open fun onAnswer(): Unit
Notifies this Connection, which is in STATE_RINGING
, of a request to accept.
For managed ConnectionService
s, this will be called when the user answers a call via the default dialer's InCallService
.
Although a self-managed ConnectionService
provides its own incoming call UI, the Telecom framework may request that the call is answered in the following circumstances:
- The user chooses to answer an incoming call via a Bluetooth device.
- A car mode
InCallService
is in use which has declaredTelecomManager.METADATA_INCLUDE_SELF_MANAGED_CALLS
in its manifest. Such anInCallService
will be able to see calls from self-managedConnectionService
s, and will be able to display an incoming call UI on their behalf.
onAnswer
open fun onAnswer(videoState: Int): Unit
Notifies this Connection, which is in STATE_RINGING
, of a request to accept.
For managed ConnectionService
s, this will be called when the user answers a call via the default dialer's InCallService
.
Although a self-managed ConnectionService
provides its own incoming call UI, the Telecom framework may request that the call is answered in the following circumstances:
- The user chooses to answer an incoming call via a Bluetooth device.
- A car mode
InCallService
is in use which has declaredTelecomManager.METADATA_INCLUDE_SELF_MANAGED_CALLS
in its manifest. Such anInCallService
will be able to see calls from self-managedConnectionService
s, and will be able to display an incoming call UI on their behalf.
Parameters | |
---|---|
videoState |
Int: The video state in which to answer the connection. |
onAvailableCallEndpointsChanged
open fun onAvailableCallEndpointsChanged(availableEndpoints: MutableList<CallEndpoint!>): Unit
Notifies this Connection that the available call endpoints have been changed.
Parameters | |
---|---|
availableEndpoints |
MutableList<CallEndpoint!>: The set of available CallEndpoint. This value cannot be null . |
onCallAudioStateChanged
open funonCallAudioStateChanged(state: CallAudioState!): Unit
Deprecated: Use onCallEndpointChanged(android.telecom.CallEndpoint)
, onAvailableCallEndpointsChanged(java.util.List)
and onMuteStateChanged(boolean)
instead.
Notifies this Connection that the getCallAudioState()
property has a new value.
Parameters | |
---|---|
state |
CallAudioState!: The new connection audio state. |
onCallEndpointChanged
open fun onCallEndpointChanged(callEndpoint: CallEndpoint): Unit
Notifies this Connection that the audio endpoint has been changed.
Parameters | |
---|---|
callEndpoint |
CallEndpoint: The current CallEndpoint. This value cannot be null . |
onCallEvent
open fun onCallEvent(
event: String!,
extras: Bundle!
): Unit
Notifies this Connection of a Call
event initiated from an InCallService
.
The InCallService
issues a Call event via Call.sendCallEvent(String, Bundle)
.
Where possible, the Connection should make an attempt to handle Call
events which are part of the android.telecom.*
namespace. The Connection should ignore any events it does not wish to handle. Unexpected events should be handled gracefully, as it is possible that a InCallService
has defined its own Call events which a Connection is not aware of.
See also Call.sendCallEvent(String, Bundle)
.
Parameters | |
---|---|
event |
String!: The call event. |
extras |
Bundle!: Extras associated with the call event. |
onDeflect
open fun onDeflect(address: Uri!): Unit
Notifies this Connection, which is in STATE_RINGING
, of a request to deflect.
onDisconnect
open fun onDisconnect(): Unit
Notifies this Connection of a request to disconnect.
onExtrasChanged
open fun onExtrasChanged(extras: Bundle!): Unit
Notifies this Connection
of a change to the extras made outside the ConnectionService
.
These extras changes can originate from Telecom itself, or from an InCallService
via the android.telecom.Call#putExtras(Bundle)
and Call.removeExtras(List)
.
Parameters | |
---|---|
extras |
Bundle!: The new extras bundle. |
onHandoverComplete
open fun onHandoverComplete(): Unit
Notifies this Connection
that a handover has completed.
A handover is initiated with android.telecom.Call#handoverTo(PhoneAccountHandle, int, * Bundle)
on the initiating side of the handover, and TelecomManager.acceptHandover(Uri, int, PhoneAccountHandle)
.
onHold
open fun onHold(): Unit
Notifies this Connection of a request to hold. Connection.setOnHold
should be within the onHold() body in order to transition the call state to Connection.STATE_HOLDING
.
Note: If the Connection does not transition to Connection.STATE_HOLDING
within 2 seconds, the call will be disconnected.
onMuteStateChanged
open fun onMuteStateChanged(isMuted: Boolean): Unit
Notifies this Connection that its audio mute state has been changed.
Parameters | |
---|---|
isMuted |
Boolean: The current mute state. |
onPlayDtmfTone
open fun onPlayDtmfTone(c: Char): Unit
Notifies this Connection of a request to play a DTMF tone.
Parameters | |
---|---|
c |
Char: A DTMF character. |
onPostDialContinue
open fun onPostDialContinue(proceed: Boolean): Unit
Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes.
onPullExternalCall
open fun onPullExternalCall(): Unit
Notifies this Connection of a request to pull an external call to the local device.
The InCallService
issues a request to pull an external call to the local device via Call.pullExternalCall()
.
For a Connection to be pulled, both the Connection.CAPABILITY_CAN_PULL_CALL
capability and Connection.PROPERTY_IS_EXTERNAL_CALL
property bits must be set.
For more information on external calls, see Connection.PROPERTY_IS_EXTERNAL_CALL
.
onReject
open fun onReject(): Unit
Notifies this Connection, which is in STATE_RINGING
, of a request to reject.
For managed ConnectionService
s, this will be called when the user rejects a call via the default dialer's InCallService
.
Although a self-managed ConnectionService
provides its own incoming call UI, the Telecom framework may request that the call is rejected in the following circumstances:
- The user chooses to reject an incoming call via a Bluetooth device.
- A car mode
InCallService
is in use which has declaredTelecomManager.METADATA_INCLUDE_SELF_MANAGED_CALLS
in its manifest. Such anInCallService
will be able to see calls from self-managedConnectionService
s, and will be able to display an incoming call UI on their behalf.
onReject
open fun onReject(rejectReason: Int): Unit
Notifies this Connection, which is in STATE_RINGING
, of a request to reject.
For managed ConnectionService
s, this will be called when the user rejects a call via the default dialer's InCallService
using Call.reject(int)
.
Parameters | |
---|---|
rejectReason |
Int: the reason the user provided for rejecting the call. Value is android.telecom.Call#REJECT_REASON_DECLINED , or android.telecom.Call#REJECT_REASON_UNWANTED |
onReject
open fun onReject(replyMessage: String!): Unit
Notifies this Connection, which is in STATE_RINGING
, of a request to reject with a message.
onSeparate
open fun onSeparate(): Unit
Notifies this Connection of a request to separate from its parent conference.
onShowIncomingCallUi
open fun onShowIncomingCallUi(): Unit
Notifies this Connection
that its ConnectionService
is responsible for displaying its incoming call user interface for the Connection
Will only be called for incoming calls added via a self-managed ConnectionService
(see PhoneAccount.CAPABILITY_SELF_MANAGED
), where the ConnectionService
should show its own incoming call user interface.
Where there are ongoing calls in other self-managed ConnectionService
s, or in a regular ConnectionService
, and it is not possible to hold these other calls, the Telecom framework will display its own incoming call user interface to allow the user to choose whether to answer the new incoming call and disconnect other ongoing calls, or to reject the new incoming call.
You should trigger the display of the incoming call user interface for your application by showing a Notification
with a full-screen Intent
specified. In your application code, you should create a android.app.NotificationChannel
for incoming call notifications from your app:
<code> NotificationChannel channel = new NotificationChannel(YOUR_CHANNEL_ID, "Incoming Calls", NotificationManager.IMPORTANCE_MAX); // other channel setup stuff goes here. // We'll use the default system ringtone for our incoming call notification channel. You can // use your own audio resource here. Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE); channel.setSound(ringtoneUri, new AudioAttributes.Builder() // Setting the AudioAttributes is important as it identifies the purpose of your // notification sound. .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .build()); NotificationManager mgr = getSystemService(NotificationManager.class); mgr.createNotificationChannel(channel); </code>
android.app.NotificationChannel
.
<code> // Create an intent which triggers your fullscreen incoming call user interface. Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(context, YourIncomingCallActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED); // Build the notification as an ongoing high priority item; this ensures it will show as // a heads up notification which slides down over top of the current content. final Notification.Builder builder = new Notification.Builder(context); builder.setOngoing(true); builder.setPriority(Notification.PRIORITY_HIGH); // Set notification content intent to take user to fullscreen UI if user taps on the // notification body. builder.setContentIntent(pendingIntent); // Set full screen intent to trigger display of the fullscreen UI when the notification // manager deems it appropriate. builder.setFullScreenIntent(pendingIntent, true); // Setup notification content. builder.setSmallIcon( yourIconResourceId ); builder.setContentTitle("Your notification title"); builder.setContentText("Your notification content."); // Set notification as insistent to cause your ringtone to loop. Notification notification = builder.build(); notification.flags |= Notification.FLAG_INSISTENT; // Use builder.addAction(..) to add buttons to answer or reject the call. NotificationManager notificationManager = mContext.getSystemService( NotificationManager.class); notificationManager.notify(YOUR_CHANNEL_ID, YOUR_TAG, YOUR_ID, notification); </code>
onSilence
open fun onSilence(): Unit
Notifies this Connection of a request to silence the ringer.
The ringer may be silenced by any of the following methods:
TelecomManager.silenceRinger()
- The user presses the volume-down button while a call is ringing.
Self-managed ConnectionService
implementations should override this method in their Connection
implementation and implement logic to silence their app's ringtone. If your app set the ringtone as part of the incoming call Notification
(see onShowIncomingCallUi()
), it should re-post the notification now, except call android.app.Notification.Builder#setOnlyAlertOnce(boolean)
with true
. This will ensure the ringtone sound associated with your android.app.NotificationChannel
stops playing.
onStartRtt
open fun onStartRtt(rttTextStream: Connection.RttTextStream): Unit
Notifies this Connection
that the user has requested an RTT session. The connection service should call sendRttInitiationSuccess
or sendRttInitiationFailure
to inform Telecom of the success or failure of the request, respectively.
Parameters | |
---|---|
rttTextStream |
Connection.RttTextStream: The object that should be used to send text to or receive text from the in-call app. This value cannot be null . |
onStateChanged
open fun onStateChanged(state: Int): Unit
Notifies this Connection of an internal state change. This method is called after the state is changed.
Parameters | |
---|---|
state |
Int: The new state, one of the STATE_* constants. |
onStopDtmfTone
open fun onStopDtmfTone(): Unit
Notifies this Connection of a request to stop any currently playing DTMF tones.
onStopRtt
open fun onStopRtt(): Unit
Notifies this Connection
that it should terminate any existing RTT communication channel. No response to Telecom is needed for this method.
onTrackedByNonUiService
open fun onTrackedByNonUiService(isTracked: Boolean): Unit
Inform this Conenection when it will or will not be tracked by an non-UI InCallService
.
Parameters | |
---|---|
isTracked |
Boolean: Indicates whether an non-UI InCallService is currently tracking the self-managed call. |
onUnhold
open fun onUnhold(): Unit
Notifies this Connection of a request to exit a hold state.
onUsingAlternativeUi
open fun onUsingAlternativeUi(isUsingAlternativeUi: Boolean): Unit
Inform this Connection when it will or will not be tracked by an InCallService
which can provide an InCall UI. This is primarily intended for use by Connections reported by self-managed ConnectionService
which typically maintain their own UI.
Parameters | |
---|---|
isUsingAlternativeUi |
Boolean: Indicates whether an InCallService that can provide InCall UI is currently tracking the self-managed call. |
propertiesToString
open static fun propertiesToString(properties: Int): String!
Renders a set of property bits (PROPERTY_*
) as a human readable string.
Parameters | |
---|---|
properties |
Int: A property bit field. |
Return | |
---|---|
String! |
A human readable string representation. |
putExtras
fun putExtras(extras: Bundle): Unit
Adds some extras to this Connection
. Existing keys are replaced and new ones are added.
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.
Parameters | |
---|---|
extras |
Bundle: The extras to add. This value cannot be null . |
queryLocationForEmergency
fun queryLocationForEmergency(
timeoutMillis: Long,
provider: String,
executor: Executor,
callback: OutcomeReceiver<Location!, QueryLocationException!>
): Unit
Query the device's location in order to place an Emergency Call. Only SIM call managers can call this method for Connections representing Emergency calls. If a previous location query request is not completed, the new location query request will be rejected and return a QueryLocationException with QueryLocationException#ERROR_PREVIOUS_REQUEST_EXISTS
Parameters | |
---|---|
timeoutMillis |
Long: long: Timeout in millis waiting for query response (MAX:5000, MIN:100). Value is between 100 and 5000 inclusive |
provider |
String: String: the location provider name, This value cannot be null. It is the caller's responsibility to select an enabled provider. The caller can use android.location.LocationManager#getProviders(boolean) to choose one of the enabled providers and pass it in. |
executor |
Executor: The executor of where the callback will execute. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
OutcomeReceiver<Location!, QueryLocationException!>: The callback to notify the result of queryLocation. This value cannot be null . |
removeExtras
fun removeExtras(vararg keys: String!): Unit
Removes extras from this Connection
.
Parameters | |
---|---|
keys |
String!: The keys of the extras to remove. |
removeExtras
fun removeExtras(keys: MutableList<String!>!): Unit
Removes extras from this Connection
.
Parameters | |
---|---|
keys |
MutableList<String!>!: The keys of the extras to remove. |
requestBluetoothAudio
open funrequestBluetoothAudio(bluetoothDevice: BluetoothDevice): Unit
Deprecated: Use requestCallEndpointChange(android.telecom.CallEndpoint,java.util.concurrent.Executor,android.os.OutcomeReceiver)
instead.
Request audio routing to a specific bluetooth device. Calling this method may result in the device routing audio to a different bluetooth device than the one specified if the bluetooth stack is unable to route audio to the requested device. A list of available devices can be obtained via CallAudioState.getSupportedBluetoothDevices()
Used by self-managed ConnectionService
s which wish to use bluetooth audio for a self-managed Connection
(see PhoneAccount.CAPABILITY_SELF_MANAGED
.)
See also InCallService.requestBluetoothAudio(BluetoothDevice)
Parameters | |
---|---|
bluetoothDevice |
BluetoothDevice: The bluetooth device to connect to. This value cannot be null . |
requestCallEndpointChange
fun requestCallEndpointChange(
endpoint: CallEndpoint,
executor: Executor,
callback: OutcomeReceiver<Void!, CallEndpointException!>
): Unit
Request audio routing to a specific CallEndpoint. Clients should not define their own CallEndpoint when requesting a change. Instead, the new endpoint should be one of the valid endpoints provided by onAvailableCallEndpointsChanged(java.util.List)
. When this request is honored, there will be change to the getCurrentCallEndpoint()
.
Used by self-managed ConnectionService
s which wish to change the CallEndpoint for a self-managed Connection
(see PhoneAccount.CAPABILITY_SELF_MANAGED
.)
See also InCallService.requestCallEndpointChange(CallEndpoint, Executor, OutcomeReceiver)
.
Parameters | |
---|---|
endpoint |
CallEndpoint: The call endpoint to use. This value cannot be null . |
executor |
Executor: The executor of where the callback will execute. This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
callback |
OutcomeReceiver<Void!, CallEndpointException!>: The callback to notify the result of the endpoint change. This value cannot be null . |
sendConnectionEvent
open fun sendConnectionEvent(
event: String!,
extras: Bundle!
): Unit
Sends an event associated with this Connection
with associated event extras to the InCallService
.
Connection events are used to communicate point in time information from a ConnectionService
to a InCallService
implementations. An example of a custom connection event includes notifying the UI when a WIFI call has been handed over to LTE, which the InCall UI might use to inform the user that billing charges may apply. The Android Telephony framework will send the EVENT_CALL_MERGE_FAILED
connection event when a call to Call.mergeConference()
has failed to complete successfully. A connection event could also be used to trigger UI in the InCallService
which prompts the user to make a choice (e.g. whether they want to incur roaming costs for making a call), which is communicated back via Call.sendCallEvent(String, Bundle)
.
Events are exposed to InCallService
implementations via Call.Callback.onConnectionEvent(Call, String, Bundle)
.
No assumptions should be made as to how an In-Call UI or service will handle these events. The ConnectionService
must assume that the In-Call UI could even chose to ignore some events altogether.
Events should be fully qualified (e.g. com.example.event.MY_EVENT
) to avoid conflicts between ConnectionService
implementations. Further, custom ConnectionService
implementations shall not re-purpose events in the android.*
namespace, nor shall they define new event types in this namespace. When defining a custom event type, ensure the contents of the extras Bundle
is clearly defined. Extra keys for this bundle should be named similar to the event type (e.g. com.example.extra.MY_EXTRA
).
When defining events and the associated extras, it is important to keep their behavior consistent when the associated ConnectionService
is updated. Support for deprecated events/extras should me maintained to ensure backwards compatibility with older InCallService
implementations which were built to support the older behavior.
Parameters | |
---|---|
event |
String!: The connection event. |
extras |
Bundle!: Optional bundle containing extra information associated with the event. |
sendRemoteRttRequest
fun sendRemoteRttRequest(): Unit
Informs listeners that the remote side of the call has requested an upgrade to include an RTT session in the call.
sendRttInitiationFailure
fun sendRttInitiationFailure(reason: Int): Unit
Informs listeners that a previously requested RTT session via ConnectionRequest.isRequestingRtt()
or onStartRtt(android.telecom.Connection.RttTextStream)
has failed.
Parameters | |
---|---|
reason |
Int: One of the reason codes defined in RttModifyStatus , with the exception of RttModifyStatus.SESSION_MODIFY_REQUEST_SUCCESS . |
sendRttInitiationSuccess
fun sendRttInitiationSuccess(): Unit
Informs listeners that a previously requested RTT session via ConnectionRequest.isRequestingRtt()
or onStartRtt(android.telecom.Connection.RttTextStream)
has succeeded.
sendRttSessionRemotelyTerminated
fun sendRttSessionRemotelyTerminated(): Unit
Informs listeners that a currently active RTT session has been terminated by the remote side of the coll.
setActive
fun setActive(): Unit
Sets state to active (e.g., an ongoing connection where two or more parties can actively communicate).
setAddress
fun setAddress(
address: Uri!,
presentation: Int
): Unit
Sets the value of the getAddress()
property.
Parameters | |
---|---|
address |
Uri!: The new address. |
presentation |
Int: The presentation requirements for the address. See TelecomManager for valid values. |
setAudioModeIsVoip
fun setAudioModeIsVoip(isVoip: Boolean): Unit
Requests that the framework use VOIP audio mode for this connection.
Parameters | |
---|---|
isVoip |
Boolean: True if the audio mode is VOIP. |
setAudioRoute
funsetAudioRoute(route: Int): Unit
Deprecated: Use requestCallEndpointChange(android.telecom.CallEndpoint,java.util.concurrent.Executor,android.os.OutcomeReceiver)
instead.
Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will be change to the getCallAudioState()
.
Used by self-managed ConnectionService
s which wish to change the audio route for a self-managed Connection
(see PhoneAccount.CAPABILITY_SELF_MANAGED
.)
See also InCallService.setAudioRoute(int)
.
Parameters | |
---|---|
route |
Int: The audio route to use (one of CallAudioState.ROUTE_BLUETOOTH , CallAudioState.ROUTE_EARPIECE , CallAudioState.ROUTE_SPEAKER , or CallAudioState.ROUTE_WIRED_HEADSET ). |
setCallerDisplayName
fun setCallerDisplayName(
callerDisplayName: String!,
presentation: Int
): Unit
Sets the caller display name (CNAP).
Parameters | |
---|---|
callerDisplayName |
String!: The new display name. |
presentation |
Int: The presentation requirements for the handle. See TelecomManager for valid values. |
setCallerNumberVerificationStatus
fun setCallerNumberVerificationStatus(callerNumberVerificationStatus: Int): Unit
Sets the verification status for the phone number of an incoming call as identified in ATIS-1000082.
This property can only be set at the time of creation of a Connection
being returned by ConnectionService.onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)
.
Parameters | |
---|---|
callerNumberVerificationStatus |
Int: Value is android.telecom.Connection#VERIFICATION_STATUS_NOT_VERIFIED , android.telecom.Connection#VERIFICATION_STATUS_PASSED , or android.telecom.Connection#VERIFICATION_STATUS_FAILED |
setConferenceableConnections
fun setConferenceableConnections(conferenceableConnections: MutableList<Connection!>!): Unit
Sets the connections with which this connection can be conferenced.
Parameters | |
---|---|
conferenceableConnections |
MutableList<Connection!>!: The set of connections this connection can conference with. |
setConferenceables
fun setConferenceables(conferenceables: MutableList<Conferenceable!>!): Unit
Similar to setConferenceableConnections(java.util.List)
, sets a list of connections or conferences with which this connection can be conferenced.
Parameters | |
---|---|
conferenceables |
MutableList<Conferenceable!>!: The conferenceables. |
setConnectionCapabilities
fun setConnectionCapabilities(connectionCapabilities: Int): Unit
Sets the connection's capabilities as a bit mask of the CAPABILITY_*
constants.
Parameters | |
---|---|
connectionCapabilities |
Int: The new connection capabilities. |
setConnectionProperties
fun setConnectionProperties(connectionProperties: Int): Unit
Sets the connection's properties as a bit mask of the PROPERTY_*
constants.
Parameters | |
---|---|
connectionProperties |
Int: The new connection properties. |
setDialing
fun setDialing(): Unit
Sets state to dialing (e.g., dialing an outbound connection). The Connection should not be in STATE_DIALING for more than 60 seconds. After 60 seconds, the Connection will be disconnected.
setDisconnected
fun setDisconnected(disconnectCause: DisconnectCause!): Unit
Sets state to disconnected.
Parameters | |
---|---|
disconnectCause |
DisconnectCause!: The reason for the disconnection, as specified by DisconnectCause . |
setExtras
fun setExtras(extras: Bundle?): Unit
Set some extras that can be associated with this Connection
.
New or existing keys are replaced in the Connection
extras. Keys which are no longer in the new extras, but were present the last time setExtras
was called are removed.
Alternatively you may use the putExtras(android.os.Bundle)
, and removeExtras(java.lang.String...)
methods to modify the extras.
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.
Parameters | |
---|---|
extras |
Bundle?: The extras associated with this Connection . This value may be null . |
setInitialized
fun setInitialized(): Unit
Sets state to initialized (the Connection has been set up and is now ready to be used).
setInitializing
fun setInitializing(): Unit
Sets state to initializing (this Connection is not yet ready to be used).
setNextPostDialChar
fun setNextPostDialChar(nextChar: Char): Unit
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.
Parameters | |
---|---|
nextChar |
Char: The DTMF character that was just processed by the Connection . |
setPostDialWait
fun setPostDialWait(remaining: String!): Unit
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.
Parameters | |
---|---|
remaining |
String!: The DTMF character sequence remaining to be emitted once the onPostDialContinue(boolean) is received, including any "wait" characters that remaining sequence may contain. |
setPulling
fun setPulling(): Unit
Sets state to pulling (e.g. the connection is being pulled to the local device from another device). Only applicable for Connection
s with Connection.PROPERTY_IS_EXTERNAL_CALL
and Connection.CAPABILITY_CAN_PULL_CALL
.
setRingbackRequested
fun setRingbackRequested(ringback: Boolean): Unit
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.
Parameters | |
---|---|
ringback |
Boolean: Whether the ringback tone is to be played. |
setRinging
fun setRinging(): Unit
Sets state to ringing (e.g., an inbound ringing connection). The Connection should not be in STATE_RINGING for more than 60 seconds. After 60 seconds, the Connection will be disconnected.
setStatusHints
fun setStatusHints(statusHints: StatusHints!): Unit
Sets the label and icon status to display in the in-call UI.
Parameters | |
---|---|
statusHints |
StatusHints!: The status label and icon to set. |
setVideoProvider
fun setVideoProvider(videoProvider: Connection.VideoProvider!): Unit
Sets the video connection provider.
Parameters | |
---|---|
videoProvider |
Connection.VideoProvider!: The video provider. |
setVideoState
fun setVideoState(videoState: Int): Unit
Set the video state for the connection. Valid values: VideoProfile.STATE_AUDIO_ONLY
, VideoProfile.STATE_BIDIRECTIONAL
, VideoProfile.STATE_TX_ENABLED
, VideoProfile.STATE_RX_ENABLED
.
Parameters | |
---|---|
videoState |
Int: The new video state. |
stateToString
open static fun stateToString(state: Int): String!
Parameters | |
---|---|
state |
Int: An integer value of a STATE_* constant. |
Return | |
---|---|
String! |
A string representation of the value. |