public abstract class InCallService extends Service
TelecomManager.getDefaultDialerPackage()
)
before the telecom service will bind to its InCallService
implementation.
Below is an example manifest registration for an InCallService
. The meta-data
(TelecomManager.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>
Modifier and Type | Class and Description |
---|---|
static class |
InCallService.VideoCall
Used to issue commands to the
Connection.VideoProvider associated with a
Call . |
Service.StartArgFlags, Service.StartResult, Service.StopForegroundFlags
Context.BindServiceFlags, Context.CreatePackageOptions, Context.ServiceName
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_INTERFACE
The
Intent that must be declared as handled by the service. |
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY, START_TASK_REMOVED_COMPLETE, STOP_FOREGROUND_DETACH, STOP_FOREGROUND_REMOVE
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BACKUP_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_ALLOW_WHITELIST_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_FOREGROUND_SERVICE, BIND_FOREGROUND_SERVICE_WHILE_AWAKE, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_NOT_VISIBLE, BIND_SHOWING_UI, BIND_TREAT_LIKE_ACTIVITY, BIND_VISIBLE, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_CREDENTIAL_PROTECTED_STORAGE, CONTEXT_DEVICE_PROTECTED_STORAGE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_REGISTER_PACKAGE, CONTEXT_RESTRICTED, CONTEXTHUB_SERVICE, COUNTRY_DETECTOR, DEVICE_IDLE_CONTROLLER, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, ETHERNET_SERVICE, FINGERPRINT_SERVICE, GATEKEEPER_SERVICE, HARDWARE_PROPERTIES_SERVICE, HDMI_CONTROL_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_POLICY_SERVICE, NETWORK_SCORE_SERVICE, NETWORK_STATS_SERVICE, NETWORKMANAGEMENT_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, PERSISTENT_DATA_BLOCK_SERVICE, POWER_SERVICE, PRINT_SERVICE, RADIO_SERVICE, RECOVERY_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SERIAL_SERVICE, SHORTCUT_SERVICE, SIP_SERVICE, SOUND_TRIGGER_SERVICE, STATUS_BAR_SERVICE, STORAGE_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TRUST_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, UPDATE_LOCK_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, VOICE_INTERACTION_MANAGER_SERVICE, WALLPAPER_SERVICE, WIFI_NAN_SERVICE, WIFI_P2P_SERVICE, WIFI_RTT_SERVICE, WIFI_SCANNING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
Constructor and Description |
---|
InCallService() |
Modifier and Type | Method and Description |
---|---|
boolean |
canAddCall()
Returns if the device can support additional calls.
|
AudioState |
getAudioState()
Deprecated.
Use
getCallAudioState() instead. |
CallAudioState |
getCallAudioState()
Obtains the current phone call audio state.
|
List<Call> |
getCalls()
Obtains the current list of
Call s to be displayed by this in-call service. |
Phone |
getPhone()
Deprecated.
Use direct methods on InCallService instead of
Phone . |
void |
onAudioStateChanged(AudioState audioState)
Deprecated.
Use
instead . |
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
Call has been added to this in-call session. |
void |
onCallAudioStateChanged(CallAudioState audioState)
Called when the audio state changes.
|
void |
onCallRemoved(Call call)
Called when a
Call has been removed from this in-call session. |
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
ConnectionService , implement the
Call.Callback.onConnectionEvent(Call, String, Bundle) callback. |
void |
onPhoneCreated(Phone phone)
Deprecated.
Use direct methods on InCallService instead of
Phone . |
void |
onPhoneDestroyed(Phone phone)
Deprecated.
Use direct methods on InCallService instead of
Phone . |
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.
|
void |
setAudioRoute(int route)
Sets the audio route (speaker, bluetooth, etc...).
|
void |
setMuted(boolean state)
Sets the microphone mute state.
|
attach, dump, getApplication, onConfigurationChanged, onCreate, onDestroy, onLowMemory, onRebind, onStart, onStartCommand, onTaskRemoved, onTrimMemory, setForeground, startForeground, stopForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
attachBaseContext, bindService, bindServiceAsUser, canStartActivityForResult, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, checkUriPermission, clearWallpaper, createApplicationContext, createConfigurationContext, createCredentialProtectedStorageContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createPackageContextAsUser, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getBasePackageName, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getDisplay, getDisplayAdjustments, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSharedPreferences, getSharedPreferencesPath, getSystemService, getSystemServiceName, getTheme, getThemeResId, getUserId, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isCredentialProtectedStorage, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiverAsUser, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendBroadcastAsUser, sendBroadcastMultiplePermissions, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivitiesAsUser, startActivity, startActivity, startActivityAsUser, startActivityAsUser, startActivityForResult, startInstrumentation, startIntentSender, startIntentSender, startService, startServiceAsUser, stopService, stopServiceAsUser, unbindService, unregisterReceiver
bindServiceAsUser, createCredentialEncryptedStorageContext, createDeviceEncryptedStorageContext, getColor, getColorStateList, getDrawable, getSharedPrefsFile, getString, getString, getSystemService, getText, isCredentialEncryptedStorage, isDeviceEncryptedStorage, migrateDatabaseFrom, migrateSharedPreferencesFrom, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
public static final String SERVICE_INTERFACE
Intent
that must be declared as handled by the service.public IBinder onBind(Intent intent)
Service
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.
onBind
in class Service
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.public boolean onUnbind(Intent intent)
Service
onUnbind
in class Service
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.Service.onRebind(android.content.Intent)
method later called when new clients bind to it.@Deprecated public Phone getPhone()
Phone
.Phone
associated with this InCallService
.Phone
object associated with this InCallService
, or null
if the InCallService
is not in a state where it has an associated
Phone
.public final List<Call> getCalls()
Call
s to be displayed by this in-call service.Call
s.public final boolean canAddCall()
@Deprecated public final AudioState getAudioState()
getCallAudioState()
instead.public final CallAudioState getCallAudioState()
public final void setMuted(boolean state)
getCallAudioState()
.state
- true
if the microphone should be muted; false
otherwise.public final void setAudioRoute(int route)
getCallAudioState()
.route
- The audio route to use.@Deprecated public void onPhoneCreated(Phone phone)
Phone
.Phone
has been created. This is a signal to the in-call experience
to start displaying in-call information to the user. Each instance of InCallService
will have only one Phone
, and this method will be called exactly once in the lifetime
of the InCallService
.phone
- The Phone
object associated with this InCallService
.@Deprecated public void onPhoneDestroyed(Phone phone)
Phone
.Phone
has been destroyed. This is a signal to the in-call experience
to stop displaying in-call information to the user. This method will be called exactly once
in the lifetime of the InCallService
, and it will always be called after a previous
call to onPhoneCreated(Phone)
.phone
- The Phone
object associated with this InCallService
.@Deprecated public void onAudioStateChanged(AudioState audioState)
instead
.audioState
- The new AudioState
.public void onCallAudioStateChanged(CallAudioState audioState)
audioState
- The new CallAudioState
.public void onBringToForeground(boolean showDialpad)
Call
s.showDialpad
- If true, put up the dialpad when the screen is shown.public void onCallAdded(Call call)
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
.call
- A newly added Call
.public void onCallRemoved(Call call)
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
.call
- A newly removed Call
.public void onCanAddCallChanged(boolean canAddCall)
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.canAddCall
- Indicates whether an additional call can be added.public void onSilenceRinger()
public void onConnectionEvent(Call call, String event, Bundle extras)
ConnectionService
, implement the
Call.Callback.onConnectionEvent(Call, String, Bundle)
callback.
call
- The call the event is associated with.event
- The event.extras
- Any associated extras.