InCallService
public
abstract
class
InCallService
extends Service
| java.lang.Object | ||||
| ↳ | android.content.Context | |||
| ↳ | android.content.ContextWrapper | |||
| ↳ | android.app.Service | |||
| ↳ | android.telecom.InCallService | |||
This service is implemented by any app that wishes to provide the user-interface for managing
phone calls. Telecom binds to this service while there exists a live (active or incoming) call,
and uses it to notify the in-call app of any live and recently disconnected calls. An app must
first be set as the default phone app (See getDefaultDialerPackage())
before the telecom service will bind to its InCallService implementation.
Below is an example manifest registration for an InCallService. The meta-data
(METADATA_IN_CALL_SERVICE_UI) indicates that this particular
InCallService implementation intends to replace the built-in in-call UI.
<service android:name="your.package.YourInCallServiceImplementation"
android:permission="android.permission.BIND_INCALL_SERVICE">
<meta-data android:name="android.telecom.IN_CALL_SERVICE_UI" android:value="true" />
<intent-filter>
<action android:name="android.telecom.InCallService"/>
</intent-filter>
</service>
Summary
Nested classes | |
|---|---|
class |
InCallService.VideoCall
Used to issue commands to the |
Constants | |
|---|---|
String |
SERVICE_INTERFACE
The |
Inherited constants | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
android.app.Service
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
android.content.Context
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
android.content.ComponentCallbacks2
|
Public constructors | |
|---|---|
InCallService()
|
|
Public methods | |
|---|---|
final
boolean
|
canAddCall()
Returns if the device can support additional calls. |
final
CallAudioState
|
getCallAudioState()
Obtains the current phone call audio state. |
final
List<Call>
|
getCalls()
Obtains the current list of |
IBinder
|
onBind(Intent intent)
Return the communication channel to the service. |
void
|
onBringToForeground(boolean showDialpad)
Called to bring the in-call screen to the foreground. |
void
|
onCallAdded(Call call)
Called when a |
void
|
onCallAudioStateChanged(CallAudioState audioState)
Called when the audio state changes. |
void
|
onCallRemoved(Call call)
Called when a |
void
|
onCanAddCallChanged(boolean canAddCall)
Called when the ability to add more calls changes. |
void
|
onConnectionEvent(Call call, String event, Bundle extras)
Unused; to handle connection events issued by a |
void
|
onSilenceRinger()
Called to silence the ringer if a ringing call exists. |
boolean
|
onUnbind(Intent intent)
Called when all clients have disconnected from a particular interface published by the service. |
final
void
|
setAudioRoute(int route)
Sets the audio route (speaker, bluetooth, etc...). |
final
void
|
setMuted(boolean state)
Sets the microphone mute state. |
Inherited methods | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
android.app.Service
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
android.content.ContextWrapper
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
android.content.Context
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
java.lang.Object
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
android.content.ComponentCallbacks2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
android.content.ComponentCallbacks
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Constants
SERVICE_INTERFACE
String SERVICE_INTERFACE
The Intent that must be declared as handled by the service.
Constant Value: "android.telecom.InCallService"
Public constructors
Public methods
canAddCall
boolean canAddCall ()
Returns if the device can support additional calls.
| Returns | |
|---|---|
boolean |
Whether the phone supports adding more calls. |
getCallAudioState
CallAudioState getCallAudioState ()
Obtains the current phone call audio state.
| Returns | |
|---|---|
CallAudioState |
An object encapsulating the audio state. Returns null if the service is not fully initialized. |
getCalls
List<Call> getCalls ()
Obtains the current list of Calls to be displayed by this in-call service.
| Returns | |
|---|---|
List<Call> |
A list of the relevant Calls.
|
onBind
IBinder onBind (Intent intent)
Return the communication channel to the service. May return null if
clients can not bind to the service. The returned
IBinder is usually for a complex interface
that has been described using
aidl.
Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process. More information about the main thread can be found in Processes and Threads.
| Parameters | |
|---|---|
intent |
Intent:
The Intent that was used to bind to this service,
as given to Context.bindService. Note that any extras that were included with
the Intent at that point will not be seen here. |
| Returns | |
|---|---|
IBinder |
Return an IBinder through which clients can call on to the service. |
onBringToForeground
void onBringToForeground (boolean showDialpad)
Called to bring the in-call screen to the foreground. The in-call experience should
respond immediately by coming to the foreground to inform the user of the state of
ongoing Calls.
| Parameters | |
|---|---|
showDialpad |
boolean:
If true, put up the dialpad when the screen is shown.
|
onCallAdded
void onCallAdded (Call call)
Called when a Call has been added to this in-call session. The in-call user
experience should add necessary state listeners to the specified Call and
immediately start to show the user information about the existence
and nature of this Call. Subsequent invocations of getCalls() will
include this Call.
| Parameters | |
|---|---|
call |
Call:
A newly added Call.
|
onCallAudioStateChanged
void onCallAudioStateChanged (CallAudioState audioState)
Called when the audio state changes.
| Parameters | |
|---|---|
audioState |
CallAudioState:
The new CallAudioState.
|
onCallRemoved
void onCallRemoved (Call call)
Called when a Call has been removed from this in-call session. The in-call user
experience should remove any state listeners from the specified Call and
immediately stop displaying any information about this Call.
Subsequent invocations of getCalls() will no longer include this Call.
| Parameters | |
|---|---|
call |
Call:
A newly removed Call.
|
onCanAddCallChanged
void onCanAddCallChanged (boolean canAddCall)
Called when the ability to add more calls changes. If the phone cannot
support more calls then canAddCall is set to false. If it can, then it
is set to true. This can be used to control the visibility of UI to add more calls.
| Parameters | |
|---|---|
canAddCall |
boolean:
Indicates whether an additional call can be added.
|
onConnectionEvent
void onConnectionEvent (Call call, String event, Bundle extras)
Unused; to handle connection events issued by a ConnectionService, implement the
onConnectionEvent(Call, String, Bundle) callback.
See sendConnectionEvent(String, Bundle).
| Parameters | |
|---|---|
call |
Call:
The call the event is associated with. |
event |
String:
The event. |
extras |
Bundle:
Any associated extras.
|
onSilenceRinger
void onSilenceRinger ()
Called to silence the ringer if a ringing call exists.
onUnbind
boolean onUnbind (Intent intent)
Called when all clients have disconnected from a particular interface published by the service. The default implementation does nothing and returns false.
| Parameters | |
|---|---|
intent |
Intent:
The Intent that was used to bind to this service,
as given to Context.bindService. Note that any extras that were included with
the Intent at that point will not be seen here. |
| Returns | |
|---|---|
boolean |
Return true if you would like to have the service's
onRebind(Intent) method later called when new clients bind to it.
|
setAudioRoute
void setAudioRoute (int route)
Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will
be change to the getCallAudioState().
| Parameters | |
|---|---|
route |
int:
The audio route to use.
|
setMuted
void setMuted (boolean state)
Sets the microphone mute state. When this request is honored, there will be change to
the getCallAudioState().
| Parameters | |
|---|---|
state |
boolean:
true if the microphone should be muted; false otherwise.
|
Classes
- Call
- Call.Callback
- Call.Details
- CallAudioState
- CallScreeningService
- CallScreeningService.CallResponse
- CallScreeningService.CallResponse.Builder
- Conference
- Conferenceable
- Connection
- Connection.VideoProvider
- ConnectionRequest
- ConnectionService
- DisconnectCause
- GatewayInfo
- InCallService
- InCallService.VideoCall
- InCallService.VideoCall.Callback
- PhoneAccount
- PhoneAccount.Builder
- PhoneAccountHandle
- RemoteConference
- RemoteConference.Callback
- RemoteConnection
- RemoteConnection.Callback
- RemoteConnection.VideoProvider
- RemoteConnection.VideoProvider.Callback
- StatusHints
- TelecomManager
- VideoProfile
- VideoProfile.CameraCapabilities

