Added in API level 21

TelecomManager


open class TelecomManager
kotlin.Any
   ↳ android.telecom.TelecomManager

Provides access to information about active calls and registration/call-management functionality. Apps can use methods in this class to determine the current call state.

Apps do not instantiate this class directly; instead, they retrieve a reference to an instance through android.content.Context#getSystemService.

Note that access to some telecom information is permission-protected. Your app cannot access the protected information or gain access to protected functionality unless it has the appropriate permissions declared in its manifest file. Where permissions apply, they are noted in the method descriptions.
Requires the PackageManager#FEATURE_TELECOM feature which can be detected using PackageManager.hasSystemFeature(String).

Summary

Constants
static String

Activity action: Shows a dialog asking the user whether or not they want to replace the current default Dialer with the one specified in EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME.

static String

The android.content.Intent action used to show the settings page used to configure PhoneAccount preferences.

static String

An android.content.Intent action sent by the telecom framework to start a configuration dialog for a registered PhoneAccount.

static String

Broadcast intent action indicating that the current default call screening app has changed.

static String

Broadcast intent action indicating that the current default dialer has changed.

static String

Activity action: Starts the UI for handing an incoming call.

static String

android.content.Intent action used indicate that a new phone account was just registered.

static String

android.content.Intent action used indicate that a phone account was just unregistered.

static String

Start an activity indicating that the completion of an outgoing call or an incoming call which was not blocked by the CallScreeningService, and which was NOT terminated while the call was in Call.STATE_AUDIO_PROCESSING.

static String

The android.content.Intent action used to show the call accessibility settings page.

static String

The android.content.Intent action used to show the call settings page.

static String

Broadcast intent action for letting custom component know to show the missed call notification.

static String

The android.content.Intent action used to show the respond via SMS settings page.

static Char

The dual tone multi-frequency signaling character sent to indicate the dialing system should pause for a predefined period.

static Char

The dual-tone multi-frequency signaling character sent to indicate the dialing system should wait for user confirmation before proceeding.

static Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was >= 120 seconds.

static Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was >= 60 seconds and < 120 seconds.

static Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was >= 3 seconds and < 60 seconds.

static Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was < 3 seconds.

static String

The number which the party on the other side of the line will see (and use to return the call).

static String

Optional extra for android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED containing the disconnect code.

static String

Optional extra for android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED containing the disconnect message.

static String

A integer value provided for completed calls to indicate the duration of the call.

static String

Extra URI that is used by a dialer to query the android.provider.CallLog content provider and associate a missed call notification with a call log entry.

static String

Optional extra for communicating the call network technology used by a android.telecom.Connection to Telecom and InCallUI.

static String

Optional extra for android.content.Intent#ACTION_CALL containing a string call subject which will be associated with an outgoing call.

static String

Extra value used to provide the package name for ACTION_CHANGE_DEFAULT_DIALER.

static String

Extra value used with ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED broadcast to indicate the ComponentName of the call screening app which has changed.

static String

A integer value provided for completed calls to indicate the reason for the call disconnection.

static String

A Uri extra, which when set on the ACTION_POST_CALL intent, indicates the uri handle(phone number) of the completed call.

static String

A boolean extra set on incoming calls to indicate that the call has a picture specified.

static String

The extra used by a ConnectionService to provide the handle of the caller that has initiated a new incoming call.

static String

Optional extra for ACTION_INCOMING_CALL containing a Bundle which contains metadata about the call.

static String

Optional extra for addNewIncomingCall(android.telecom.PhoneAccountHandle,android.os.Bundle) containing an integer that determines the requested video state for an incoming call.

static String

Extra value used with ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED broadcast to indicate whether an app is the default call screening app.

static String

Extra for the call composer call location, an android.location.Location parcelable class to represent the geolocation as a latitude and longitude pair.

static String

The number of calls associated with the notification.

static String

The number associated with the missed calls.

static String

Optional extra for android.content.Intent#ACTION_CALL and android.content.Intent#ACTION_DIAL Intent containing a Bundle which contains metadata about the call.

static String

A ParcelUuid used as a token to represent a picture that was uploaded prior to the call being placed.

static String

The extra used with an android.content.Intent#ACTION_CALL and android.content.Intent#ACTION_DIAL Intent to specify a PhoneAccountHandle to use when making the call.

static String

A Uri representing the picture that was downloaded when a call is received or uploaded when a call is placed.

static String

Extra for the call composer call priority, either PRIORITY_NORMAL or PRIORITY_URGENT.

static String

A boolean extra, which when set on the Intent.ACTION_CALL intent or on the bundle passed into placeCall(android.net.Uri,android.os.Bundle), indicates that the call should be initiated with an RTT session open.

static String

Optional extra for android.content.Intent#ACTION_CALL containing a boolean that determines whether the speakerphone should be automatically turned on for an outgoing call.

static String

Optional extra for android.content.Intent#ACTION_CALL containing an integer that determines the desired video state for an outgoing call.

static String

The boolean indicated by this extra controls whether or not a call is eligible to undergo assisted dialing.

static String

An optional android.content.Intent#ACTION_CALL intent extra corresponding to the original address to dial for the call.

static String

An optional android.content.Intent#ACTION_CALL intent extra denoting the package name of the app specifying an alternative gateway for the call.

static String

A boolean meta-data value indicating whether an InCallService wants to be informed of calls which have the Call.Details.PROPERTY_IS_EXTERNAL_CALL property.

static String

A boolean meta-data value indicating whether an InCallService wants to be informed of calls which have the Call.Details.PROPERTY_SELF_MANAGED property.

static String

