Share via


Connection Class

Definition

Represents a phone call or connection to a remote endpoint that carries voice and/or video traffic.

[Android.Runtime.Register("android/telecom/Connection", ApiSince=23, DoNotGenerateAcw=true)]
public abstract class Connection : Android.Telecom.Conferenceable
[<Android.Runtime.Register("android/telecom/Connection", ApiSince=23, DoNotGenerateAcw=true)>]
type Connection = class
    inherit Conferenceable
Inheritance
Attributes

Remarks

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(String, Bundle) should be overridden. Another example is #onExtrasChanged(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.

Java documentation for android.telecom.Connection.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Connection()

Create a new Connection.

Connection(IntPtr, JniHandleOwnership)

Fields

AudioCodecAmr
Obsolete.

Adaptive Multi-rate audio codec.

AudioCodecAmrWb
Obsolete.

Adaptive Multi-rate wideband audio codec.

AudioCodecEvrc
Obsolete.

Enhanced Variable Rate Codec.

AudioCodecEvrcB
Obsolete.

Enhanced Variable Rate Codec B.

AudioCodecEvrcNw
Obsolete.

Enhanced Variable Rate Narrowband-Wideband Codec.

AudioCodecEvrcWb
Obsolete.

Enhanced Variable Rate Wideband Codec.

AudioCodecEvsFb
Obsolete.

Enhanced Voice Services Fullband audio codec.

AudioCodecEvsNb
Obsolete.

Enhanced Voice Services Narrowband audio codec.

AudioCodecEvsSwb
Obsolete.

Enhanced Voice Services Super-Wideband audio codec.

AudioCodecEvsWb
Obsolete.

Enhanced Voice Services Wideband audio codec.

AudioCodecG711a
Obsolete.

ITU-T G711A audio codec.

AudioCodecG711ab
Obsolete.

ITU-T G711AB audio codec.

AudioCodecG711u
Obsolete.

ITU-T G711U audio codec.

AudioCodecG722
Obsolete.

ITU-T G722 audio codec.

AudioCodecG723
Obsolete.

ITU-T G723 audio codec.

AudioCodecG729
Obsolete.

ITU-T G729 audio codec.

AudioCodecGsmEfr
Obsolete.

GSM Enhanced Full-Rate audio codec, also known as GSM-EFR, GSM 06.

AudioCodecGsmFr
Obsolete.

GSM Full-Rate audio codec, also known as GSM-FR, GSM 06.

AudioCodecGsmHr
Obsolete.

GSM Half Rate audio codec.

AudioCodecNone
Obsolete.

Indicates that the audio codec is currently not specified or is unknown.

AudioCodecQcelp13k
Obsolete.

Qualcomm code-excited linear prediction 13 kilobit audio codec.

CapabilityAddParticipant
Obsolete.

When set, indicates that this Connection supports initiation of a conference call by directly adding participants using #onAddConferenceParticipants(List).

CapabilityRemotePartySupportsRtt
Obsolete.

Indicates whether the remote party supports RTT or not to the UI.

EventCallHoldFailed

Connection event used to inform Telecom when a hold operation on a call has failed.

EventCallMergeFailed

Connection event used to inform InCallServices when the merging of two calls has failed.

EventCallPullFailed

Connection event used to inform InCallServices when pulling of an external call has failed.

EventCallRemotelyHeld

Connection event used to inform InCallServices when a call has been put on hold by the remote party.

EventCallRemotelyUnheld

