Android APIs
public class

TelecomManager

extends Object
java.lang.Object
   ↳ android.telecom.TelecomManager

Class Overview

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 Context.getSystemService(Context.TELECOM_SERVICE).

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.

Summary

Constants
String ACTION_SHOW_CALL_SETTINGS The Intent action used to show the call settings page.
char DTMF_CHARACTER_PAUSE The dual tone multi-frequency signaling character sent to indicate the dialing system should pause for a predefined period.
char DTMF_CHARACTER_WAIT The dual-tone multi-frequency signaling character sent to indicate the dialing system should wait for user confirmation before proceeding.
String EXTRA_CALL_DISCONNECT_CAUSE Optional extra for ACTION_PHONE_STATE_CHANGED containing the disconnect code.
String EXTRA_CALL_DISCONNECT_MESSAGE Optional extra for ACTION_PHONE_STATE_CHANGED containing the disconnect message.
String EXTRA_START_CALL_WITH_SPEAKERPHONE Optional extra for ACTION_CALL containing a boolean that determines whether the speakerphone should be automatically turned on for an outgoing call.
String GATEWAY_ORIGINAL_ADDRESS An optional ACTION_CALL intent extra corresponding to the original address to dial for the call.
String GATEWAY_PROVIDER_PACKAGE An optional ACTION_CALL intent extra denoting the package name of the app specifying an alternative gateway for the call.
int PRESENTATION_ALLOWED Property is displayed normally.
int PRESENTATION_PAYPHONE Property should be displayed as a pay phone.
int PRESENTATION_RESTRICTED Property was blocked.
int PRESENTATION_UNKNOWN Presentation was not specified or is unknown.
Public Methods
void cancelMissedCallsNotification()
Removes the missed-call notification if one is present.
boolean handleMmi(String dialString)
Processes the specified dial string as an MMI code.
boolean isInCall()
Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding states).
void showInCallScreen(boolean showDialpad)
Brings the in-call screen to the foreground if there is an ongoing call.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION_SHOW_CALL_SETTINGS

Added in API level 21

The Intent action used to show the call settings page.

Constant Value: "android.telecom.action.SHOW_CALL_SETTINGS"

public static final char DTMF_CHARACTER_PAUSE

Added in API level 21

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

Constant Value: 44 (0x0000002c)

public static final char DTMF_CHARACTER_WAIT

Added in API level 21

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

Constant Value: 59 (0x0000003b)

public static final String EXTRA_CALL_DISCONNECT_CAUSE

Added in API level 21

Optional extra for ACTION_PHONE_STATE_CHANGED containing the disconnect code.

Constant Value: "android.telecom.extra.CALL_DISCONNECT_CAUSE"

public static final String EXTRA_CALL_DISCONNECT_MESSAGE

Added in API level 21

Optional extra for ACTION_PHONE_STATE_CHANGED containing the disconnect message.

Constant Value: "android.telecom.extra.CALL_DISCONNECT_MESSAGE"

public static final String EXTRA_START_CALL_WITH_SPEAKERPHONE

Added in API level 21

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

Constant Value: "android.telecom.extra.START_CALL_WITH_SPEAKERPHONE"

public static final String GATEWAY_ORIGINAL_ADDRESS

Added in API level 21

An optional 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 Uri. (See GATEWAY_PROVIDER_PACKAGE for details)

Constant Value: "android.telecom.extra.GATEWAY_ORIGINAL_ADDRESS"

public static final String GATEWAY_PROVIDER_PACKAGE

Added in API level 21

An optional 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 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.

Constant Value: "android.telecom.extra.GATEWAY_PROVIDER_PACKAGE"

public static final int PRESENTATION_ALLOWED

Added in API level 21

Property is displayed normally.

Constant Value: 1 (0x00000001)

public static final int PRESENTATION_PAYPHONE

Added in API level 21

Property should be displayed as a pay phone.

Constant Value: 4 (0x00000004)

public static final int PRESENTATION_RESTRICTED

Added in API level 21

Property was blocked.

Constant Value: 2 (0x00000002)

public static final int PRESENTATION_UNKNOWN

Added in API level 21

Presentation was not specified or is unknown.

Constant Value: 3 (0x00000003)

Public Methods

public void cancelMissedCallsNotification ()

Added in API level 21

Removes the missed-call notification if one is present.

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

public boolean handleMmi (String dialString)

Added in API level 21

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.

Parameters
dialString The digits to dial.
Returns
  • True if the digits were processed as an MMI code, false otherwise.

public boolean isInCall ()

Added in API level 21

Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding states).

Requires permission: READ_PHONE_STATE

public void showInCallScreen (boolean showDialpad)

Added in API level 21

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 READ_PHONE_STATE permission.

Parameters
showDialpad Brings up the in-call dialpad as part of showing the in-call screen.