public interface CallActionListener
Known subtypesCallActionAdapter
What the system asks of a call, and what it tells the app about one.
Every method arrives on the EDT. CallActionAdapter implements them all
as no-ops, so an app can override only what it needs.
The ...Requested methods are the user acting through the system’s own
UI – the lock screen, the car, a headset button – rather than through
this app’s. Each carries a CallAction; ignoring it fulfills it, which is
the right behaviour for almost every app. See CallAction for the case
where it is not.
Methods
Method details
answerRequested
public abstract void answerRequested(String callId, CallAction action)audioSessionActivated arrives,
not here.endRequested
public abstract void endRequested(String callId, CallAction action)holdRequested
public abstract void holdRequested(String callId, boolean held, CallAction action)muteRequested
public abstract void muteRequested(String callId, boolean muted, CallAction action)dtmfRequested
public abstract void dtmfRequested(String callId, String digits, CallAction action)startCallRequested
public abstract void startCallRequested(String callId, CallHandle handle, boolean video, CallAction action)The system is asking this app to place a call: the user tapped an
entry in Recents, or asked a voice assistant to call somebody through
this app. No call exists yet – report one with
Calls.reportOutgoing using the id carried here.
Unlike every other action here, an unanswered request is failed rather than fulfilled, and the system call ends. Nothing else can place the call, so reporting success for a request the app ignored would leave it dialing for ever. An app that does not place calls on the system’s behalf can leave this alone; one that does must either report the call or answer the action itself.
audioSessionActivated
public abstract void audioSessionActivated(CallAudioSession session)CallAudioSession for why it is not where the
call is answered.audioSessionDeactivated
public abstract void audioSessionDeactivated(String callId)callEnded
public abstract void callEnded(String callId, CallEndReason reason)providerReset
public abstract void providerReset()Every call this app had is gone.
The system’s call provider was reset, which happens when the user
switches the app’s calling off or the platform recovers from an error.
Tear down media and forget every session, but do not call
CallSession.end on them: they no longer exist as far as the system
is concerned, and ending a call on a reset provider is undefined.
An app that does not implement this leaks its media engine and shows calls that are not there.