Call
class Call
| kotlin.Any | |
| ↳ | android.telecom.Call |
Represents an ongoing phone call that the in-call app should present to the user.
Summary
| Nested classes | |
|---|---|
| abstract |
Defines callbacks which inform the |
|
A class that holds the state that describes the state of the RTT channel to the remote party, if it is active. |
|
| Constants | |
|---|---|
| static Int |
The audio processing is done when the user asks to hold. |
| static Int |
The audio processing is done for spam detection. |
| static Int |
The audio processing use case is unknown. |
| static Int |
The audio processing use case is voice mail. |
| static String |
The key to retrieve the optional |
| static Int |
Indicates CRS contains audio |
| static Int |
Indicates not a CRS call |
| static Int |
Indicates CRS contains video |
| static String |
Event reported from the telecom framework when a diagnostic message previously raised with |
| static String |
Event reported from the Telecom stack to report an in-call diagnostic message which the dialer app may opt to display to the user. |
| static String |
Connection event used to notify InCallService of phoneaccount changes. |
| static String |
String value indicating the asserted display name reported via ImsCallProfile#EXTRA_ASSERTED_DISPLAY_NAME. |
| static String |
Extra key to indicate the audio mode that should be set for playing the network-provided Customized Ringing Signal (CRS). |
| static String |
Extra key to indicate the type of media a Customized Ringing Signal (CRS) call contains. |
| static String |
|
| static String |
Integer extra representing a message ID for a message posted via |
| static String |
Boolean indicating that the call is a verified business call. |
| static String |
Extra key intended for |
| static String |
Boolean indicating that the call is a unidirectional video service call. |
| static String |
Boolean indicating that the call is a video ring back tone call. |
| static String |
Extra key used to indicate the time (in milliseconds since midnight, January 1, 1970 UTC) when the last outgoing emergency call was made. |
| static String |
Extra key used to indicate whether a |
| static String |
Key for extra used to pass along a list of |
| static Int |
Reject reason used with |
| static Int |
Reject reason used with |
| static Int |
The state of a |
| static Int |
The state of a call that is active with the network, but the audio from the call is being intercepted by an app on the local device. |
| static Int |
The initial state of an outgoing |
| static Int |
The state of an outgoing |
| static Int |
The state of a |
| static Int |
The state of a |
| static Int |
The state of a |
| static Int |
The state of a |
| static Int |
The state of an external call which is in the process of being pulled from a remote device to the local device. |
| static Int |
The state of an incoming |
| static Int |
The state of an outgoing |
| static Int |
The state of a call that is being presented to the user after being in |
| Public methods | |
|---|---|
| Unit |
addConferenceParticipants(participants: MutableList<Uri!>)Pulls participants to existing call by forming a conference call. |
| Unit |
Instructs this |
| Unit |
conference(callToConferenceWith: Call!)Instructs this |
| Unit |
Instructs this |
| Unit |
Instructs this |
| Int |
Returns the Audio Processing usecase for of the call. |
| MutableList<String!>! |
Obtains a list of canned, pre-configured message responses to present to the user as ways of rejecting an incoming |
| MutableList<Call!>! |
Obtains the children of this conference |
| MutableList<Call!>! |
Returns the list of |
| Call.Details! |
Obtains an object containing call details. |
| Call? |
Returns the child |
| Call! |
Obtains the parent of this |
| String! |
Obtains the post-dial sequence remaining to be emitted by this |
| Call.RttCall? |
Returns this call's RttCall object. |
| Int |
getState()Obtains the state of this |
| InCallService.VideoCall! |
Obtains an object that can be used to display video from this |
| Unit |
handoverTo(toHandle: PhoneAccountHandle!, videoState: Int, extras: Bundle!)Initiates a handover of this |
| Unit |
hold()Instructs this |
| Boolean |
Returns whether this call has an active RTT connection. |
| Unit |
Merges the calls within this conference. |
| Unit |
phoneAccountSelected(accountHandle: PhoneAccountHandle!, setDefault: Boolean)Notifies this |
| Unit |
playDtmfTone(digit: Char)Instructs this |
| Unit |
postDialContinue(proceed: Boolean)Instructs this |
| Unit |
Initiates a request to the |
| Unit |
Adds some extras to this |
| Unit |
registerCallback(callback: Call.Callback!)Registers a callback to this |
| Unit |
registerCallback(callback: Call.Callback!, handler: Handler!)Registers a callback to this |
| Unit |
Instructs this |
| Unit |
Instructs the |
| Unit |
removeExtras(vararg keys: String!)Removes extras from this |
| Unit |
removeExtras(keys: MutableList<String!>!)Removes extras from this |
| Unit |
respondToRttRequest(id: Int, accept: Boolean)Responds to an RTT request received via the |
| Unit |
sendCallEvent(event: String!, extras: Bundle!)Sends a |
| Unit |
Sends an RTT upgrade request to the remote end of the connection. |
| Unit |
Instructs this |
| Unit |
Instructs this |
| Unit |
stopRtt()Terminate the RTT session on this call. |
| Unit |
Swaps the calls within this conference. |
| String |
toString()Returns a string representation of the object. |
| Unit |
Instructs this |
| Unit |
Instructs this |
| Unit |
unhold()Instructs this |
| Unit |
unregisterCallback(callback: Call.Callback!)Unregisters a callback from this |
Constants
AUDIO_PROCESSING_USE_CASE_ASK_TO_HOLD
static val AUDIO_PROCESSING_USE_CASE_ASK_TO_HOLD: Int
The audio processing is done when the user asks to hold.
Value: 3AUDIO_PROCESSING_USE_CASE_CALL_SCREENING
static val AUDIO_PROCESSING_USE_CASE_CALL_SCREENING: Int
The audio processing is done for spam detection.
Value: 2AUDIO_PROCESSING_USE_CASE_UNKNOWN
static val AUDIO_PROCESSING_USE_CASE_UNKNOWN: Int
The audio processing use case is unknown.
Value: 0AUDIO_PROCESSING_USE_CASE_VOICEMAIL
static val AUDIO_PROCESSING_USE_CASE_VOICEMAIL: Int
The audio processing use case is voice mail.
Value: 1AVAILABLE_PHONE_ACCOUNTS
static valAVAILABLE_PHONE_ACCOUNTS: String
Deprecated: Use the list from EXTRA_SUGGESTED_PHONE_ACCOUNTS instead.
The key to retrieve the optional PhoneAccounts Telecom can bundle with its Call extras. Used to pass the phone accounts to display on the front end to the user in order to select phone accounts to (for example) place a call.
Value: "selectPhoneAccountAccounts"CRS_MEDIA_TYPE_AUDIO
static val CRS_MEDIA_TYPE_AUDIO: Int
Indicates CRS contains audio
Value: 1CRS_MEDIA_TYPE_NONE
static val CRS_MEDIA_TYPE_NONE: Int
Indicates not a CRS call
Value: 0CRS_MEDIA_TYPE_VIDEO
static val CRS_MEDIA_TYPE_VIDEO: Int
Indicates CRS contains video
Value: 2EVENT_CLEAR_DIAGNOSTIC_MESSAGE
static val EVENT_CLEAR_DIAGNOSTIC_MESSAGE: String
Event reported from the telecom framework when a diagnostic message previously raised with EVENT_DISPLAY_DIAGNOSTIC_MESSAGE has cleared and is no longer pertinent.
The EXTRA_DIAGNOSTIC_MESSAGE_ID indicates the diagnostic message which has been cleared.
The dialer app receives this event via Call.Callback.onConnectionEvent(Call, String, Bundle).
Value: "android.telecom.event.CLEAR_DIAGNOSTIC_MESSAGE"EVENT_DISPLAY_DIAGNOSTIC_MESSAGE
static val EVENT_DISPLAY_DIAGNOSTIC_MESSAGE: String
Event reported from the Telecom stack to report an in-call diagnostic message which the dialer app may opt to display to the user. A diagnostic message is used to communicate scenarios the device has detected which may impact the quality of the ongoing call.
For example a problem with a bluetooth headset may generate a recommendation for the user to try using the speakerphone instead, or if the device detects it has entered a poor service area, the user might be warned so that they can finish their call prior to it dropping.
A diagnostic message is considered persistent in nature. When the user enters a poor service area, for example, the accompanying diagnostic message persists until they leave the area of poor service. Each message is accompanied with a EXTRA_DIAGNOSTIC_MESSAGE_ID which uniquely identifies the diagnostic condition being reported. The framework raises a call event of type EVENT_CLEAR_DIAGNOSTIC_MESSAGE when the condition reported has been cleared. The dialer app should display the diagnostic message until it is cleared. If multiple diagnostic messages are sent with different IDs (which have not yet been cleared) the dialer app should prioritize the most recently received message, but still provide the user with a means to review past messages.
The text of the message is found in EXTRA_DIAGNOSTIC_MESSAGE in the form of a human readable CharSequence which is intended for display in the call UX.
The telecom framework audibly notifies the user of the presence of a diagnostic message, so the dialer app needs only to concern itself with visually displaying the message.
The dialer app receives this event via Call.Callback.onConnectionEvent(Call, String, Bundle).
Value: "android.telecom.event.DISPLAY_DIAGNOSTIC_MESSAGE"EVENT_PHONE_ACCOUNT_CHANGED
static val EVENT_PHONE_ACCOUNT_CHANGED: String
Connection event used to notify InCallService of phoneaccount changes. Dialer uses phone account capability to decide whether to enable some options like RTT. This event will be used for such cases.
Value: "android.telecom.event.PHONE_ACCOUNT_CHANGED"EXTRA_ASSERTED_DISPLAY_NAME
static val EXTRA_ASSERTED_DISPLAY_NAME: String
String value indicating the asserted display name reported via ImsCallProfile#EXTRA_ASSERTED_DISPLAY_NAME. Connection.setExtras(Bundle) or Connection.putExtras(Bundle) should be used to notify Telecom this extra has been set.
Value: "android.telecom.extra.ASSERTED_DISPLAY_NAME"EXTRA_CRS_AUDIO_MODE
static val EXTRA_CRS_AUDIO_MODE: String
Extra key to indicate the audio mode that should be set for playing the network-provided Customized Ringing Signal (CRS).
Legacy OEM implementations may use android.media.AudioManager#MODE_IN_CALL due to HAL implementation internals, where newer implementations are expected to use android.media.AudioManager#MODE_RINGTONE.
The value associated with this key should be one of the following constants from android.media.AudioManager:
Connection.setExtras(Bundle) or Connection.putExtras(Bundle) should be used to notify Telecom this extra has been set.
Value: "android.telecom.extra.CRS_AUDIO_MODE"EXTRA_CRS_MEDIA_TYPE
static val EXTRA_CRS_MEDIA_TYPE: String
Extra key to indicate the type of media a Customized Ringing Signal (CRS) call contains. The CRS is an operator-specific feature that allows a subscriber to customize the media played to the called party during the establishment of an incoming call. When the MT call is received, the device will present the CRS media instead of its standard ringtone. This CRS media can consist of audio, video, or any combination thereof.
To maintain compatibility with third-party dialer applications that are not CRS-aware, the public video state of the call (see Details.getVideoState()) will remain android.telecom.VideoProfile#STATE_AUDIO_ONLY even if the CRS call contains video.
A CRS-aware dialer should check for the presence of this extra. If the value includes the CRS_MEDIA_TYPE_VIDEO bit, the dialer is responsible for displaying the video to the user. The dialer can accomplish this by:
- Obtaining the
android.telecom.InCallService.VideoCallinstance from this call viagetVideoCall(). - Creating a
android.view.Surfacefor video rendering. - Passing the surface to the framework using android.telecom.InCallService.VideoCall#setDisplaySurface(Surface).
The value associated with this key should be an integer bitmask of the following values:
Connection.setExtras(Bundle) or Connection.putExtras(Bundle) should be used to notify Telecom that this extra has been set.
Value: "android.telecom.extra.CRS_MEDIA_TYPE"EXTRA_DIAGNOSTIC_MESSAGE
static val EXTRA_DIAGNOSTIC_MESSAGE: String
CharSequence extra used with EVENT_DISPLAY_DIAGNOSTIC_MESSAGE. This is the diagnostic message the dialer app should display.
Value: "android.telecom.extra.DIAGNOSTIC_MESSAGE"EXTRA_DIAGNOSTIC_MESSAGE_ID
static val EXTRA_DIAGNOSTIC_MESSAGE_ID: String
Integer extra representing a message ID for a message posted via EVENT_DISPLAY_DIAGNOSTIC_MESSAGE. Used to ensure that the dialer app knows when the message in question has cleared via EVENT_CLEAR_DIAGNOSTIC_MESSAGE.
Value: "android.telecom.extra.DIAGNOSTIC_MESSAGE_ID"EXTRA_IS_BUSINESS_CALL
static val EXTRA_IS_BUSINESS_CALL: String
Boolean indicating that the call is a verified business call. Connection.setExtras(Bundle) or Connection.putExtras(Bundle) should be used to notify Telecom this extra has been set.
Value: "android.telecom.extra.IS_BUSINESS_CALL"EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB
static val EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB: String
Extra key intended for InCallServices that notify the user of an incoming call. When EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB returns true, the InCallService should not interrupt the user of the incoming call because the call is being suppressed by Do Not Disturb settings. This extra will be removed from the Call object for InCallServices that do not hold the android.Manifest.permission#READ_CONTACTS permission.
Value: "android.telecom.extra.IS_SUPPRESSED_BY_DO_NOT_DISTURB"EXTRA_IS_USING_UNIDIRECTIONAL_VIDEO_SERVICE
static val EXTRA_IS_USING_UNIDIRECTIONAL_VIDEO_SERVICE: String
Boolean indicating that the call is a unidirectional video service call. Connection.setExtras(Bundle) or Connection.putExtras(Bundle) should be used to notify Telecom this extra has been set.
Value: "android.telecom.extra.IS_USING_UNIDIRECTIONAL_VIDEO_SERVICE"EXTRA_IS_USING_VIDEO_RINGBACK
static val EXTRA_IS_USING_VIDEO_RINGBACK: String
Boolean indicating that the call is a video ring back tone call. Connection.setExtras(Bundle) or Connection.putExtras(Bundle) should be used to notify Telecom this extra has been set.
Value: "android.telecom.extra.IS_USING_VIDEO_RINGBACK"EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS
static val EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS: String
Extra key used to indicate the time (in milliseconds since midnight, January 1, 1970 UTC) when the last outgoing emergency call was made. This is used to identify potential emergency callbacks.
Value: "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS"EXTRA_SILENT_RINGING_REQUESTED
static val EXTRA_SILENT_RINGING_REQUESTED: String
Extra key used to indicate whether a CallScreeningService has requested to silence the ringtone for a call. If the InCallService declares TelecomManager.METADATA_IN_CALL_SERVICE_RINGING in its manifest, it should not play a ringtone for an incoming call with this extra key set.
Value: "android.telecom.extra.SILENT_RINGING_REQUESTED"EXTRA_SUGGESTED_PHONE_ACCOUNTS
static val EXTRA_SUGGESTED_PHONE_ACCOUNTS: String
Key for extra used to pass along a list of PhoneAccountSuggestions to the in-call UI when a call enters the STATE_SELECT_PHONE_ACCOUNT state. The list included here will have the same length and be in the same order as the list passed with AVAILABLE_PHONE_ACCOUNTS.
Value: "android.telecom.extra.SUGGESTED_PHONE_ACCOUNTS"REJECT_REASON_DECLINED
static val REJECT_REASON_DECLINED: Int
Reject reason used with reject(int) to indicate that the user is rejecting this call because they have declined to answer it. This typically means that they are unable to answer the call at this time and would prefer it be sent to voicemail.
Value: 1REJECT_REASON_UNWANTED
static val REJECT_REASON_UNWANTED: Int
Reject reason used with reject(int) to indicate that the user is rejecting this call because it is an unwanted call. This allows the user to indicate that they are rejecting a call because it is likely a nuisance call.
Value: 2STATE_ACTIVE
static val STATE_ACTIVE: Int
The state of a Call when actively supporting conversation.
Value: 4STATE_AUDIO_PROCESSING
static val STATE_AUDIO_PROCESSING: Int
The state of a call that is active with the network, but the audio from the call is being intercepted by an app on the local device. Telecom does not hold audio focus in this state, and the call will be invisible to the user except for a persistent notification.
Value: 12STATE_CONNECTING
static val STATE_CONNECTING: Int
The initial state of an outgoing Call. Common transitions are to STATE_DIALING state for a successful call or STATE_DISCONNECTED if it failed.
Value: 9STATE_DIALING
static val STATE_DIALING: Int
The state of an outgoing Call when dialing the remote number, but not yet connected.
Value: 1STATE_DISCONNECTED
static val STATE_DISCONNECTED: Int
The state of a Call when no further voice or other communication is being transmitted, the remote side has been or will inevitably be informed that the Call is no longer active, and the local data transport has or inevitably will release resources associated with this Call.
Value: 7STATE_DISCONNECTING
static val STATE_DISCONNECTING: Int
The state of a Call when the user has initiated a disconnection of the call, but the call has not yet been disconnected by the underlying ConnectionService. The next state of the call is (potentially) STATE_DISCONNECTED.
Value: 10STATE_HOLDING
static val STATE_HOLDING: Int
The state of a Call when in a holding state.
Value: 3STATE_NEW
static val STATE_NEW: Int
The state of a Call when newly created.
Value: 0STATE_PULLING_CALL
static val STATE_PULLING_CALL: Int
The state of an external call which is in the process of being pulled from a remote device to the local device.
A call can only be in this state if the Details.PROPERTY_IS_EXTERNAL_CALL property and Details.CAPABILITY_CAN_PULL_CALL capability are set on the call.
An InCallService will only see this state if it has the TelecomManager.METADATA_INCLUDE_EXTERNAL_CALLS metadata set to true in its manifest.
Value: 11STATE_RINGING
static val STATE_RINGING: Int
The state of an incoming Call when ringing locally, but not yet connected.
Value: 2STATE_SELECT_PHONE_ACCOUNT
static val STATE_SELECT_PHONE_ACCOUNT: Int
The state of an outgoing Call when waiting on user to select a PhoneAccount through which to place the call.
Value: 8STATE_SIMULATED_RINGING
static val STATE_SIMULATED_RINGING: Int
The state of a call that is being presented to the user after being in STATE_AUDIO_PROCESSING. The call is still active with the network in this case, and Telecom will hold audio focus and play a ringtone if appropriate.
Value: 13Public methods
addConferenceParticipants
fun addConferenceParticipants(participants: MutableList<Uri!>): Unit
Pulls participants to existing call by forming a conference call. See Details.CAPABILITY_ADD_PARTICIPANT.
| Parameters | |
|---|---|
participants |
MutableList<Uri!>: participants to be pulled to existing call. This value cannot be null. |
answer
fun answer(videoState: Int): Unit
Instructs this STATE_RINGING Call to answer.
| Parameters | |
|---|---|
videoState |
Int: The video state in which to answer the call. Value is either 0 or a combination of the following:
|
conference
fun conference(callToConferenceWith: Call!): Unit
Instructs this Call to enter a conference.
| Parameters | |
|---|---|
callToConferenceWith |
Call!: The other call with which to conference. |
deflect
fun deflect(address: Uri!): Unit
Instructs this STATE_RINGING Call to deflect.
| Parameters | |
|---|---|
address |
Uri!: The address to which the call will be deflected. |
getAudioProcessingUseCase
fun getAudioProcessingUseCase(): Int
Returns the Audio Processing usecase for of the call. Note: This must be used only when the Call#getState() is STATE_AUDIO_PROCESSING
| Return | |
|---|---|
Int |
the audio processing use case for android.telecom.Call.AudioProcessingUseCase |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if the call is not in STATE_AUDIO_PROCESSING |
getCannedTextResponses
fun getCannedTextResponses(): MutableList<String!>!
Obtains a list of canned, pre-configured message responses to present to the user as ways of rejecting an incoming Call using via a text message.
Note: Since canned responses may be loaded from the file system, they are not guaranteed to be present when this Call is first added to the InCallService via InCallService.onCallAdded(Call). The callback Call.Callback.onCannedTextResponsesLoaded(Call, List) will be called when/if canned responses for the call become available.
| Return | |
|---|---|
MutableList<String!>! |
A list of canned text message responses. |
See Also
getChildren
fun getChildren(): MutableList<Call!>!
Obtains the children of this conference Call, if any.
| Return | |
|---|---|
MutableList<Call!>! |
The children of this Call if this Call is a conference, or an empty List otherwise. |
getConferenceableCalls
fun getConferenceableCalls(): MutableList<Call!>!
Returns the list of Calls with which this Call is allowed to conference.
| Return | |
|---|---|
MutableList<Call!>! |
The list of conferenceable Calls. |
getDetails
fun getDetails(): Call.Details!
Obtains an object containing call details.
| Return | |
|---|---|
Call.Details! |
A Details object. Depending on the state of the Call, the result may be null. |
getGenericConferenceActiveChildCall
fun getGenericConferenceActiveChildCall(): Call?
Returns the child Call in a generic conference that is currently active. A "generic conference" is the mechanism used to support two simultaneous calls on a device in CDMA networks. It is effectively equivalent to having one call active and one call on hold in GSM or IMS calls. This method returns the currently active call. In a generic conference, the network exposes the conference to us as a single call, and we switch between talking to the two participants using a CDMA flash command. Since the network exposes no additional information about the call, the only way we know which caller we're currently talking to is by keeping track of the flash commands that we've sent to the network. For calls that are not generic conferences, or when the generic conference has more than 2 children, returns null.
| Return | |
|---|---|
Call? |
The active child call. |
getParent
fun getParent(): Call!
Obtains the parent of this Call in a conference, if any.
| Return | |
|---|---|
Call! |
The parent Call, or null if this Call is not a child of any conference Calls. |
getRemainingPostDialSequence
fun getRemainingPostDialSequence(): String!
Obtains the post-dial sequence remaining to be emitted by this Call, if any.
| Return | |
|---|---|
String! |
The remaining post-dial sequence, or null if there is no post-dial sequence remaining or this Call is not in a post-dial state. |
getRttCall
fun getRttCall(): Call.RttCall?
Returns this call's RttCall object. The RttCall instance is used to send and receive RTT text data, as well as to change the RTT mode.
| Return | |
|---|---|
Call.RttCall? |
A Call.RttCall. null if there is no active RTT connection. |
getState
fungetState(): Int
Deprecated: The call state is available via Call.Details.getState().
Obtains the state of this Call.
| Return | |
|---|---|
Int |
The call state. Value is one of the following: |
getVideoCall
fun getVideoCall(): InCallService.VideoCall!
Obtains an object that can be used to display video from this Call.
| Return | |
|---|---|
InCallService.VideoCall! |
An Call.VideoCall. |
handoverTo
fun handoverTo(
toHandle: PhoneAccountHandle!,
videoState: Int,
extras: Bundle!
): Unit
Initiates a handover of this Call to the ConnectionService identified by toHandle. The videoState specified indicates the desired video state after the handover.
A call handover is the process where an ongoing call is transferred from one app (i.e. ConnectionService to another app. The user could, for example, choose to continue a mobile network call in a video calling app. The mobile network call via the Telephony stack is referred to as the source of the handover, and the video calling app is referred to as the destination.
When considering a handover scenario the device this method is called on is considered the initiating device (since the user initiates the handover from this device), and the other device is considered the receiving device.
When this method is called on the initiating device, the Telecom framework will bind to the ConnectionService defined by the toHandle PhoneAccountHandle and invoke ConnectionService.onCreateOutgoingHandoverConnection(PhoneAccountHandle, ConnectionRequest) to inform the destination app that a request has been made to handover a call to it. The app returns an instance of Connection to represent the handover call At this point the app should display UI to indicate to the user that a call handover is in process.
The destination app is responsible for communicating the handover request from the initiating device to the receiving device.
When the app on the receiving device receives the handover request, it calls TelecomManager.acceptHandover(Uri, int, PhoneAccountHandle) to continue the handover process from the initiating device to the receiving device. At this point the destination app on the receiving device should show UI to allow the user to choose whether they want to continue their call in the destination app.
When the destination app on the receiving device calls TelecomManager.acceptHandover(Uri, int, PhoneAccountHandle), Telecom will bind to its ConnectionService and call ConnectionService.onCreateIncomingHandoverConnection(PhoneAccountHandle, ConnectionRequest) to inform it of the handover request. The app returns an instance of Connection to represent the handover call.
If the user of the receiving device accepts the handover, the app calls Connection.setActive() to complete the handover process; Telecom will disconnect the original call. If the user rejects the handover, the app calls Connection.setDisconnected(DisconnectCause) and specifies a DisconnectCause of DisconnectCause.CANCELED to indicate that the handover has been cancelled.
Telecom will only allow handovers from PhoneAccounts which declare PhoneAccount.EXTRA_SUPPORTS_HANDOVER_FROM. Similarly, the PhoneAccount specified by toHandle must declare PhoneAccount.EXTRA_SUPPORTS_HANDOVER_TO.
Errors in the handover process are reported to the InCallService via Callback.onHandoverFailed(Call, int). Errors in the handover process are reported to the involved ConnectionServices via ConnectionService.onHandoverFailed(ConnectionRequest, int).
| Parameters | |
|---|---|
toHandle |
PhoneAccountHandle!: PhoneAccountHandle of the ConnectionService to handover this call to. |
videoState |
Int: Indicates the video state desired after the handover (see the STATE_* constants defined in VideoProfile). Value is either 0 or a combination of the following:
|
extras |
Bundle!: Bundle containing extra information to be passed to the ConnectionService |
isRttActive
fun isRttActive(): Boolean
Returns whether this call has an active RTT connection.
| Return | |
|---|---|
Boolean |
true if there is a connection, false otherwise. |
mergeConference
fun mergeConference(): Unit
Merges the calls within this conference. See Details.CAPABILITY_MERGE_CONFERENCE.
phoneAccountSelected
fun phoneAccountSelected(
accountHandle: PhoneAccountHandle!,
setDefault: Boolean
): Unit
Notifies this Call that an account has been selected and to proceed with placing an outgoing call. Optionally sets this account as the default account.
playDtmfTone
fun playDtmfTone(digit: Char): Unit
Instructs this Call to play a dual-tone multi-frequency signaling (DTMF) tone.
Tones are both played locally for the user to hear and sent to the network to be relayed to the remote device.
You must ensure that any call to playDtmfTone(char) is followed by a matching call to stopDtmfTone() and that each tone is stopped before a new one is started. The play and stop commands are relayed to the underlying android.telecom.ConnectionService as executed; implementations may not correctly handle out of order commands.
| Parameters | |
|---|---|
digit |
Char: A character representing the DTMF digit for which to play the tone. This value must be one of '0' through '9', '*' or '#'. |
postDialContinue
fun postDialContinue(proceed: Boolean): Unit
Instructs this Call to continue playing a post-dial DTMF string. A post-dial DTMF string is a string of digits entered after a phone number, when dialed, that are immediately sent as DTMF tones to the recipient as soon as the connection is made. If the DTMF string contains a TelecomManager.DTMF_CHARACTER_PAUSE symbol, this Call will temporarily pause playing the tones for a pre-defined period of time. If the DTMF string contains a TelecomManager.DTMF_CHARACTER_WAIT symbol, this Call will pause playing the tones and notify callbacks via Callback.onPostDialWait(Call, String). At this point, the in-call app should display to the user an indication of this state and an affordance to continue the postdial sequence. When the user decides to continue the postdial sequence, the in-call app should invoke the postDialContinue(boolean) method.
| Parameters | |
|---|---|
proceed |
Boolean: Whether or not to continue with the post-dial sequence. |
pullExternalCall
fun pullExternalCall(): Unit
Initiates a request to the ConnectionService to pull an external call to the local device.
Calls to this method are ignored if the call does not have the Call.Details.PROPERTY_IS_EXTERNAL_CALL property set.
An InCallService will only see calls which support this method if it has the TelecomManager.METADATA_INCLUDE_EXTERNAL_CALLS metadata set to true in its manifest.
putExtras
fun putExtras(extras: Bundle!): Unit
Adds some extras to this Call. 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.
Extras added using this method will be made available to the ConnectionService associated with this Call and notified via Connection.onExtrasChanged(Bundle).
Extras added using this method will also be available to other running InCallServices and notified via Call.Callback.onDetailsChanged(Call, Details). The extras can be accessed via Details.getExtras().
| Parameters | |
|---|---|
extras |
Bundle!: The extras to add. |
registerCallback
fun registerCallback(callback: Call.Callback!): Unit
Registers a callback to this Call.
| Parameters | |
|---|---|
callback |
Call.Callback!: A Callback. |
registerCallback
fun registerCallback(
callback: Call.Callback!,
handler: Handler!
): Unit
Registers a callback to this Call.
| Parameters | |
|---|---|
callback |
Call.Callback!: A Callback. |
handler |
Handler!: A handler which command and status changes will be delivered to. |
reject
fun reject(
rejectWithMessage: Boolean,
textMessage: String!
): Unit
Instructs this STATE_RINGING Call to reject.
| Parameters | |
|---|---|
rejectWithMessage |
Boolean: Whether to reject with a text message. |
textMessage |
String!: An optional text message with which to respond. |
reject
fun reject(rejectReason: Int): Unit
Instructs the ConnectionService providing this STATE_RINGING call that the user has chosen to reject the call and has indicated a reason why the call is being rejected.
| Parameters | |
|---|---|
rejectReason |
Int: the reason the call is being rejected. Value is one of the following: |
removeExtras
fun removeExtras(vararg keys: String!): Unit
Removes extras from this Call.
| Parameters | |
|---|---|
keys |
String!: The keys of the extras to remove. |
removeExtras
fun removeExtras(keys: MutableList<String!>!): Unit
Removes extras from this Call.
| Parameters | |
|---|---|
keys |
MutableList<String!>!: The keys of the extras to remove. |
respondToRttRequest
fun respondToRttRequest(
id: Int,
accept: Boolean
): Unit
Responds to an RTT request received via the Callback.onRttRequest(Call, int) )} callback. The ID used here should be the same as the ID that was received via the callback.
| Parameters | |
|---|---|
id |
Int: The request ID received via Callback.onRttRequest(Call, int) |
accept |
Boolean: true if the RTT request should be accepted, false otherwise. |
sendCallEvent
fun sendCallEvent(
event: String!,
extras: Bundle!
): Unit
Sends a Call event from this Call to the associated Connection in the ConnectionService.
Call events are used to communicate point in time information from an InCallService to a ConnectionService. A ConnectionService implementation could define events which enable the InCallService, for example, toggle a unique feature of the ConnectionService.
A ConnectionService can communicate to the InCallService using Connection.sendConnectionEvent(String, Bundle).
Events are exposed to ConnectionService implementations via android.telecom.Connection#onCallEvent(String, Bundle).
No assumptions should be made as to how a ConnectionService will handle these events. The InCallService must assume that the ConnectionService could chose to ignore some events altogether.
Events should be fully qualified (e.g., com.example.event.MY_EVENT) to avoid conflicts between InCallService implementations. Further, InCallService implementations shall not re-purpose events in the android.* namespace, nor shall they define their own 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 InCallService is updated. Support for deprecated events/extras should me maintained to ensure backwards compatibility with older ConnectionService implementations which were built to support the older behavior.
| Parameters | |
|---|---|
event |
String!: The connection event. |
extras |
Bundle!: Bundle containing extra information associated with the event. |
sendRttRequest
fun sendRttRequest(): Unit
Sends an RTT upgrade request to the remote end of the connection. Success is not guaranteed, and notification of success will be via the Callback.onRttStatusChanged(Call, boolean, RttCall) callback.
splitFromConference
fun splitFromConference(): Unit
Instructs this Call to split from any conference call with which it may be connected.
stopDtmfTone
fun stopDtmfTone(): Unit
Instructs this Call to stop any dual-tone multi-frequency signaling (DTMF) tone currently playing. DTMF tones are played by calling playDtmfTone(char). If no DTMF tone is currently playing, this method will do nothing.
stopRtt
fun stopRtt(): Unit
Terminate the RTT session on this call. The resulting state change will be notified via the Callback.onRttStatusChanged(Call, boolean, RttCall) callback.
swapConference
fun swapConference(): Unit
Swaps the calls within this conference. See Details.CAPABILITY_SWAP_CONFERENCE.
toString
fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
transfer
fun transfer(
targetNumber: Uri,
isConfirmationRequired: Boolean
): Unit
Instructs this Call to be transferred to another number.
| Parameters | |
|---|---|
targetNumber |
Uri: The address to which the call will be transferred. This value cannot be null. |
isConfirmationRequired |
Boolean: if true it will initiate a confirmed(assured) transfer, if false, it will initiate an unconfirmed(blind) transfer. See 3GPP TS 24.629 for more details. |
transfer
fun transfer(toCall: Call): Unit
Instructs this Call to be transferred to another ongoing call. This will initiate CONSULTATIVE transfer.
| Parameters | |
|---|---|
toCall |
Call: The other ongoing Call to which this call will be transferred. See 3GPP TS 24.629 for more details. This value cannot be null. |
unhold
fun unhold(): Unit
Instructs this STATE_HOLDING call to release from hold.
unregisterCallback
fun unregisterCallback(callback: Call.Callback!): Unit
Unregisters a callback from this Call.
| Parameters | |
|---|---|
callback |
Call.Callback!: A Callback. |