A boolean meta-data value indicating whether an InCallService implements an in-call user interface to be used while the device is in car-mode (see android.content.res.Configuration#UI_MODE_TYPE_CAR).

static String

A boolean meta-data value indicating whether an InCallService implements ringing.

static String

A boolean meta-data value indicating whether an InCallService implements an in-call user interface.

static Int

Indicates that the address or number of a call is allowed to be displayed for caller ID.

static Int

Indicates that the address or number of a call belongs to a pay phone.

static Int

Indicates that the address or number of a call is blocked by the other party.

static Int

Indicates that the address or number of a call is unavailable.

static Int

Indicates that the address or number of a call is not specified or known by the carrier.

static Int

Indicates the call composer call priority is normal.

static Int

Indicates the call composer call priority is urgent.

Public methods
open Unit
acceptHandover(srcAddr: Uri!, videoState: Int, destAcct: PhoneAccountHandle!)

Called by an app to indicate that it wishes to accept the handover of an ongoing call to a PhoneAccountHandle it defines.

open Unit

If there is a ringing incoming call, this method accepts the call on behalf of the user.

open Unit
acceptRingingCall(videoState: Int)

If there is a ringing incoming call, this method accepts the call on behalf of the user, with the specified video state.

open Unit
addCall(callAttributes: CallAttributes, executor: Executor, pendingControl: OutcomeReceiver<CallControl!, CallException!>, handshakes: CallControlCallback, events: CallEventCallback)

Add a call to the Android system service Telecom.

open Unit
addNewIncomingCall(phoneAccount: PhoneAccountHandle!, extras: Bundle!)

Registers a new incoming call.

open Unit

Registers a new incoming conference.

open Unit

Removes the missed-call notification if one is present and marks missed calls in the call log as read.

open Intent!

Creates the Intent which can be used with Context.startActivity(Intent) to launch the activity to manage blocked numbers.

open Boolean

Ends the foreground call on the device.

open Uri!

Returns a URI (with the content:// scheme) specific to the specified PhoneAccount for ADN content retrieval.

open MutableList<PhoneAccountHandle!>!

Returns a list of PhoneAccountHandles which can be used to make and receive phone calls.

open String!

Used to determine the currently selected default dialer package.

open PhoneAccountHandle!

Return the PhoneAccount which will be used to place outgoing calls to addresses with the specified uriScheme.

open String!

Return the line 1 phone number for given phone account.

open MutableList<PhoneAccountHandle!>

Returns a list of PhoneAccountHandles owned by the calling self-managed ConnectionService.

open PhoneAccount!

Return the PhoneAccount for a specified PhoneAccountHandle.

open MutableList<PhoneAccount!>

This API will return all PhoneAccounts the caller registered via TelecomManager.registerPhoneAccount(PhoneAccount).

open MutableList<PhoneAccountHandle!>

Returns a list of PhoneAccountHandles for all self-managed ConnectionServices owned by the calling UserHandle.

open PhoneAccountHandle!

Returns the current SIM call manager.

open PhoneAccountHandle?

Returns current SIM call manager for the Telephony Subscription ID specified.

open String?

Determines the package name of the system-provided default phone app.

open PhoneAccountHandle?

Return the PhoneAccount which is the user-chosen default for making outgoing phone calls.

open String!

Return the voicemail number for a given phone account.

open Boolean
handleMmi(dialString: String!)

Processes the specified dial string as an MMI code.

open Boolean
handleMmi(dialString: String!, accountHandle: PhoneAccountHandle!)

Processes the specified dial string as an MMI code.

open Boolean

Returns whether the caller has android.Manifest.permission#MANAGE_ONGOING_CALLS permission.

open Boolean

Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding states) originating from either a manager or self-managed ConnectionService.

open Boolean

Returns whether there is an ongoing call originating from a managed ConnectionService.

open Boolean

Determines whether Telecom would permit an incoming call to be added via the addNewIncomingCall(android.telecom.PhoneAccountHandle,android.os.Bundle) API for the specified PhoneAccountHandle.

open Boolean

Determines whether Telecom would permit an outgoing call to be placed via the placeCall(android.net.Uri,android.os.Bundle) API for the specified PhoneAccountHandle.

open Boolean

Returns whether TTY is supported on this device.

open Boolean
isVoiceMailNumber(accountHandle: PhoneAccountHandle!, number: String!)

Return whether a given phone number is the configured voicemail number for a particular phone account.

open Unit
placeCall(address: Uri!, extras: Bundle!)

Places a new outgoing call to the provided address using the system telecom service with the specified extras.

open Unit

Register a PhoneAccount for use by the system that will be stored in Device Encrypted storage.

open Unit
showInCallScreen(showDialpad: Boolean)

Brings the in-call screen to the foreground if there is an ongoing call.

open Unit

Silences the ringer if a ringing call exists.

open Unit
startConference(participants: MutableList<Uri!>, extras: Bundle)

Place a new adhoc conference call with the provided participants using the system telecom service.

open Unit

Remove a PhoneAccount registration from the system.

Constants

ACTION_CHANGE_DEFAULT_DIALER

Added in API level 23
static val ACTION_CHANGE_DEFAULT_DIALER: String

Activity action: Shows a dialog asking the user whether or not they want to replace the current default Dialer with the one specified in EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME. Usage example:

Intent intent = new Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER);
  intent.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME,
          getActivity().getPackageName());
  startActivity(intent);
  

This is no longer supported since Q, please use android.app.role.RoleManager#createRequestRoleIntent(String) with android.app.role.RoleManager#ROLE_DIALER instead.

Value: "android.telecom.action.CHANGE_DEFAULT_DIALER"

ACTION_CHANGE_PHONE_ACCOUNTS

Added in API level 23
static val ACTION_CHANGE_PHONE_ACCOUNTS: String

The android.content.Intent action used to show the settings page used to configure PhoneAccount preferences.

Value: "android.telecom.action.CHANGE_PHONE_ACCOUNTS"

ACTION_CONFIGURE_PHONE_ACCOUNT

Added in API level 23
static val ACTION_CONFIGURE_PHONE_ACCOUNT: String

An android.content.Intent action sent by the telecom framework to start a configuration dialog for a registered PhoneAccount. There is no default dialog and each app that registers a PhoneAccount should provide one if desired.

A user can access the list of enabled android.telecom.PhoneAccounts through the Phone app's settings menu. For each entry, the settings app will add a click action. When triggered, the click-action will start this intent along with the extra EXTRA_PHONE_ACCOUNT_HANDLE to indicate the PhoneAccount to configure. If the PhoneAccount package does not register an android.app.Activity for this intent, then it will not be sent.

Value: "android.telecom.action.CONFIGURE_PHONE_ACCOUNT"

ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED

Added in API level 29
static val ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED: String

Broadcast intent action indicating that the current default call screening app has changed.

Note: This intent is NEVER actually broadcast and will be deprecated in the future.

An app that want to know if it holds the android.app.role.RoleManager#ROLE_CALL_SCREENING role can use android.app.role.RoleManager#isRoleHeld(String) to confirm if it holds the role or not.

Value: "android.telecom.action.DEFAULT_CALL_SCREENING_APP_CHANGED"

ACTION_DEFAULT_DIALER_CHANGED

Added in API level 23
static val ACTION_DEFAULT_DIALER_CHANGED: String

Broadcast intent action indicating that the current default dialer has changed. The string extra EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME will contain the name of the package that the default dialer was changed to.

Value: "android.telecom.action.DEFAULT_DIALER_CHANGED"

ACTION_INCOMING_CALL

Added in API level 23
Deprecated in API level 26
static val ACTION_INCOMING_CALL: String

Deprecated: Use addNewIncomingCall instead.

Activity action: Starts the UI for handing an incoming call. This intent starts the in-call UI by notifying the Telecom system that an incoming call exists for a specific call service (see android.telecom.ConnectionService). Telecom reads the Intent extras to find and bind to the appropriate android.telecom.ConnectionService which Telecom will ultimately use to control and get information about the call.

Input: get*Extra field EXTRA_PHONE_ACCOUNT_HANDLE contains the component name of the android.telecom.ConnectionService that Telecom should bind to. Telecom will then ask the connection service for more information about the call prior to showing any UI.

Value: "android.telecom.action.INCOMING_CALL"

ACTION_PHONE_ACCOUNT_REGISTERED

Added in API level 26
static val ACTION_PHONE_ACCOUNT_REGISTERED: String

android.content.Intent action used indicate that a new phone account was just registered.

The Intent extras will contain EXTRA_PHONE_ACCOUNT_HANDLE to indicate which PhoneAccount was registered.

Will only be sent to the default dialer app (see getDefaultDialerPackage()).

Value: "android.telecom.action.PHONE_ACCOUNT_REGISTERED"

ACTION_PHONE_ACCOUNT_UNREGISTERED

Added in API level 26
static val ACTION_PHONE_ACCOUNT_UNREGISTERED: String

android.content.Intent action used indicate that a phone account was just unregistered.

The Intent extras will contain EXTRA_PHONE_ACCOUNT_HANDLE to indicate which PhoneAccount was unregistered.

Will only be sent to the default dialer app (see getDefaultDialerPackage()).

Value: "android.telecom.action.PHONE_ACCOUNT_UNREGISTERED"

ACTION_POST_CALL

Added in API level 30
static val ACTION_POST_CALL: String

Start an activity indicating that the completion of an outgoing call or an incoming call which was not blocked by the CallScreeningService, and which was NOT terminated while the call was in Call.STATE_AUDIO_PROCESSING. The Uri extra EXTRA_HANDLE will contain the uri handle(phone number) for the call which completed. The integer extra EXTRA_DISCONNECT_CAUSE will indicate the reason for the call disconnection. See EXTRA_DISCONNECT_CAUSE for more information. The integer extra EXTRA_CALL_DURATION will indicate the duration of the call. See EXTRA_CALL_DURATION for more information.

Value: "android.telecom.action.POST_CALL"

ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS

Added in API level 23
static val ACTION_SHOW_CALL_ACCESSIBILITY_SETTINGS: String

The android.content.Intent action used to show the call accessibility settings page.

Value: "android.telecom.action.SHOW_CALL_ACCESSIBILITY_SETTINGS"

ACTION_SHOW_CALL_SETTINGS

Added in API level 21
static val ACTION_SHOW_CALL_SETTINGS: String

