Conference
public
abstract
class
Conference
extends Conferenceable
java.lang.Object | ||
↳ | android.telecom.Conferenceable | |
↳ | android.telecom.Conference |
Represents a conference call which can contain any number of Connection
objects.
Summary
Constants | |
---|---|
long |
CONNECT_TIME_NOT_SPECIFIED
Used to indicate that the conference connection time is not specified. |
Public constructors | |
---|---|
Conference(PhoneAccountHandle phoneAccount)
Constructs a new Conference with a mandatory |
Public methods | |
---|---|
final
boolean
|
addConnection(Connection connection)
Adds the specified connection as a child of this conference. |
static
Conference
|
createFailedConference(DisconnectCause disconnectCause, PhoneAccountHandle phoneAccount)
Return a |
final
void
|
destroy()
Tears down the conference object and any of its current connections. |
final
CallAudioState
|
getCallAudioState()
This method was deprecated
in API level 34.
Use |
final
List<Connection>
|
getConferenceableConnections()
Returns the connections with which this connection can be conferenced. |
final
int
|
getConnectionCapabilities()
Returns the capabilities of the conference. |
final
int
|
getConnectionProperties()
Returns the properties of the conference. |
final
long
|
getConnectionStartElapsedRealtimeMillis()
Retrieves the connection start time of the |
final
long
|
getConnectionTime()
Retrieves the connection start time of the |
final
List<Connection>
|
getConnections()
Returns the list of connections currently associated with the conference call. |
final
CallEndpoint
|
getCurrentCallEndpoint()
Obtains the current CallEndpoint. |
final
DisconnectCause
|
getDisconnectCause()
|
final
Bundle
|
getExtras()
Returns the extras associated with this conference. |
final
PhoneAccountHandle
|
getPhoneAccountHandle()
Returns the |
final
int
|
getState()
Gets the state of the conference call. |
final
StatusHints
|
getStatusHints()
|
Connection.VideoProvider
|
getVideoProvider()
Returns VideoProvider of the primary call. |
int
|
getVideoState()
Returns video state of the primary call. |
final
boolean
|
isRingbackRequested()
Returns whether this conference is requesting that the system play a ringback tone on its behalf. |
void
|
onAddConferenceParticipants(List<Uri> participants)
Notifies the |
void
|
onAnswer(int videoState)
Notifies this Conference, which is in |
void
|
onAvailableCallEndpointsChanged(List<CallEndpoint> availableEndpoints)
Notifies the |
void
|
onCallAudioStateChanged(CallAudioState state)
This method was deprecated
in API level 34.
Use |
void
|
onCallEndpointChanged(CallEndpoint callEndpoint)
Notifies the |
void
|
onConnectionAdded(Connection connection)
Notifies the |
void
|
onDisconnect()
Notifies the |
void
|
onExtrasChanged(Bundle extras)
Notifies this |
void
|
onHold()
Notifies the |
void
|
onMerge(Connection connection)
Notifies the |
void
|
onMerge()
Notifies the |
void
|
onMuteStateChanged(boolean isMuted)
Notifies the |
void
|
onPlayDtmfTone(char c)
Notifies the |
void
|
onReject()
Notifies this Conference, which is in |
void
|
onSeparate(Connection connection)
Notifies the |
void
|
onStopDtmfTone()
Notifies the |
void
|
onSwap()
Notifies the |
void
|
onUnhold()
Notifies the |
final
void
|
putExtras(Bundle extras)
Adds some extras to this |
final
void
|
removeConnection(Connection connection)
Removes the specified connection as a child of this conference. |
final
void
|
removeExtras(List<String> keys)
Removes extras from this |
final
void
|
removeExtras(String... keys)
Removes extras from this |
void
|
sendConferenceEvent(String event, Bundle extras)
Sends an event associated with this |
final
void
|
setActive()
Sets state to be active. |
final
void
|
setConferenceableConnections(List<Connection> conferenceableConnections)
Sets the connections with which this connection can be conferenced. |
final
void
|
setConnectionCapabilities(int connectionCapabilities)
Sets the capabilities of a conference. |
final
void
|
setConnectionProperties(int connectionProperties)
Sets the properties of a conference. |
final
void
|
setConnectionStartElapsedRealTime(long connectionStartElapsedRealTime)
This method was deprecated
in API level 30.
use |
final
void
|
setConnectionStartElapsedRealtimeMillis(long connectionStartElapsedRealTime)
Sets the start time of the |
final
void
|
setConnectionTime(long connectionTimeMillis)
Sets the connection start time of the |
final
void
|
setDialing()
Sets state to be dialing. |
final
void
|
setDisconnected(DisconnectCause disconnectCause)
Sets state to disconnected. |
final
void
|
setExtras(Bundle extras)
Replaces all the extras associated with this |
final
void
|
setOnHold()
Sets state to be on hold. |
final
void
|
setRingbackRequested(boolean ringback)
Requests that the framework play a ringback tone. |
final
void
|
setRinging()
Sets state to be ringing. |
final
void
|
setStatusHints(StatusHints statusHints)
Sets the label and icon status to display in the InCall UI. |
final
void
|
setVideoProvider(Connection c, Connection.VideoProvider videoProvider)
Sets the video connection provider. |
final
void
|
setVideoState(Connection c, int videoState)
Set the video state for the conference. |
String
|
toString()
Returns a string representation of the object. |
Inherited methods | |
---|---|
Constants
CONNECT_TIME_NOT_SPECIFIED
public static final long CONNECT_TIME_NOT_SPECIFIED
Used to indicate that the conference connection time is not specified. If not specified, Telecom will set the connect time.
Constant Value: 0 (0x0000000000000000)
Public constructors
Conference
public Conference (PhoneAccountHandle phoneAccount)
Constructs a new Conference with a mandatory PhoneAccountHandle
Parameters | |
---|---|
phoneAccount |
PhoneAccountHandle : The PhoneAccountHandle associated with the conference. |
Public methods
addConnection
public final boolean addConnection (Connection connection)
Adds the specified connection as a child of this conference.
Parameters | |
---|---|
connection |
Connection : The connection to add. |
Returns | |
---|---|
boolean |
True if the connection was successfully added. |
createFailedConference
public static Conference createFailedConference (DisconnectCause disconnectCause, PhoneAccountHandle phoneAccount)
Return a Conference
which represents a failed conference attempt. The returned
Conference
will have a DisconnectCause
and as specified,
and a getState()
of STATE_DISCONNECTED
.
The returned Conference
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, ().
This value cannot be null . |
phoneAccount |
PhoneAccountHandle : This value cannot be null . |
Returns | |
---|---|
Conference |
A Conference which indicates failure.
This value cannot be null . |
destroy
public final void destroy ()
Tears down the conference object and any of its current connections.
getCallAudioState
public final CallAudioState getCallAudioState ()
This method was deprecated
in API level 34.
Use getCurrentCallEndpoint()
,
onAvailableCallEndpointsChanged(java.util.List)
and
onMuteStateChanged(boolean)
instead.
Returns | |
---|---|
CallAudioState |
The audio state of the conference, describing how its audio is currently
being routed by the system. This is null if this Conference
does not directly know about its audio state. |
getConferenceableConnections
public final List<Connection> getConferenceableConnections ()
Returns the connections with which this connection can be conferenced.
Returns | |
---|---|
List<Connection> |
getConnectionCapabilities
public final int getConnectionCapabilities ()
Returns the capabilities of the conference. See CAPABILITY_*
constants in class
Connection
for valid values.
Returns | |
---|---|
int |
A bitmask of the capabilities of the conference call. |
getConnectionProperties
public final int getConnectionProperties ()
Returns the properties of the conference. See PROPERTY_*
constants in class
Connection
for valid values.
Returns | |
---|---|
int |
A bitmask of the properties of the conference call. |
getConnectionStartElapsedRealtimeMillis
public final long getConnectionStartElapsedRealtimeMillis ()
Retrieves the connection start time of the Conference
, if specified. A value of
CONNECT_TIME_NOT_SPECIFIED
indicates that Telecom should determine the start time
of the conference.
This is based on the value of SystemClock#elapsedRealtime()
to ensure that it is not
impacted by wall clock changes (user initiated, network initiated, time zone change, etc).
Note: This is only exposed for use by the Telephony framework which needs it to copy
conference start times among conference participants. It is exposed as a system API since it
has no general use other than to the Telephony framework.
Value is a non-negative timestamp in the
SystemClock.elapsedRealtime()
time base.
Returns | |
---|---|
long |
The elapsed time at which the Conference was connected.
Value is a non-negative timestamp in the
SystemClock.elapsedRealtime() time base. |
getConnectionTime
public final long getConnectionTime ()
Retrieves the connection start time of the Conference
, if specified. A value of
CONNECT_TIME_NOT_SPECIFIED
indicates that Telecom should determine the start time
of the conference.
Returns | |
---|---|
long |
The time at which the Conference was connected.
Value is 0 or greater |
getConnections
public final List<Connection> getConnections ()
Returns the list of connections currently associated with the conference call.
Returns | |
---|---|
List<Connection> |
A list of Connection objects which represent the children of the conference. |
getCurrentCallEndpoint
public final CallEndpoint getCurrentCallEndpoint ()
Obtains the current CallEndpoint.
Returns | |
---|---|
CallEndpoint |
An object encapsulating the CallEndpoint.
This value cannot be null . |
getDisconnectCause
public final DisconnectCause getDisconnectCause ()
Returns | |
---|---|
DisconnectCause |
The DisconnectCause for this connection. |
getExtras
public final Bundle getExtras ()
Returns the extras associated with this conference.
Extras should be updated using putExtras(android.os.Bundle)
and removeExtras(java.util.List)
.
Telecom or an InCallService
can also update the extras via
Call.putExtras(Bundle)
, and
Call#removeExtras(List)
.
The conference is notified of changes to the extras made by Telecom or an
InCallService
by onExtrasChanged(android.os.Bundle)
.
Returns | |
---|---|
Bundle |
The extras associated with this connection. |
getPhoneAccountHandle
public final PhoneAccountHandle getPhoneAccountHandle ()
Returns the PhoneAccountHandle
the conference call is being placed through.
Returns | |
---|---|
PhoneAccountHandle |
A PhoneAccountHandle object representing the PhoneAccount of the conference. |
getState
public final int getState ()
Gets the state of the conference call. See Connection
for valid values.
Returns | |
---|---|
int |
A constant representing the state the conference call is currently in. |
getStatusHints
public final StatusHints getStatusHints ()
Returns | |
---|---|
StatusHints |
The status hints for this conference. |
getVideoProvider
public Connection.VideoProvider getVideoProvider ()
Returns VideoProvider of the primary call. This can be null.
Returns | |
---|---|
Connection.VideoProvider |
getVideoState
public int getVideoState ()
Returns video state of the primary call.
Returns | |
---|---|
int |
isRingbackRequested
public final boolean isRingbackRequested ()
Returns whether this conference is requesting that the system play a ringback tone on its behalf. A ringback tone may be played when an outgoing conference is in the process of connecting to give the user an audible indication of that process.
Returns | |
---|---|
boolean |
onAddConferenceParticipants
public void onAddConferenceParticipants (List<Uri> participants)
Notifies the Conference
of a request to add a new participants to the conference call
Parameters | |
---|---|
participants |
List : that will be added to this conference call
This value cannot be null . |
onAnswer
public void onAnswer (int videoState)
Notifies this Conference, 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
.
Parameters | |
---|---|
videoState |
int : The video state in which to answer the connection.
Value is either 0 or a combination of VideoProfile.STATE_AUDIO_ONLY , VideoProfile.STATE_TX_ENABLED , VideoProfile.STATE_RX_ENABLED , VideoProfile.STATE_BIDIRECTIONAL , and VideoProfile.STATE_PAUSED |
onAvailableCallEndpointsChanged
public void onAvailableCallEndpointsChanged (List<CallEndpoint> availableEndpoints)
Notifies the Conference
that the available call endpoints have been changed.
Parameters | |
---|---|
availableEndpoints |
List : The available call endpoints.
This value cannot be null . |
onCallAudioStateChanged
public void onCallAudioStateChanged (CallAudioState state)
This method was deprecated
in API level 34.
Use onCallEndpointChanged(android.telecom.CallEndpoint)
,
onAvailableCallEndpointsChanged(java.util.List)
and
onMuteStateChanged(boolean)
instead.
Notifies the Conference
that the getCallAudioState()
property has a new
value.
Parameters | |
---|---|
state |
CallAudioState : The new call audio state. |
onCallEndpointChanged
public void onCallEndpointChanged (CallEndpoint callEndpoint)
Notifies the Conference
that the audio endpoint has been changed.
Parameters | |
---|---|
callEndpoint |
CallEndpoint : The new call endpoint.
This value cannot be null . |
onConnectionAdded
public void onConnectionAdded (Connection connection)
Notifies the Conference
that a Connection
has been added to it.
Parameters | |
---|---|
connection |
Connection : The newly added connection. |
onDisconnect
public void onDisconnect ()
Notifies the Conference
when the Conference and all it's Connection
s should
be disconnected.
onExtrasChanged
public void onExtrasChanged (Bundle extras)
Notifies this Conference
of a change to the extras made outside the
ConnectionService
.
These extras changes can originate from Telecom itself, or from an InCallService
via
Call.putExtras(Bundle)
, and
Call#removeExtras(List)
.
Parameters | |
---|---|
extras |
Bundle : The new extras bundle. |
onHold
public void onHold ()
Notifies the Conference
when it should be put on hold.
onMerge
public void onMerge (Connection connection)
Notifies the Conference
when the specified Connection
should merged with the
conference call.
Parameters | |
---|---|
connection |
Connection : The Connection to merge. |
onMerge
public void onMerge ()
Notifies the Conference
when the child calls should be merged. Only invoked if the
conference contains the capability Connection#CAPABILITY_MERGE_CONFERENCE
.
onMuteStateChanged
public void onMuteStateChanged (boolean isMuted)
Notifies the Conference
that its audio mute state has been changed.
Parameters | |
---|---|
isMuted |
boolean : The new mute state. |
onPlayDtmfTone
public void onPlayDtmfTone (char c)
Notifies the Conference
of a request to play a DTMF tone.
Parameters | |
---|---|
c |
char : A DTMF character. |
onReject
public void onReject ()
Notifies this Conference, 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
.
onSeparate
public void onSeparate (Connection connection)
Notifies the Conference
when the specified Connection
should be separated
from the conference call.
Parameters | |
---|---|
connection |
Connection : The connection to separate. |
onStopDtmfTone
public void onStopDtmfTone ()
Notifies the Conference
of a request to stop any currently playing DTMF tones.
onSwap
public void onSwap ()
Notifies the Conference
when the child calls should be swapped. Only invoked if the
conference contains the capability Connection#CAPABILITY_SWAP_CONFERENCE
.
onUnhold
public void onUnhold ()
Notifies the Conference
when it should be moved from a held to active state.
putExtras
public final void putExtras (Bundle extras)
Adds some extras to this Conference
. 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 . |
removeConnection
public final void removeConnection (Connection connection)
Removes the specified connection as a child of this conference.
Parameters | |
---|---|
connection |
Connection : The connection to remove. |
removeExtras
public final void removeExtras (List<String> keys)
Removes extras from this Conference
.
Parameters | |
---|---|
keys |
List : The keys of the extras to remove. |
removeExtras
public final void removeExtras (String... keys)
Removes extras from this Conference
.
Parameters | |
---|---|
keys |
String : The keys of the extras to remove. |
sendConferenceEvent
public void sendConferenceEvent (String event, Bundle extras)
Sends an event associated with this Conference
with associated event extras to the
InCallService
.
Connection events are used to communicate point in time information from a
ConnectionService
to an InCallService
implementation. 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 Connection#EVENT_MERGE_COMPLETE
connection event when a call to Call#mergeConference()
has completed successfully.
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.
Expected connection events from the Telephony stack are:
Connection#EVENT_CALL_HOLD_FAILED
withnull
extras
when theConference
could not be held.Connection#EVENT_MERGE_START
withnull
extras
when a new call is being merged into the conference.Connection#EVENT_MERGE_COMPLETE
withnull
extras
a new call has completed being merged into the conference.Connection#EVENT_CALL_MERGE_FAILED
withnull
extras
a new call has failed to merge into the conference (the dialer app can determine which call failed to merge based on the fact that the call still exists outside of the conference at the end of the merge process).
Parameters | |
---|---|
event |
String : The conference event.
This value cannot be null . |
extras |
Bundle : Optional bundle containing extra information associated with the event.
This value may be null . |
setConferenceableConnections
public final void setConferenceableConnections (List<Connection> conferenceableConnections)
Sets the connections with which this connection can be conferenced.
Parameters | |
---|---|
conferenceableConnections |
List : The set of connections this connection can conference with. |
setConnectionCapabilities
public final void setConnectionCapabilities (int connectionCapabilities)
Sets the capabilities of a conference. See CAPABILITY_*
constants of class
Connection
for valid values.
Parameters | |
---|---|
connectionCapabilities |
int : A bitmask of the Capabilities of the conference call. |
setConnectionProperties
public final void setConnectionProperties (int connectionProperties)
Sets the properties of a conference. See PROPERTY_*
constants of class
Connection
for valid values.
Parameters | |
---|---|
connectionProperties |
int : A bitmask of the Properties of the conference call. |
setConnectionStartElapsedRealTime
public final void setConnectionStartElapsedRealTime (long connectionStartElapsedRealTime)
This method was deprecated
in API level 30.
use setConnectionStartElapsedRealtimeMillis(long)
instead.
Sets the start time of the Conference
which is the basis for the determining the
duration of the Conference
.
You should use a value returned by SystemClock#elapsedRealtime()
to ensure that time
zone changes do not impact the conference duration.
When setting this, you should also set the connection time via
setConnectionTime(long)
.
Parameters | |
---|---|
connectionStartElapsedRealTime |
long : The connection time, as measured by
SystemClock#elapsedRealtime() . |
setConnectionStartElapsedRealtimeMillis
public final void setConnectionStartElapsedRealtimeMillis (long connectionStartElapsedRealTime)
Sets the start time of the Conference
which is the basis for the determining the
duration of the Conference
.
You should use a value returned by SystemClock#elapsedRealtime()
to ensure that time
zone changes do not impact the conference duration.
When setting this, you should also set the connection time via
setConnectionTime(long)
.
Parameters | |
---|---|
connectionStartElapsedRealTime |
long : The connection time, as measured by
SystemClock#elapsedRealtime() .
Value is a non-negative timestamp in the
SystemClock.elapsedRealtime() time base. |
setConnectionTime
public final void setConnectionTime (long connectionTimeMillis)
Sets the connection start time of the Conference
. This is used in the call log to
indicate the date and time when the conference took place.
Should be specified in wall-clock time returned by System#currentTimeMillis()
.
When setting the connection time, you should always set the connection elapsed time via
setConnectionStartElapsedRealtimeMillis(long)
to ensure the duration is reflected.
Parameters | |
---|---|
connectionTimeMillis |
long : The connection time, in milliseconds, as returned by
System#currentTimeMillis() .
Value is 0 or greater |
setDisconnected
public final void setDisconnected (DisconnectCause disconnectCause)
Sets state to disconnected.
Parameters | |
---|---|
disconnectCause |
DisconnectCause : The reason for the disconnection, as described by
DisconnectCause . |
setExtras
public final void setExtras (Bundle extras)
Replaces all the extras associated with this Conference
.
New or existing keys are replaced in the Conference
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.extras.MY_EXTRA) to avoid conflicts.
Parameters | |
---|---|
extras |
Bundle : The extras associated with this Conference .
This value may be null . |
setRingbackRequested
public final void setRingbackRequested (boolean ringback)
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 conference's audio stream.
Parameters | |
---|---|
ringback |
boolean : Whether the ringback tone is to be played. |
setStatusHints
public final void setStatusHints (StatusHints statusHints)
Sets the label and icon status to display in the InCall UI.
Parameters | |
---|---|
statusHints |
StatusHints : The status label and icon to set. |
setVideoProvider
public final void setVideoProvider (Connection c, Connection.VideoProvider videoProvider)
Sets the video connection provider.
Parameters | |
---|---|
c |
Connection |
videoProvider |
Connection.VideoProvider : The video provider. |
setVideoState
public final void setVideoState (Connection c, int videoState)
Set the video state for the conference.
Valid values: VideoProfile#STATE_AUDIO_ONLY
,
VideoProfile#STATE_BIDIRECTIONAL
,
VideoProfile#STATE_TX_ENABLED
,
VideoProfile#STATE_RX_ENABLED
.
Parameters | |
---|---|
c |
Connection |
videoState |
int : The new video state. |
toString
public String toString ()
Returns a string representation of the object.
Returns | |
---|---|
String |
a string representation of the object. |