public abstract static class Call.Callback extends Object
InCallService
of changes to a Call
.
These callbacks can originate from the Telecom framework, or a ConnectionService
implementation.
You can handle these callbacks by extending the Call.Callback
class and overriding the
callbacks that your InCallService
is interested in. The callback methods include the
Call
for which the callback applies, allowing reuse of a single instance of your
Call.Callback
implementation, if desired.
Use Call.registerCallback(Callback)
to register your callback(s). Ensure
Call.unregisterCallback(Callback)
is called when you no longer require callbacks
(typically in InCallService.onCallRemoved(Call)
).
Note: Callbacks which occur before you call Call.registerCallback(Callback)
will not
reach your implementation of Call.Callback
, so it is important to register your callback
as soon as your InCallService
is notified of a new call via
InCallService.onCallAdded(Call)
.
Constructor and Description |
---|
Callback() |
Modifier and Type | Method and Description |
---|---|
void |
onCallDestroyed(Call call)
Invoked when the
Call is destroyed. |
void |
onCannedTextResponsesLoaded(Call call,
List<String> cannedTextResponses)
Invoked when the text messages that can be used as responses to the incoming
Call are loaded from the relevant database. |
void |
onChildrenChanged(Call call,
List<Call> children)
Invoked when the children of this
Call have changed. |
void |
onConferenceableCallsChanged(Call call,
List<Call> conferenceableCalls)
Invoked upon changes to the set of
Call s with which this Call can be
conferenced. |
void |
onConnectionEvent(Call call,
String event,
Bundle extras)
Invoked when a
Call receives an event from its associated Connection . |
void |
onDetailsChanged(Call call,
Call.Details details)
Invoked when the details of this
Call have changed. |
void |
onParentChanged(Call call,
Call parent)
Invoked when the parent of this
Call has changed. |
void |
onPostDialWait(Call call,
String remainingPostDialSequence)
Invoked when the post-dial sequence in the outgoing
Call has reached a pause
character. |
void |
onStateChanged(Call call,
int state)
Invoked when the state of this
Call has changed. |
void |
onVideoCallChanged(Call call,
InCallService.VideoCall videoCall)
Invoked when the
Call.VideoCall of the Call has changed. |
public void onStateChanged(Call call, int state)
Call
has changed. See Call.getState()
.call
- The Call
invoking this method.state
- The new state of the Call
.public void onParentChanged(Call call, Call parent)
Call
has changed. See Call.getParent()
.call
- The Call
invoking this method.parent
- The new parent of the Call
.public void onChildrenChanged(Call call, List<Call> children)
Call
have changed. See Call.getChildren()
.call
- The Call
invoking this method.children
- The new children of the Call
.public void onDetailsChanged(Call call, Call.Details details)
Call
have changed. See Call.getDetails()
.call
- The Call
invoking this method.details
- A Details
object describing the Call
.public void onCannedTextResponsesLoaded(Call call, List<String> cannedTextResponses)
Call
are loaded from the relevant database.
See Call.getCannedTextResponses()
.call
- The Call
invoking this method.cannedTextResponses
- The text messages useable as responses.public void onPostDialWait(Call call, String remainingPostDialSequence)
Call
has reached a pause
character. This causes the post-dial signals to stop pending user confirmation. An
implementation should present this choice to the user and invoke
Call.postDialContinue(boolean)
when the user makes the choice.call
- The Call
invoking this method.remainingPostDialSequence
- The post-dial characters that remain to be sent.public void onVideoCallChanged(Call call, InCallService.VideoCall videoCall)
Call.VideoCall
of the Call
has changed.call
- The Call
invoking this method.videoCall
- The Call.VideoCall
associated with the Call
.public void onCallDestroyed(Call call)
Call
is destroyed. Clients should refrain from cleaning
up their UI for the Call
in response to state transitions. Specifically,
clients should not assume that a onStateChanged(Call, int)
with a state of
Call.STATE_DISCONNECTED
is the final notification the Call
will send. Rather,
clients should wait for this method to be invoked.call
- The Call
being destroyed.public void onConferenceableCallsChanged(Call call, List<Call> conferenceableCalls)
Call
s with which this Call
can be
conferenced.call
- The Call
being updated.conferenceableCalls
- The Call
s with which this Call
can be
conferenced.public void onConnectionEvent(Call call, String event, Bundle extras)
Call
receives an event from its associated Connection
.
Where possible, the Call should make an attempt to handle Connection
events which
are part of the android.telecom.*
namespace. The Call should ignore any events
it does not wish to handle. Unexpected events should be handled gracefully, as it is
possible that a ConnectionService
has defined its own Connection events which a
Call is not aware of.
call
- The Call
receiving the event.event
- The event.extras
- Extras associated with the connection event.