The android.content.Intent action used to show the call settings page.

Value: "android.telecom.action.SHOW_CALL_SETTINGS"

ACTION_SHOW_MISSED_CALLS_NOTIFICATION

Added in API level 24
static val ACTION_SHOW_MISSED_CALLS_NOTIFICATION: String

Broadcast intent action for letting custom component know to show the missed call notification. If no custom component exists then this is sent to the default dialer which should post a missed-call notification.

Value: "android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION"

ACTION_SHOW_RESPOND_VIA_SMS_SETTINGS

Added in API level 23
static val ACTION_SHOW_RESPOND_VIA_SMS_SETTINGS: String

The android.content.Intent action used to show the respond via SMS settings page.

Value: "android.telecom.action.SHOW_RESPOND_VIA_SMS_SETTINGS"

DTMF_CHARACTER_PAUSE

Added in API level 21
static val DTMF_CHARACTER_PAUSE: Char

The dual tone multi-frequency signaling character sent to indicate the dialing system should pause for a predefined period.

Value: 44

DTMF_CHARACTER_WAIT

Added in API level 21
static val DTMF_CHARACTER_WAIT: Char

The dual-tone multi-frequency signaling character sent to indicate the dialing system should wait for user confirmation before proceeding.

Value: 59

DURATION_LONG

Added in API level 30
static val DURATION_LONG: Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was >= 120 seconds.

Value: 3

DURATION_MEDIUM

Added in API level 30
static val DURATION_MEDIUM: Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was >= 60 seconds and < 120 seconds.

Value: 2

DURATION_SHORT

Added in API level 30
static val DURATION_SHORT: Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was >= 3 seconds and < 60 seconds.

Value: 1

DURATION_VERY_SHORT

Added in API level 30
static val DURATION_VERY_SHORT: Int

A integer value for EXTRA_CALL_DURATION, indicates the duration of the completed call was < 3 seconds.

Value: 0

EXTRA_CALL_BACK_NUMBER

Added in API level 23
static val EXTRA_CALL_BACK_NUMBER: String

The number which the party on the other side of the line will see (and use to return the call).

ConnectionServices which interact with RemoteConnections should only populate this if the android.telephony.TelephonyManager#getLine1Number() value, as that is the user's expected caller ID.

Value: "android.telecom.extra.CALL_BACK_NUMBER"

EXTRA_CALL_DISCONNECT_CAUSE

Added in API level 21
static val EXTRA_CALL_DISCONNECT_CAUSE: String

Optional extra for android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED containing the disconnect code.

Value: "android.telecom.extra.CALL_DISCONNECT_CAUSE"

EXTRA_CALL_DISCONNECT_MESSAGE

Added in API level 21
static val EXTRA_CALL_DISCONNECT_MESSAGE: String

Optional extra for android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED containing the disconnect message.

Value: "android.telecom.extra.CALL_DISCONNECT_MESSAGE"

EXTRA_CALL_DURATION

Added in API level 30
static val EXTRA_CALL_DURATION: String

A integer value provided for completed calls to indicate the duration of the call.

Allowed values:

Value: "android.telecom.extra.CALL_DURATION"

EXTRA_CALL_LOG_URI

Added in API level 35
static val EXTRA_CALL_LOG_URI: String

Extra URI that is used by a dialer to query the android.provider.CallLog content provider and associate a missed call notification with a call log entry.

Value: "android.telecom.extra.CALL_LOG_URI"

EXTRA_CALL_NETWORK_TYPE

Added in API level 29
static val EXTRA_CALL_NETWORK_TYPE: String

Optional extra for communicating the call network technology used by a android.telecom.Connection to Telecom and InCallUI. NETWORK_TYPE_* in android.telephony.TelephonyManager.

Value: "android.telecom.extra.CALL_NETWORK_TYPE"

EXTRA_CALL_SUBJECT

Added in API level 23
static val EXTRA_CALL_SUBJECT: String

Optional extra for android.content.Intent#ACTION_CALL containing a string call subject which will be associated with an outgoing call. Should only be specified if the PhoneAccount supports the capability PhoneAccount.CAPABILITY_CALL_SUBJECT or PhoneAccount.CAPABILITY_CALL_COMPOSER.

Value: "android.telecom.extra.CALL_SUBJECT"

EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME

Added in API level 23
static val EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME: String

Extra value used to provide the package name for ACTION_CHANGE_DEFAULT_DIALER.

Value: "android.telecom.extra.CHANGE_DEFAULT_DIALER_PACKAGE_NAME"

EXTRA_DEFAULT_CALL_SCREENING_APP_COMPONENT_NAME

Added in API level 29
static val EXTRA_DEFAULT_CALL_SCREENING_APP_COMPONENT_NAME: String

Extra value used with ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED broadcast to indicate the ComponentName of the call screening app which has changed.

Note: This extra is NOT used and will be deprecated in the future.

Value: "android.telecom.extra.DEFAULT_CALL_SCREENING_APP_COMPONENT_NAME"

EXTRA_DISCONNECT_CAUSE

Added in API level 30
static val EXTRA_DISCONNECT_CAUSE: String

A integer value provided for completed calls to indicate the reason for the call disconnection.

Allowed values:

Value: "android.telecom.extra.DISCONNECT_CAUSE"

EXTRA_HANDLE

Added in API level 30
static val EXTRA_HANDLE: String

A Uri extra, which when set on the ACTION_POST_CALL intent, indicates the uri handle(phone number) of the completed call.

Value: "android.telecom.extra.HANDLE"

EXTRA_HAS_PICTURE

Added in API level 31
static val EXTRA_HAS_PICTURE: String

A boolean extra set on incoming calls to indicate that the call has a picture specified. Given that image download could take a (short) time, the EXTRA is set immediately upon adding the call to the Dialer app, this allows the Dialer app to reserve space for an image if one is expected. The EXTRA may be unset if the image download ends up failing for some reason.

Value: "android.telecom.extra.HAS_PICTURE"

EXTRA_INCOMING_CALL_ADDRESS

Added in API level 23
static val EXTRA_INCOMING_CALL_ADDRESS: String

The extra used by a ConnectionService to provide the handle of the caller that has initiated a new incoming call.

Value: "android.telecom.extra.INCOMING_CALL_ADDRESS"

EXTRA_INCOMING_CALL_EXTRAS

Added in API level 23
static val EXTRA_INCOMING_CALL_EXTRAS: String

Optional extra for ACTION_INCOMING_CALL containing a Bundle which contains metadata about the call. This Bundle will be returned to the ConnectionService.

Value: "android.telecom.extra.INCOMING_CALL_EXTRAS"

EXTRA_INCOMING_VIDEO_STATE

Added in API level 26
static val EXTRA_INCOMING_VIDEO_STATE: String

Optional extra for addNewIncomingCall(android.telecom.PhoneAccountHandle,android.os.Bundle) containing an integer that determines the requested video state for an incoming call. Valid options: VideoProfile.STATE_AUDIO_ONLY, VideoProfile.STATE_BIDIRECTIONAL, VideoProfile.STATE_RX_ENABLED, VideoProfile.STATE_TX_ENABLED.

Value: "android.telecom.extra.INCOMING_VIDEO_STATE"

EXTRA_IS_DEFAULT_CALL_SCREENING_APP

Added in API level 29
static val EXTRA_IS_DEFAULT_CALL_SCREENING_APP: String

Extra value used with ACTION_DEFAULT_CALL_SCREENING_APP_CHANGED broadcast to indicate whether an app is the default call screening app.

Note: This extra is NOT used and will be deprecated in the future.

Value: "android.telecom.extra.IS_DEFAULT_CALL_SCREENING_APP"

EXTRA_LOCATION

Added in API level 31
static val EXTRA_LOCATION: String

Extra for the call composer call location, an android.location.Location parcelable class to represent the geolocation as a latitude and longitude pair. Reference: RCC.20 Section 2.4.3.2

Value: "android.telecom.extra.LOCATION"

