Call.Callback  |  API reference  |  Android Developers


public static abstract class Call.Callback
extends Object



Defines callbacks which inform the 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 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 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 Callback, so it is important to register your callback as soon as your InCallService is notified of a new call via InCallService.onCallAdded(Call).

Summary

Constants

int HANDOVER_FAILURE_DEST_APP_REJECTED

Handover failure reason returned via onHandoverFailed(Call,int) when the app to handover the call to rejects the handover request.

int HANDOVER_FAILURE_NOT_SUPPORTED

Handover failure reason returned via onHandoverFailed(Call,int) when a handover is initiated but the source or destination app does not support handover.

int HANDOVER_FAILURE_ONGOING_EMERGENCY_CALL

Handover failure reason returned via onHandoverFailed(Call,int) when there is ongoing emergency call.

int HANDOVER_FAILURE_UNKNOWN

Handover failure reason returned via onHandoverFailed(Call,int) when a handover fails for an unknown reason.

int HANDOVER_FAILURE_USER_REJECTED

Handover failure reason returned via onHandoverFailed(Call,int) when the remote user rejects the handover request.

Public constructors

Callback()

Public methods

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 Calls 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 or Conference.

void onDetailsChanged(Call call, Call.Details details)

Invoked when the details of this Call have changed.

void onHandoverComplete(Call call)

Invoked when Call handover from one PhoneAccount to other PhoneAccount has completed successfully.

void onHandoverFailed(Call call, int failureReason)

Invoked when Call handover from one PhoneAccount to other PhoneAccount has failed.

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 onRttInitiationFailure(Call call, int reason)

Invoked when the RTT session failed to initiate for some reason, including rejection by the remote party.

void onRttModeChanged(Call call, int mode)

Invoked when the RTT mode changes for this call.

void onRttRequest(Call call, int id)

Invoked when the remote end of the connection has requested that an RTT communication channel be opened.

void onRttStatusChanged(Call call, boolean enabled, Call.RttCall rttCall)

Invoked when the call's RTT status changes, either from off to on or from on to off.

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.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

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

void finalize()

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

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

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

final void notifyAll()

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

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

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

final void wait(long timeoutMillis)

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

final void wait()

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

Constants

HANDOVER_FAILURE_ONGOING_EMERGENCY_CALL

public static final int HANDOVER_FAILURE_ONGOING_EMERGENCY_CALL

Handover failure reason returned via onHandoverFailed(Call,int) when there is ongoing emergency call.

This error code is returned when handoverTo(PhoneAccountHandle,int,Bundle) is called on an emergency call, or if any other call is an emergency call.

Handovers are not permitted while there are ongoing emergency calls.

For more information on call handovers, see handoverTo(PhoneAccountHandle,int,Bundle).

Constant Value: 4 (0x00000004)

Public constructors

Callback

public Callback ()

Public methods

onCallDestroyed

public void onCallDestroyed (Call call)

Invoked when the 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.

Parameters
call Call: The Call being destroyed.

onCannedTextResponsesLoaded

public 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. See Call.getCannedTextResponses().

Parameters
call Call: The Call invoking this method.
cannedTextResponses List: The text messages useable as responses.

onChildrenChanged

public void onChildrenChanged (Call call, 
                List<Call> children)

Invoked when the children of this Call have changed. See Call.getChildren().

Parameters
call Call: The Call invoking this method.
children List: The new children of the Call.

onConferenceableCallsChanged

public void onConferenceableCallsChanged (Call call, 
                List<Call> conferenceableCalls)

Invoked upon changes to the set of Calls with which this Call can be conferenced.

Parameters
call Call: The Call being updated.
conferenceableCalls List: The Calls with which this Call can be conferenced.

onDetailsChanged

public void onDetailsChanged (Call call, 
                Call.Details details)

Invoked when the details of this Call have changed. See Call.getDetails().

Parameters
call Call: The Call invoking this method.
details Call.Details: A Details object describing the Call.

onParentChanged

public void onParentChanged (Call call, 
                Call parent)

Invoked when the parent of this Call has changed. See Call.getParent().

Parameters
call Call: The Call invoking this method.
parent Call: The new parent of the Call.

onPostDialWait

public void onPostDialWait (Call call, 
                String remainingPostDialSequence)

Invoked when the post-dial sequence in the outgoing 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.

Parameters
call Call: The Call invoking this method.
remainingPostDialSequence String: The post-dial characters that remain to be sent.

onRttRequest

public void onRttRequest (Call call, 
                int id)

Invoked when the remote end of the connection has requested that an RTT communication channel be opened. A response to this should be sent via Call.respondToRttRequest(int, boolean) with the same ID that this method is invoked with.

Parameters
call Call: The call which the RTT request was placed on
id int: The ID of the request.

onRttStatusChanged

public void onRttStatusChanged (Call call, 
                boolean enabled, 
                Call.RttCall rttCall)

Invoked when the call's RTT status changes, either from off to on or from on to off.

Parameters
call Call: The call whose RTT status has changed.
enabled boolean: whether RTT is now enabled or disabled
rttCall Call.RttCall: the RttCall object to use for reading and writing if RTT is now on, null otherwise.

onVideoCallChanged

public void onVideoCallChanged (Call call, 
                InCallService.VideoCall videoCall)

Invoked when the Call.VideoCall of the Call has changed.

Parameters
call Call: The Call invoking this method.
videoCall InCallService.VideoCall: The Call.VideoCall associated with the Call.