Connection event used to inform InCallServices when a call which was remotely held (see #EVENT_CALL_REMOTELY_HELD) has been un-held by the remote party.

EventCallSwitchFailed

Connection event used to inform Telecom when a switch operation on a call has failed.

EventMergeComplete

Connection event used to inform InCallServices when the process of merging a Connection into a conference has completed.

EventMergeStart

Connection event used to inform InCallServices when the process of merging a Connection into a conference has begun.

EventOnHoldToneEnd

Connection event used to inform Telecom that it should stop the on hold tone.

EventOnHoldToneStart

Connection event used to inform Telecom that it should play the on hold tone.

EventRttAudioIndicationChanged

Connection event used to inform an InCallService that the RTT audio indication has changed.

ExtraAnsweringDropsFgCall

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.

ExtraAnsweringDropsFgCallAppName

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.

ExtraAudioCodec

The audio codec in use for the current Connection, if known.

ExtraAudioCodecBandwidthKhz

Float connection extra key used to store the audio codec bandwidth in khz for the current Connection.

ExtraAudioCodecBitrateKbps

Float connection extra key used to store the audio codec bitrate in kbps for the current Connection.

ExtraCallSubject

Connection extra key used to store the subject for an incoming call.

ExtraChildAddress

Connection extra key used to store a child number associated with the current connection.

ExtraIsRttAudioPresent

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.

ExtraLastForwardedNumber

Connection extra key used to store the last forwarded number associated with the current connection.

ExtraLastKnownCellIdentity

Last known cell identity key CellIdentity to be used to fill geo location header in case of an emergency call.

ExtraSipInvite

String Connection extra key used to store SIP invite fields for an incoming call for IMS call

PropertyAssistedDialing
Obsolete.

Set by the framework to indicate that a connection is using assisted dialing.

PropertyCrossSim
Obsolete.

Connection is using cross sim technology.

PropertyHasCdmaVoicePrivacy
Obsolete.

Indicates that the connection has CDMA Enhanced Voice Privacy enabled.

PropertyHighDefAudio
Obsolete.

Connection is using high definition audio.

PropertyIsAdhocConference
Obsolete.

Set by the framework to indicate that a call is an adhoc conference call.

PropertyIsExternalCall
Obsolete.

When set, indicates that the Connection does not actually exist locally for the ConnectionService.

PropertyIsRtt
Obsolete.

Set by the framework to indicate that a connection has an active RTT session associated with it.

PropertyNetworkIdentifiedEmergencyCall
Obsolete.

Set by the framework to indicate that the network has identified a Connection as an emergency call.

PropertySelfManaged
Obsolete.

Set by the framework to indicate that the Connection originated from a self-managed ConnectionService.

PropertyWifi
Obsolete.

Connection is using WIFI.

VerificationStatusFailed
Obsolete.

Indicates that verification by the network failed.

VerificationStatusNotVerified
Obsolete.

Indicates that the network could not perform verification.

VerificationStatusPassed
Obsolete.

Indicates that verification by the network passed.

Properties

Address
AddressPresentation
AudioModeIsVoip

Requests that the framework use VOIP audio mode for this connection.

CallAudioState

This member is deprecated.

CallerDisplayName
CallerDisplayNamePresentation
CallerNumberVerificationStatus

Gets the verification status for the phone number of an incoming call as identified in ATIS-1000082. -or- Sets the verification status for the phone number of an incoming call as identified in ATIS-1000082.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Conference
Conferenceables

Returns the connections or conferences with which this connection can be conferenced. -or- Similar to #setConferenceableConnections(java.util.List), sets a list of connections or conferences with which this connection can be conferenced.

ConnectionCapabilities

Returns the connection's capabilities, as a bit mask of the CAPABILITY_ constants. -or- Sets the connection's capabilities as a bit mask of the CAPABILITY_ constants.

ConnectionProperties

Returns the connection's properties, as a bit mask of the PROPERTY_ constants. -or- Sets the connection's properties as a bit mask of the PROPERTY_ constants.

CurrentCallEndpoint

Obtains the current CallEndpoint.

DisconnectCause
Extras

Returns the extras associated with this connection. -or- Set some extras that can be associated with this Connection.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
RingbackRequested

Returns whether this connection is requesting that the system play a ringback tone on its behalf. -or- Requests that the framework play a ringback tone.

State
StatusHints

Sets the label and icon status to display in the in-call UI.

ThresholdClass
ThresholdType
VideoState

Returns the video state of the connection.

Methods

CapabilitiesToString(ConnectionCapability)

Renders a set of capability bits (CAPABILITY_*) as a human readable string.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreateCanceledConnection()

Return a Connection which represents a canceled connection attempt.

CreateFailedConnection(DisconnectCause)

Return a Connection which represents a failed connection attempt.

Destroy()

Tears down the Connection object.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetVideoProvider()
HandleRttUpgradeResponse(Connection+RttTextStream)

Notifies this connection of a response to a previous remotely-initiated RTT upgrade request sent via #sendRemoteRttRequest.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
NotifyConferenceMergeFailed()

Called by a ConnectionService to notify Telecom that a Conference#onMerge() request failed.

OnAbort()

Notifies this Connection of a request to abort.

OnAddConferenceParticipants(IList<Uri>)

Supports initiation of a conference call by directly adding participants to an ongoing call.

OnAnswer()

Notifies this Connection, which is in #STATE_RINGING, of a request to accept.

OnAnswer(VideoProfileState)

Notifies this Connection, which is in #STATE_RINGING, of a request to accept.

OnAvailableCallEndpointsChanged(IList<CallEndpoint>)

Notifies this Connection that the available call endpoints have been changed.

OnCallAudioStateChanged(CallAudioState)

Notifies this Connection that the #getCallAudioState() property has a new value.

OnCallEndpointChanged(CallEndpoint)

Notifies this Connection that the audio endpoint has been changed.

OnCallEvent(String, Bundle)

Notifies this Connection of a Call event initiated from an InCallService.

OnDeflect(Uri)

Notifies this Connection, which is in #STATE_RINGING, of a request to deflect.

OnDisconnect()

Notifies this Connection of a request to disconnect.

OnExtrasChanged(Bundle)

Notifies this Connection of a change to the extras made outside the ConnectionService.

OnHandoverComplete()

Notifies this Connection that a handover has completed.

OnHold()

Notifies this Connection of a request to hold.

OnMuteStateChanged(Boolean)

Notifies this Connection that its audio mute state has been changed.

OnPlayDtmfTone(Char)

Notifies this Connection of a request to play a DTMF tone.

OnPostDialContinue(Boolean)

Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes.

OnPullExternalCall()

Notifies this Connection of a request to pull an external call to the local device.

OnReject()

Notifies this Connection, which is in #STATE_RINGING, of a request to reject.

OnReject(Int32)

Notifies this Connection, which is in #STATE_RINGING, of a request to reject.

OnReject(String)

Notifies this Connection, which is in #STATE_RINGING, of a request to reject with a message.

OnSeparate()

Notifies this Connection of a request to separate from its parent conference.

OnShowIncomingCallUi()

Notifies this Connection that its ConnectionService is responsible for displaying its incoming call user interface for the Connection.

OnSilence()

Notifies this Connection of a request to silence the ringer.

OnStartRtt(Connection+RttTextStream)

Notifies this Connection that the user has requested an RTT session.

OnStateChanged(CallState)

Notifies this Connection of an internal state change.

OnStopDtmfTone()

Notifies this Connection of a request to stop any currently playing DTMF tones.

OnStopRtt()

Notifies this Connection that it should terminate any existing RTT communication channel.

OnTrackedByNonUiService(Boolean)

Inform this Conenection when it will or will not be tracked by an non-UI InCallService.

OnUnhold()

Notifies this Connection of a request to exit a hold state.

OnUsingAlternativeUi(Boolean)

Inform this Connection when it will or will not be tracked by an InCallService which can provide an InCall UI.

PropertiesToString(Int32)

Renders a set of property bits (PROPERTY_*) as a human readable string.

PutExtras(Bundle)

Adds some extras to this Connection.

QueryLocationForEmergency(Int64, String, IExecutor, IOutcomeReceiver)

Query the device's location in order to place an Emergency Call.

RemoveExtras(IList<String>)

Removes extras from this Connection.

RemoveExtras(String[])

Removes extras from this Connection.

RequestBluetoothAudio(BluetoothDevice)

Request audio routing to a specific bluetooth device.

RequestCallEndpointChange(CallEndpoint, IExecutor, IOutcomeReceiver)

Request audio routing to a specific CallEndpoint.

SendConnectionEvent(String, Bundle)

Sends an event associated with this Connection with associated event extras to the InCallService.

SendRemoteRttRequest()

Informs listeners that the remote side of the call has requested an upgrade to include an RTT session in the call.

SendRttInitiationFailure(RttSessionModifyResult)

Informs listeners that a previously requested RTT session via ConnectionRequest#isRequestingRtt() or #onStartRtt(RttTextStream) has failed.

SendRttInitiationSuccess()

Informs listeners that a previously requested RTT session via ConnectionRequest#isRequestingRtt() or #onStartRtt(RttTextStream) has succeeded.

SendRttSessionRemotelyTerminated()

Informs listeners that a currently active RTT session has been terminated by the remote side of the coll.

SetActive()

Sets state to active (e.

SetAddress(Uri, Presentation)

Sets the value of the #getAddress() property.

SetAudioRoute(CallAudioRoute)

Sets the audio route (speaker, bluetooth, etc.

SetCallerDisplayName(String, Presentation)

Sets the caller display name (CNAP).

SetConferenceableConnections(IList<Connection>)

Sets the connections with which this connection can be conferenced.

SetDialing()

Sets state to dialing (e.

SetDisconnected(DisconnectCause)

Sets state to disconnected.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetInitialized()

Sets state to initialized (the Connection has been set up and is now ready to be used).

SetInitializing()

Sets state to initializing (this Connection is not yet ready to be used).

SetNextPostDialChar(Char)

Informs listeners that this Connection has processed a character in the post-dial started state.

SetOnHold()

Sets state to be on hold.

SetPostDialWait(String)

Informs listeners that this Connection is in a post-dial wait state.

SetPulling()

Sets state to pulling (e.

SetRinging()

Sets state to ringing (e.

SetVideoProvider(Connection+VideoProvider)

Sets the video connection provider.

SetVideoState(VideoProfileState)

Set the video state for the connection.

StateToString(ConnectionState)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to