EXTRA_NOTIFICATION_COUNT

Added in API level 24
static val EXTRA_NOTIFICATION_COUNT: String

The number of calls associated with the notification. If the number is zero then the missed call notification should be dismissed.

Value: "android.telecom.extra.NOTIFICATION_COUNT"

EXTRA_NOTIFICATION_PHONE_NUMBER

Added in API level 24
static val EXTRA_NOTIFICATION_PHONE_NUMBER: String

The number associated with the missed calls. This number is only relevant when EXTRA_NOTIFICATION_COUNT is 1.

Value: "android.telecom.extra.NOTIFICATION_PHONE_NUMBER"

EXTRA_OUTGOING_CALL_EXTRAS

Added in API level 23
static val EXTRA_OUTGOING_CALL_EXTRAS: String

Optional extra for android.content.Intent#ACTION_CALL and android.content.Intent#ACTION_DIAL Intent containing a Bundle which contains metadata about the call. This Bundle will be saved into Call.Details and passed to the ConnectionService when placing the call.

Value: "android.telecom.extra.OUTGOING_CALL_EXTRAS"

EXTRA_OUTGOING_PICTURE

Added in API level 31
static val EXTRA_OUTGOING_PICTURE: String

A ParcelUuid used as a token to represent a picture that was uploaded prior to the call being placed. The value of this extra should be set using the android.os.ParcelUuid obtained from the callback in android.telephony.TelephonyManager#uploadCallComposerPicture.

Value: "android.telecom.extra.OUTGOING_PICTURE"

EXTRA_PHONE_ACCOUNT_HANDLE

Added in API level 23
static val EXTRA_PHONE_ACCOUNT_HANDLE: String

The extra used with an android.content.Intent#ACTION_CALL and android.content.Intent#ACTION_DIAL Intent to specify a PhoneAccountHandle to use when making the call.

Retrieve with android.content.Intent#getParcelableExtra(String).

Value: "android.telecom.extra.PHONE_ACCOUNT_HANDLE"

EXTRA_PICTURE_URI

Added in API level 31
static val EXTRA_PICTURE_URI: String

A Uri representing the picture that was downloaded when a call is received or uploaded when a call is placed. This is a content URI within the call log provider which can be used to open a file descriptor. This could be set a short time after a call is added to the Dialer app if the download/upload is delayed for some reason. The Dialer app will receive a callback via Call.Callback.onDetailsChanged when this value has changed. Reference: RCC.20 Section 2.4.3.2

Value: "android.telecom.extra.PICTURE_URI"

EXTRA_PRIORITY

Added in API level 31
static val EXTRA_PRIORITY: String

Extra for the call composer call priority, either PRIORITY_NORMAL or PRIORITY_URGENT. Reference: RCC.20 Section 2.4.4.2

Value: "android.telecom.extra.PRIORITY"

EXTRA_START_CALL_WITH_RTT

Added in API level 26
static val EXTRA_START_CALL_WITH_RTT: String

A boolean extra, which when set on the Intent.ACTION_CALL intent or on the bundle passed into placeCall(android.net.Uri,android.os.Bundle), indicates that the call should be initiated with an RTT session open. See android.telecom.Call.RttCall for more information on RTT.

Value: "android.telecom.extra.START_CALL_WITH_RTT"

EXTRA_START_CALL_WITH_SPEAKERPHONE

Added in API level 21
static val EXTRA_START_CALL_WITH_SPEAKERPHONE: String

Optional extra for android.content.Intent#ACTION_CALL containing a boolean that determines whether the speakerphone should be automatically turned on for an outgoing call.

Value: "android.telecom.extra.START_CALL_WITH_SPEAKERPHONE"

EXTRA_START_CALL_WITH_VIDEO_STATE

Added in API level 23
static val EXTRA_START_CALL_WITH_VIDEO_STATE: String

Optional extra for android.content.Intent#ACTION_CALL containing an integer that determines the desired video state for an outgoing call. Valid options: VideoProfile.STATE_AUDIO_ONLY, VideoProfile.STATE_BIDIRECTIONAL, VideoProfile.STATE_RX_ENABLED, VideoProfile.STATE_TX_ENABLED.

Value: "android.telecom.extra.START_CALL_WITH_VIDEO_STATE"

EXTRA_USE_ASSISTED_DIALING

Added in API level 30
static val EXTRA_USE_ASSISTED_DIALING: String

The boolean indicated by this extra controls whether or not a call is eligible to undergo assisted dialing. This extra is stored under EXTRA_OUTGOING_CALL_EXTRAS.

The call initiator can use this extra to indicate that a call used assisted dialing to help place the call. This is most commonly used by a Dialer app which provides the ability to automatically add dialing prefixes when placing international calls.

Setting this extra on the outgoing call extras will cause the Connection.PROPERTY_ASSISTED_DIALING property and Call.Details.PROPERTY_ASSISTED_DIALING property to be set on the Connection/Call in question. When the call is logged to the call log, the android.provider.CallLog.Calls#FEATURES_ASSISTED_DIALING_USED call feature is set to indicate that assisted dialing was used for the call.

Value: "android.telecom.extra.USE_ASSISTED_DIALING"

GATEWAY_ORIGINAL_ADDRESS

Added in API level 21
static val GATEWAY_ORIGINAL_ADDRESS: String

An optional android.content.Intent#ACTION_CALL intent extra corresponding to the original address to dial for the call. This is used when an alternative gateway address is provided to recall the original address. The value is a android.net.Uri. (See GATEWAY_PROVIDER_PACKAGE for details)

Value: "android.telecom.extra.GATEWAY_ORIGINAL_ADDRESS"

GATEWAY_PROVIDER_PACKAGE

Added in API level 21
static val GATEWAY_PROVIDER_PACKAGE: String

An optional android.content.Intent#ACTION_CALL intent extra denoting the package name of the app specifying an alternative gateway for the call. The value is a string. (The following comment corresponds to the all GATEWAY_* extras) An app which sends the android.content.Intent#ACTION_CALL intent can specify an alternative address to dial which is different from the one specified and displayed to the user. This alternative address is referred to as the gateway address.

Value: "android.telecom.extra.GATEWAY_PROVIDER_PACKAGE"

METADATA_INCLUDE_EXTERNAL_CALLS

Added in API level 25
static val METADATA_INCLUDE_EXTERNAL_CALLS: String

A boolean meta-data value indicating whether an InCallService wants to be informed of calls which have the Call.Details.PROPERTY_IS_EXTERNAL_CALL property. An external call is one which a ConnectionService knows about, but is not connected to directly. Dialer implementations (see getDefaultDialerPackage()) which would like to be informed of external calls should set this meta-data to true in the manifest registration of their InCallService. By default, the InCallService will NOT be informed of external calls.

Value: "android.telecom.INCLUDE_EXTERNAL_CALLS"

METADATA_INCLUDE_SELF_MANAGED_CALLS

Added in API level 26
static val METADATA_INCLUDE_SELF_MANAGED_CALLS: String

A boolean meta-data value indicating whether an InCallService wants to be informed of calls which have the Call.Details.PROPERTY_SELF_MANAGED property. A self-managed call is one which originates from a self-managed ConnectionService which has chosen to implement its own call user interface. An InCallService implementation which would like to be informed of external calls should set this meta-data to true in the manifest registration of their InCallService. By default, the InCallService will NOT be informed about self-managed calls.

An InCallService which receives self-managed calls is free to view and control the state of calls in the self-managed ConnectionService. An example use-case is exposing these calls to an automotive device via its companion app.

See also Connection.PROPERTY_SELF_MANAGED.

Value: "android.telecom.INCLUDE_SELF_MANAGED_CALLS"

METADATA_IN_CALL_SERVICE_CAR_MODE_UI

Added in API level 29
static val METADATA_IN_CALL_SERVICE_CAR_MODE_UI: String

A boolean meta-data value indicating whether an InCallService implements an in-call user interface to be used while the device is in car-mode (see android.content.res.Configuration#UI_MODE_TYPE_CAR).

Value: "android.telecom.IN_CALL_SERVICE_CAR_MODE_UI"

METADATA_IN_CALL_SERVICE_RINGING

Added in API level 24
static val METADATA_IN_CALL_SERVICE_RINGING: String

A boolean meta-data value indicating whether an InCallService implements ringing. Dialer implementations (see getDefaultDialerPackage()) which would also like to override the system provided ringing should set this meta-data to true in the manifest registration of their InCallService.

When true, it is the InCallService's responsibility to play a ringtone for all incoming calls.

Value: "android.telecom.IN_CALL_SERVICE_RINGING"

METADATA_IN_CALL_SERVICE_UI

Added in API level 23
static val METADATA_IN_CALL_SERVICE_UI: String

A boolean meta-data value indicating whether an InCallService implements an in-call user interface. Dialer implementations (see getDefaultDialerPackage()) which would also like to replace the in-call interface should set this meta-data to true in the manifest registration of their InCallService.

Value: "android.telecom.IN_CALL_SERVICE_UI"

PRESENTATION_ALLOWED

Added in API level 21
static val PRESENTATION_ALLOWED: Int

Indicates that the address or number of a call is allowed to be displayed for caller ID.

Value: 1

PRESENTATION_PAYPHONE

Added in API level 21
static val PRESENTATION_PAYPHONE: Int

Indicates that the address or number of a call belongs to a pay phone.

Value: 4

PRESENTATION_RESTRICTED

Added in API level 21
static val PRESENTATION_RESTRICTED: Int

Indicates that the address or number of a call is blocked by the other party.

Value: 2

PRESENTATION_UNAVAILABLE

Added in API level 33
static val PRESENTATION_UNAVAILABLE: Int

Indicates that the address or number of a call is unavailable.

Value: 5

PRESENTATION_UNKNOWN

Added in API level 21
static val PRESENTATION_UNKNOWN: Int

Indicates that the address or number of a call is not specified or known by the carrier.

Value: 3

PRIORITY_NORMAL

Added in API level 31
static val PRIORITY_NORMAL: Int

Indicates the call composer call priority is normal. Reference: RCC.20 Section 2.4.4.2

Value: 0

PRIORITY_URGENT

Added in API level 31
static val PRIORITY_URGENT: Int

Indicates the call composer call priority is urgent. Reference: RCC.20 Section 2.4.4.2

Value: 1

Public methods

acceptHandover

Added in API level 28
open fun acceptHandover(
    srcAddr: Uri!,
    videoState: Int,
    destAcct: PhoneAccountHandle!
): Unit

Called by an app to indicate that it wishes to accept the handover of an ongoing call to a PhoneAccountHandle it defines.

A call handover is the process where an ongoing call is transferred from one app (i.e. ConnectionService to another app. The user could, for example, choose to continue a mobile network call in a video calling app. The mobile network call via the Telephony stack is referred to as the source of the handover, and the video calling app is referred to as the destination.

When considering a handover scenario the initiating device is where a user initiated the handover process (e.g. by calling android.telecom.Call#handoverTo( * PhoneAccountHandle, int, Bundle), and the other device is considered the receiving device.

For a full discussion of the handover process and the APIs involved, see android.telecom.Call#handoverTo(PhoneAccountHandle, int, Bundle).

This method is called from the receiving side of a handover to indicate a desire to accept the handover of an ongoing call to another ConnectionService identified by PhoneAccountHandle destAcct. For managed ConnectionServices, the specified PhoneAccountHandle must have been registered with registerPhoneAccount and the user must have enabled the corresponding PhoneAccount. This can be checked using getPhoneAccount. Self-managed ConnectionServices must have android.Manifest.permission#MANAGE_OWN_CALLS to handover a call to it.

Once invoked, this method will cause the system to bind to the ConnectionService associated with the PhoneAccountHandle destAcct and call (See ConnectionService.onCreateIncomingHandoverConnection).

For a managed ConnectionService, a SecurityException will be thrown if either the PhoneAccountHandle destAcct does not correspond to a registered PhoneAccount or the associated PhoneAccount is not currently enabled by the user.

For a self-managed ConnectionService, a SecurityException will be thrown if the calling app does not have android.Manifest.permission#MANAGE_OWN_CALLS.

Parameters
srcAddr Uri!: The android.net.Uri of the ongoing call to handover to the caller’s ConnectionService.
videoState Int: Video state after the handover. Value is either 0 or a combination of android.telecom.VideoProfile#STATE_AUDIO_ONLY, android.telecom.VideoProfile#STATE_TX_ENABLED, android.telecom.VideoProfile#STATE_RX_ENABLED, android.telecom.VideoProfile#STATE_BIDIRECTIONAL, and android.telecom.VideoProfile#STATE_PAUSED
destAcct PhoneAccountHandle!: The PhoneAccountHandle registered to the calling package.

acceptRingingCall

Added in API level 26
Deprecated in API level 29
open fun acceptRingingCall(): Unit

Deprecated: Companion apps for wearable devices should use the InCallService API instead.

If there is a ringing incoming call, this method accepts the call on behalf of the user. If the incoming call is a video call, the call will be answered with the same video state as the incoming call requests. This means, for example, that an incoming call requesting VideoProfile.STATE_BIDIRECTIONAL will be answered, accepting that state.
Requires android.Manifest.permission#ANSWER_PHONE_CALLS or android.Manifest.permission#MODIFY_PHONE_STATE

acceptRingingCall

Added in API level 26
Deprecated in API level 29
open fun acceptRingingCall(videoState: Int): Unit

Deprecated: Companion apps for wearable devices should use the InCallService API instead.

If there is a ringing incoming call, this method accepts the call on behalf of the user, with the specified video state.
Requires android.Manifest.permission#ANSWER_PHONE_CALLS or android.Manifest.permission#MODIFY_PHONE_STATE

Parameters
videoState Int: The desired video state to answer the call with.

addCall

Added in API level 34
open fun addCall(
    callAttributes: CallAttributes,
    executor: Executor,
    pendingControl: OutcomeReceiver<CallControl!, CallException!>,
    handshakes: CallControlCallback,
    events: CallEventCallback
): Unit

Add a call to the Android system service Telecom. This allows the system to start tracking an incoming or outgoing call with the specified CallAttributes. Once a call is added, a android.app.Notification.CallStyle notification should be posted and when the call is ready to be disconnected, use CallControl.disconnect(DisconnectCause, which is provided by the pendingControl#onResult(CallControl).

Call Lifecycle: Your app is given foreground execution priority as long as you have a valid call and are posting a android.app.Notification.CallStyle notification. When your application is given foreground execution priority, your app is treated as a foreground service. Foreground execution priority will prevent the android.app.ActivityManager from killing your application when it is placed the background. Foreground execution priority is removed from your app when all of your app's calls terminate or your app no longer posts a valid notification.

Note: Only packages that register with PhoneAccount.CAPABILITY_SUPPORTS_TRANSACTIONAL_OPERATIONS can utilize this API. PhoneAccounts that set the capabilities PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION, PhoneAccount.CAPABILITY_CALL_PROVIDER, PhoneAccount.CAPABILITY_CONNECTION_MANAGER are not supported and will cause an exception to be thrown.

Usage example:

// Its up to your app on how you want to wrap the objects. One such implementation can be:
   class MyVoipCall {
     ...
       public CallControlCallEventCallback handshakes = new  CallControlCallback() {
                          ...
                         }
 
       public CallEventCallback events = new CallEventCallback() {
                          ...
                         }
 
       public MyVoipCall(String id){
           ...
       }
   }
 
  MyVoipCall myFirstOutgoingCall = new MyVoipCall("1");
 
  telecomManager.addCall(callAttributes,
                         Runnable::run,
                         new OutcomeReceiver() {
                               public void onResult(CallControl callControl) {
                                  // The call has been added successfully. For demonstration
                                  // purposes, the call is disconnected immediately ...
                                  callControl.disconnect(
                                                  new DisconnectCause(DisconnectCause.LOCAL) )
                               }
                            },
                            myFirstOutgoingCall.handshakes,
                            myFirstOutgoingCall.events);
  

Requires android.Manifest.permission#MANAGE_OWN_CALLS
Parameters
callAttributes CallAttributes: attributes of the new call (incoming or outgoing, address, etc.) This value cannot be null.
executor Executor: execution context to run CallControlCallback updates on This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.
pendingControl OutcomeReceiver<CallControl!, CallException!>: Receives the result of addCall transaction. Upon success, a CallControl object is provided which can be used to do things like disconnect the call that was added. This value cannot be null.
handshakes CallControlCallback: callback that receives actionable updates that originate from Telecom. This value cannot be null.
events CallEventCallback: callback that receives non-actionable updates that originate from Telecom. This value cannot be null.

addNewIncomingCall

Added in API level 23
open fun addNewIncomingCall(
    phoneAccount: PhoneAccountHandle!,
    extras: Bundle!
): Unit

Registers a new incoming call. A ConnectionService should invoke this method when it has an incoming call. For managed ConnectionServices, the specified PhoneAccountHandle must have been registered with registerPhoneAccount and the user must have enabled the corresponding PhoneAccount. This can be checked using getPhoneAccount. Self-managed ConnectionServices must have android.Manifest.permission#MANAGE_OWN_CALLS to add a new incoming call.

Specify the address associated with the incoming call using EXTRA_INCOMING_CALL_ADDRESS. If an incoming call is from an anonymous source, omit this extra and ensure you specify a valid number presentation via Connection.setAddress(Uri, int) on the Connection instance you return in your ConnectionService.onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest) implementation.

The incoming call you are adding is assumed to have a video state of VideoProfile.STATE_AUDIO_ONLY, unless the extra value EXTRA_INCOMING_VIDEO_STATE is specified.

Once invoked, this method will cause the system to bind to the ConnectionService associated with the PhoneAccountHandle and request additional information about the call (See ConnectionService.onCreateIncomingConnection) before starting the incoming call UI.

For a managed ConnectionService, a SecurityException will be thrown if either the PhoneAccountHandle does not correspond to a registered PhoneAccount or the associated PhoneAccount is not currently enabled by the user.

For a self-managed ConnectionService, a SecurityException will be thrown if the PhoneAccount has PhoneAccount.CAPABILITY_SELF_MANAGED and the calling app does not have android.Manifest.permission#MANAGE_OWN_CALLS.

Note: android.app.Notification.CallStyle notifications should be posted after the call is added to Telecom in order for the notification to be non-dismissible.

Parameters
phoneAccount PhoneAccountHandle!: A PhoneAccountHandle registered with registerPhoneAccount.
extras Bundle!: A bundle that will be passed through to ConnectionService.onCreateIncomingConnection.

addNewIncomingConference

Added in API level 31
open fun addNewIncomingConference(
    phoneAccount: PhoneAccountHandle,
    extras: Bundle
): Unit

Registers a new incoming conference. A ConnectionService should invoke this method when it has an incoming conference. An incoming Conference is an adhoc conference call initiated on another device which the user is being invited to join in. For managed ConnectionServices, the specified PhoneAccountHandle must have been registered with registerPhoneAccount and the user must have enabled the corresponding PhoneAccount. This can be checked using getPhoneAccount(android.telecom.PhoneAccountHandle). Self-managed ConnectionServices must have android.Manifest.permission#MANAGE_OWN_CALLS to add a new incoming call.

The incoming conference you are adding is assumed to have a video state of VideoProfile.STATE_AUDIO_ONLY, unless the extra value EXTRA_INCOMING_VIDEO_STATE is specified.

Once invoked, this method will cause the system to bind to the ConnectionService associated with the PhoneAccountHandle and request additional information about the call (See ConnectionService.onCreateIncomingConference(PhoneAccountHandle, ConnectionRequest)) before starting the incoming call UI.

For a managed ConnectionService, a SecurityException will be thrown if either the PhoneAccountHandle does not correspond to a registered PhoneAccount or the associated PhoneAccount is not currently enabled by the user.

Parameters
phoneAccount PhoneAccountHandle: A PhoneAccountHandle registered with registerPhoneAccount. This value cannot be null.
extras Bundle: A bundle that will be passed through to ConnectionService.onCreateIncomingConference. This value cannot be null.

cancelMissedCallsNotification

Added in API level 21
open fun cancelMissedCallsNotification(): Unit

Removes the missed-call notification if one is present and marks missed calls in the call log as read.

Requires that the method-caller be set as the default dialer app.


Requires android.Manifest.permission#MODIFY_PHONE_STATE

createManageBlockedNumbersIntent

Added in API level 24
open fun createManageBlockedNumbersIntent(): Intent!

Creates the Intent which can be used with Context.startActivity(Intent) to launch the activity to manage blocked numbers.

The activity will display the UI to manage blocked numbers only if android.provider.BlockedNumberContract#canCurrentUserBlockNumbers(Context) returns true for the current user.

endCall

Added in API level 28
Deprecated in API level 29
open fun endCall(): Boolean

Deprecated: Companion apps for wearable devices should use the InCallService API instead. Apps performing call screening should use the CallScreeningService API instead.

Ends the foreground call on the device.

If there is a ringing call, calling this method rejects the ringing call. Otherwise the foreground call is ended.

Note: this method CANNOT be used to end ongoing emergency calls and will return false if an attempt is made to end an emergency call.
Requires android.Manifest.permission#ANSWER_PHONE_CALLS

Return
Boolean true if there is a call which will be rejected or terminated, false otherwise.

getAdnUriForPhoneAccount

Added in API level 23
open fun getAdnUriForPhoneAccount(accountHandle: PhoneAccountHandle!): Uri!

Returns a URI (with the content:// scheme) specific to the specified PhoneAccount for ADN content retrieval.
Requires android.Manifest.permission#MODIFY_PHONE_STATE

Parameters
accountHandle PhoneAccountHandle!: The handle for the account to derive an adn query URI for or null to return a URI which will use the default account.
Return
Uri! The URI (with the content:// scheme) specific to the specified PhoneAccount for the the content retrieve.

getCallCapablePhoneAccounts

Added in API level 23
open fun getCallCapablePhoneAccounts(): MutableList<PhoneAccountHandle!>!

Returns a list of PhoneAccountHandles which can be used to make and receive phone calls. The returned list includes only those accounts which have been explicitly enabled by the user.
Requires android.Manifest.permission#READ_PHONE_STATE

Return
MutableList<PhoneAccountHandle!>! A list of PhoneAccountHandle objects.

getDefaultDialerPackage

Added in API level 23
open fun getDefaultDialerPackage(): String!

Used to determine the currently selected default dialer package.

Return
String! package name for the default dialer package or null if no package has been selected as the default dialer.

getDefaultOutgoingPhoneAccount

Added in API level 23
open fun getDefaultOutgoingPhoneAccount(uriScheme: String!): PhoneAccountHandle!

Return the PhoneAccount which will be used to place outgoing calls to addresses with the specified uriScheme. This PhoneAccount will always be a member of the list which is returned from invoking getCallCapablePhoneAccounts(). The specific account returned depends on the following priorities:

  • If the user-selected default PhoneAccount supports the specified scheme, it will be returned.
  • If there exists only one PhoneAccount that supports the specified scheme, it will be returned.

If no PhoneAccount fits the criteria above, this method will return null.
Requires android.Manifest.permission#READ_PHONE_STATE

Parameters
uriScheme String!: The URI scheme.
Return
PhoneAccountHandle! The PhoneAccountHandle corresponding to the account to be used.

getLine1Number

Added in API level 23
Deprecated in API level 33
open fun getLine1Number(accountHandle: PhoneAccountHandle!): String!

Deprecated: use SubscriptionManager.getPhoneNumber(int) instead, which takes a Telephony Subscription ID that can be retrieved with the accountHandle from TelephonyManager.getSubscriptionId(PhoneAccountHandle).

Return the line 1 phone number for given phone account.

Requires Permission: READ_SMS, READ_PHONE_NUMBERS, or that the caller is the default SMS app for any API level. READ_PHONE_STATE for apps targeting SDK API level 29 and below.

Parameters
accountHandle PhoneAccountHandle!: The handle for the account retrieve a number for.
Return
String! A string representation of the line 1 phone number.

getOwnSelfManagedPhoneAccounts

Added in API level 33
open fun getOwnSelfManagedPhoneAccounts(): MutableList<PhoneAccountHandle!>

Returns a list of PhoneAccountHandles owned by the calling self-managed ConnectionService.

Self-Managed ConnectionServices have a PhoneAccount with PhoneAccount.CAPABILITY_SELF_MANAGED.

Requires permission android.Manifest.permission#MANAGE_OWN_CALLS

A SecurityException will be thrown if a caller lacks the android.Manifest.permission#MANAGE_OWN_CALLS permission.
Requires android.Manifest.permission#MANAGE_OWN_CALLS

Return
MutableList<PhoneAccountHandle!> A list of PhoneAccountHandle objects. This value cannot be null.

getPhoneAccount

Added in API level 23
open fun getPhoneAccount(account: PhoneAccountHandle!): PhoneAccount!

Return the PhoneAccount for a specified PhoneAccountHandle. Object includes resources which can be used in a user interface. Requires Permission: android.Manifest.permission#READ_PHONE_NUMBERS for applications targeting API level 31+.

Parameters
account PhoneAccountHandle!: The PhoneAccountHandle.
Return
PhoneAccount! The PhoneAccount object.

getRegisteredPhoneAccounts

Added in API level 35
open fun getRegisteredPhoneAccounts(): MutableList<PhoneAccount!>

This API will return all PhoneAccounts the caller registered via TelecomManager.registerPhoneAccount(PhoneAccount). If a PhoneAccount appears to be missing from the list, Telecom has either unregistered the PhoneAccount (for cleanup purposes) or the caller registered the PhoneAccount under a different user and does not have the android.Manifest.permission#INTERACT_ACROSS_USERS permission. Note: This API will only return PhoneAccounts registered by the same app. For system Dialers that need all the PhoneAccounts registered by every application, see android.telecom.TelecomManager#getAllPhoneAccounts().

Return
MutableList<PhoneAccount!> all the PhoneAccounts registered by the caller. This value cannot be null.

getSelfManagedPhoneAccounts

Added in API level 26
open fun getSelfManagedPhoneAccounts(): MutableList<PhoneAccountHandle!>

Returns a list of PhoneAccountHandles for all self-managed ConnectionServices owned by the calling UserHandle.

Self-Managed ConnectionServices have a PhoneAccount with PhoneAccount.CAPABILITY_SELF_MANAGED.

Requires permission android.Manifest.permission#READ_PHONE_STATE, or that the caller is the default dialer app.

A SecurityException will be thrown if a called is not the default dialer, or lacks the android.Manifest.permission#READ_PHONE_STATE permission.
Requires android.Manifest.permission#READ_PHONE_STATE

Return
MutableList<PhoneAccountHandle!> A list of PhoneAccountHandle objects. This value cannot be null.

getSimCallManager

Added in API level 23
open fun getSimCallManager(): PhoneAccountHandle!

Returns the current SIM call manager. Apps must be prepared for this method to return null, indicating that there currently exists no SIM call manager PhoneAccount for the default voice subscription.

Return
PhoneAccountHandle! The phone account handle of the current sim call manager for the default voice subscription.

getSimCallManagerForSubscription

Added in API level 30
open fun getSimCallManagerForSubscription(subscriptionId: Int): PhoneAccountHandle?

Returns current SIM call manager for the Telephony Subscription ID specified. Apps must be prepared for this method to return null, indicating that there currently exists no SIM call manager PhoneAccount for the subscription specified.

Parameters
subscriptionId Int: The Telephony Subscription ID that the SIM call manager should be queried for.
Return
PhoneAccountHandle? The phone account handle of the current sim call manager.

getSystemDialerPackage

Added in API level 29
open fun getSystemDialerPackage(): String?

Determines the package name of the system-provided default phone app.

Return
String? package name for the system dialer package or null if no system dialer is preloaded.

getUserSelectedOutgoingPhoneAccount

Added in API level 29
open fun getUserSelectedOutgoingPhoneAccount(): PhoneAccountHandle?

Return the PhoneAccount which is the user-chosen default for making outgoing phone calls. This PhoneAccount will always be a member of the list which is returned from calling getCallCapablePhoneAccounts()

Apps must be prepared for this method to return null, indicating that there currently exists no user-chosen default PhoneAccount.

The default dialer has access to use this method.
Requires android.Manifest.permission#READ_PHONE_STATE

Return
PhoneAccountHandle? The user outgoing phone account selected by the user, or null if there is no user selected outgoing PhoneAccountHandle.

getVoiceMailNumber

Added in API level 23
open fun getVoiceMailNumber(accountHandle: PhoneAccountHandle!): String!

Return the voicemail number for a given phone account.
Requires android.Manifest.permission#READ_PHONE_STATE

Parameters
accountHandle PhoneAccountHandle!: The handle for the phone account.
Return
String! The voicemail number for the phone account, and null if one has not been configured.

handleMmi

Added in API level 21
open fun handleMmi(dialString: String!): Boolean

Processes the specified dial string as an MMI code. MMI codes are any sequence of characters entered into the dialpad that contain a "*" or "#". Some of these sequences launch special behavior through handled by Telephony. This method uses the default subscription.

Requires that the method-caller be set as the system dialer app.


Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING feature which can be detected using PackageManager.hasSystemFeature(String).
Parameters
dialString String!: The digits to dial.
Return
Boolean True if the digits were processed as an MMI code, false otherwise.

handleMmi

Added in API level 23
open fun handleMmi(
    dialString: String!,
    accountHandle: PhoneAccountHandle!
): Boolean

Processes the specified dial string as an MMI code. MMI codes are any sequence of characters entered into the dialpad that contain a "*" or "#". Some of these sequences launch special behavior through handled by Telephony.

Requires that the method-caller be set as the system dialer app.


Requires android.Manifest.permission#MODIFY_PHONE_STATE
Requires the PackageManager#FEATURE_TELEPHONY_CALLING feature which can be detected using PackageManager.hasSystemFeature(String).
Parameters
accountHandle PhoneAccountHandle!: The handle for the account the MMI code should apply to.
dialString String!: The digits to dial.
Return
Boolean True if the digits were processed as an MMI code, false otherwise.

hasManageOngoingCallsPermission

Added in API level 31
open fun hasManageOngoingCallsPermission(): Boolean

Returns whether the caller has android.Manifest.permission#MANAGE_ONGOING_CALLS permission. The permission can be obtained by associating with a physical wearable device via the android.companion.CompanionDeviceManager API as a companion app. If the caller app has the permission, it has InCallService access to manage ongoing calls.

Return
Boolean true if the caller has InCallService access for companion app; false otherwise.

isInCall

Added in API level 21
open fun isInCall(): Boolean

Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding states) originating from either a manager or self-managed ConnectionService.
Requires android.Manifest.permission#READ_PHONE_STATE

Return
Boolean true if there is an ongoing call in either a managed or self-managed ConnectionService, false otherwise.

isInManagedCall

Added in API level 26
open fun isInManagedCall(): Boolean

Returns whether there is an ongoing call originating from a managed ConnectionService. An ongoing call can be in dialing, ringing, active or holding states.

If you also need to know if there are ongoing self-managed calls, use isInCall() instead.
Requires android.Manifest.permission#READ_PHONE_STATE

Return
Boolean true if there is an ongoing call in a managed ConnectionService, false otherwise.

isIncomingCallPermitted

Added in API level 26
open fun isIncomingCallPermitted(phoneAccountHandle: PhoneAccountHandle!): Boolean

Determines whether Telecom would permit an incoming call to be added via the addNewIncomingCall(android.telecom.PhoneAccountHandle,android.os.Bundle) API for the specified PhoneAccountHandle.

A ConnectionService may not add a call for the specified PhoneAccountHandle in the following situations:

Parameters
phoneAccountHandle PhoneAccountHandle!: The PhoneAccountHandle the call will be added for.
Return
Boolean true if telecom will permit an incoming call to be added, false otherwise.

isOutgoingCallPermitted

Added in API level 26
open fun isOutgoingCallPermitted(phoneAccountHandle: PhoneAccountHandle!): Boolean

Determines whether Telecom would permit an outgoing call to be placed via the placeCall(android.net.Uri,android.os.Bundle) API for the specified PhoneAccountHandle.

A ConnectionService may not place a call for the specified PhoneAccountHandle in the following situations:

Parameters
phoneAccountHandle PhoneAccountHandle!: The PhoneAccountHandle the call will be added for.
Return
Boolean true if telecom will permit an outgoing call to be placed, false otherwise.

isTtySupported

Added in API level 28
open fun isTtySupported(): Boolean

Returns whether TTY is supported on this device.
Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE or android.Manifest.permission#READ_PHONE_STATE

isVoiceMailNumber

Added in API level 23
open fun isVoiceMailNumber(
    accountHandle: PhoneAccountHandle!,
    number: String!
): Boolean

Return whether a given phone number is the configured voicemail number for a particular phone account.
Requires android.Manifest.permission#READ_PHONE_STATE

Parameters
accountHandle PhoneAccountHandle!: The handle for the account to check the voicemail number against
number String!: The number to look up.

placeCall

Added in API level 23
open fun placeCall(
    address: Uri!,
    extras: Bundle!
): Unit

Places a new outgoing call to the provided address using the system telecom service with the specified extras. This method is equivalent to placing an outgoing call using Intent.ACTION_CALL, except that the outgoing call will always be sent via the system telecom service. If method-caller is either the user selected default dialer app or preloaded system dialer app, then emergency calls will also be allowed. Placing a call via a managed ConnectionService requires permission: android.Manifest.permission#CALL_PHONE Usage example:

Uri uri = Uri.fromParts("tel", "12345", null);
  Bundle extras = new Bundle();
  extras.putBoolean(TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, true);
  telecomManager.placeCall(uri, extras);
  
The following keys are supported in the supplied extras.

An app which implements the self-managed ConnectionService API uses placeCall(android.net.Uri,android.os.Bundle) to inform Telecom of a new outgoing call. A self-managed ConnectionService must include EXTRA_PHONE_ACCOUNT_HANDLE to specify its associated android.telecom.PhoneAccountHandle. Self-managed ConnectionServices require permission android.Manifest.permission#MANAGE_OWN_CALLS.

Note: If this method is used to place an emergency call, it is not guaranteed that the call will be placed on the PhoneAccount provided in the EXTRA_PHONE_ACCOUNT_HANDLE extra (if specified) and may be placed on another PhoneAccount with the PhoneAccount.CAPABILITY_PLACE_EMERGENCY_CALLS capability, depending on external factors, such as network conditions and Modem/SIM status.

Note: android.app.Notification.CallStyle notifications should be posted after the call is placed in order for the notification to be non-dismissible.

Note: Call Forwarding MMI codes can only be dialed by applications that are configured as the user defined default dialer or system dialer role. If a call containing a call forwarding MMI code is placed by an application that is not in one of these roles, the dialer will be launched with a UI showing the MMI code already populated so that the user can confirm the action before the call is placed.
Requires android.Manifest.permission#CALL_PHONE or android.Manifest.permission#MANAGE_OWN_CALLS

Parameters
address Uri!: The address to make the call to.
extras Bundle!: Bundle of extras to use with the call.

registerPhoneAccount

Added in API level 23
open fun registerPhoneAccount(account: PhoneAccount!): Unit

Register a PhoneAccount for use by the system that will be stored in Device Encrypted storage. When registering PhoneAccounts, existing registrations will be overwritten if the PhoneAccountHandle matches that of a PhoneAccount which is already registered. Once registered, the PhoneAccount is listed to the user as an option when placing calls. The user may still need to enable the PhoneAccount within the phone app settings before the account is usable.

Note: Each package is limited to 10 PhoneAccount registrations.

A SecurityException will be thrown if an app tries to register a PhoneAccountHandle where the package name specified within PhoneAccountHandle.getComponentName() does not match the package name of the app.

A IllegalArgumentException will be thrown if an app tries to register a PhoneAccount when the upper bound limit, 10, has already been reached.

Parameters
account PhoneAccount!: The complete PhoneAccount.
Exceptions
java.lang.UnsupportedOperationException if the caller cannot modify phone state and the device does not have the Telecom feature.
java.lang.SecurityException if:
  1. the caller cannot modify phone state and the phone account doesn't belong to the calling user.
  2. the caller is registering a self-managed phone and either they are not allowed to manage their own calls or if the account is call capable, a connection manager, or a sim account.
  3. the caller is registering a sim account without the ability to do so.
  4. the caller is registering a multi-user phone account but isn't a system app.
  5. the account can make SIM-based voice calls but the caller cannot register sim accounts or isn't a sim call manager.
  6. the account defines the EXTRA_SKIP_CALL_FILTERING extra but the caller isn't able to modify the phone state.
  7. the caller is registering an account for a different user but isn't able to interact across users.
  8. if simultaneous calling is available and the phone account package name doesn't correspond to the simultaneous calling accounts associated with this phone account.

showInCallScreen

Added in API level 21
open fun showInCallScreen(showDialpad: Boolean): Unit

Brings the in-call screen to the foreground if there is an ongoing call. If there is currently no ongoing call, then this method does nothing.

Requires that the method-caller be set as the system dialer app or have the android.Manifest.permission#READ_PHONE_STATE permission.


Requires android.Manifest.permission#READ_PHONE_STATE
Parameters
showDialpad Boolean: Brings up the in-call dialpad as part of showing the in-call screen.

silenceRinger

Added in API level 23
open fun silenceRinger(): Unit

Silences the ringer if a ringing call exists.

This method can only be relied upon to stop the ringtone for a call if the ringtone has already started playing. It is intended to handle use-cases such as silencing a ringing call when the user presses the volume button during ringing.

If this method is called prior to when the ringtone begins playing, the ringtone will not be silenced. As such it is not intended as a means to avoid playing of a ringtone.

A dialer app which wants to have more control over ringtone playing should declare TelecomManager.METADATA_IN_CALL_SERVICE_RINGING in the manifest entry for their InCallService implementation to indicate that the app wants to be responsible for playing the ringtone for all incoming calls.

Requires permission: android.Manifest.permission#MODIFY_PHONE_STATE or that the app fills the dialer role (see getDefaultDialerPackage()).
Requires android.Manifest.permission#MODIFY_PHONE_STATE

startConference

Added in API level 31
open fun startConference(
    participants: MutableList<Uri!>,
    extras: Bundle
): Unit

Place a new adhoc conference call with the provided participants using the system telecom service. This method doesn't support placing of emergency calls. An adhoc conference call is established by providing a list of addresses to TelecomManager#startConference(List<Uri>, int videoState) where the ConnectionService is responsible for connecting all indicated participants to a conference simultaneously. This is in contrast to conferences formed by merging calls together (e.g. using android.telecom.Call#mergeConference()). The following keys are supported in the supplied extras.


Requires android.Manifest.permission#CALL_PHONE

Parameters
participants MutableList<Uri!>: List of participants to start conference with This value cannot be null.
extras Bundle: Bundle of extras to use with the call This value cannot be null.

unregisterPhoneAccount

Added in API level 23
open fun unregisterPhoneAccount(accountHandle: PhoneAccountHandle!): Unit

Remove a PhoneAccount registration from the system.

Parameters
accountHandle PhoneAccountHandle!: A PhoneAccountHandle for the PhoneAccount to unregister.