CallLog.Calls


public static class CallLog.Calls
extends Object implements BaseColumns

java.lang.Object
   ↳ android.provider.CallLog.Calls


Contains the recent calls.

Note: If you want to query the call log and limit the results to a single value, you should append the LIMIT_PARAM_KEY parameter to the content URI. For example:

 getContentResolver().query(
                 Calls.CONTENT_URI.buildUpon().appendQueryParameter(LIMIT_PARAM_KEY, "1")
                 .build(),
                 null, null, null, null);
 
 

The call log provider enforces strict SQL grammar, so you CANNOT append "LIMIT" to the SQL query as below:

 getContentResolver().query(Calls.CONTENT_URI, null, "LIMIT 1", null, null);
 
 

Summary

Constants

int ANSWERED_EXTERNALLY_TYPE

Call log type for a call which was answered on another device.

String ASSERTED_DISPLAY_NAME

String that stores the asserted display name associated with business call.

long AUTO_MISSED_EMERGENCY_CALL

Value for CallLog.Calls#MISSED_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE to indicate that a call was automatically rejected by system because an ongoing emergency call.

long AUTO_MISSED_MAXIMUM_DIALING

Value for CallLog.Calls#MISSED_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE to indicate that a call was automatically rejected by system because the system cannot support any more dialing calls.

long AUTO_MISSED_MAXIMUM_RINGING

Value for CallLog.Calls#MISSED_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE to indicate that a call was automatically rejected by system because the system cannot support any more ringing calls.

int BLOCKED_TYPE

Call log type for calls blocked automatically.

String BLOCK_REASON

Where the CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE, indicates the reason why a call is blocked.

int BLOCK_REASON_BLOCKED_NUMBER

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because it is in the BlockedNumbers provider.

int BLOCK_REASON_CALL_SCREENING_SERVICE

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked by a CallScreeningService.

int BLOCK_REASON_DIRECT_TO_VOICEMAIL

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user configured a contact to be sent directly to voicemail.

int BLOCK_REASON_NOT_BLOCKED

Value for CallLog.Calls#BLOCK_REASON, set as the default value when a call was not blocked by a CallScreeningService or any other system call blocking method.

int BLOCK_REASON_NOT_IN_CONTACTS

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from numbers not in their contacts.

int BLOCK_REASON_PAY_PHONE

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from pay phones.

int BLOCK_REASON_RESTRICTED_NUMBER

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from restricted numbers.

int BLOCK_REASON_UNKNOWN_NUMBER

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from unknown numbers.

String CACHED_FORMATTED_NUMBER

The cached phone number, formatted with formatting rules based on the country the user was in when the call was made or received.

String CACHED_LOOKUP_URI

The cached URI to look up the contact associated with the phone number, if it exists.

String CACHED_MATCHED_NUMBER

The cached phone number of the contact which matches this entry, if it exists.

String CACHED_NAME

The cached name associated with the phone number, if it exists.

String CACHED_NORMALIZED_NUMBER

The cached normalized(E164) version of the phone number, if it exists.

String CACHED_NUMBER_LABEL

The cached number label, for a custom number type, associated with the phone number, if it exists.

String CACHED_NUMBER_TYPE

The cached number type (Home, Work, etc) associated with the phone number, if it exists.

String CACHED_PHOTO_ID

The cached photo id of the picture associated with the phone number, if it exists.

String CACHED_PHOTO_URI

The cached photo URI of the picture associated with the phone number, if it exists.

String CALL_SCREENING_APP_NAME

The name of the app which blocked a call.

String CALL_SCREENING_COMPONENT_NAME

The ComponentName of the CallScreeningService which blocked this call.

String COMPOSER_PHOTO_URI

A reference to the picture that was sent via call composer.

String CONTENT_ITEM_TYPE

The MIME type of a CONTENT_URI sub-directory of a single call.

String CONTENT_TYPE

The MIME type of CONTENT_URI and CONTENT_FILTER_URI providing a directory of calls.

String COUNTRY_ISO

The ISO 3166-1 two letters country code of the country where the user received or made the call.

String DATA_USAGE

The data usage of the call in bytes.

String DATE

The date the call occured, in milliseconds since the epoch

Type: INTEGER (long)

String DEFAULT_SORT_ORDER

The default sort order for this table

String DURATION

The duration of the call in seconds

Type: INTEGER (long)

String EXTRA_CALL_TYPE_FILTER

An optional extra used with Calls.CONTENT_TYPE and Intent#ACTION_VIEW to specify that the presented list of calls should be filtered for a particular call type.

String FEATURES

Bit-mask describing features of the call (e.g. video).

int FEATURES_ASSISTED_DIALING_USED

Indicates the call underwent Assisted Dialing.

int FEATURES_HD_CALL

Call was HD.

int FEATURES_PULLED_EXTERNALLY

Call was pulled externally.

int FEATURES_RTT

Call was on RTT at some point

int FEATURES_VIDEO

Call had video.

int FEATURES_VOLTE

Call was VoLTE

int FEATURES_WIFI

Call was WIFI call.

String GEOCODED_LOCATION

A geocoded location for the number associated with this call.

int INCOMING_TYPE

Call log type for incoming calls.

String IS_BUSINESS_CALL

Boolean indicating whether the call is a business call.

String IS_READ

Whether this item has been read or otherwise consumed by the user.

String LAST_MODIFIED

The date the row is last inserted, updated, or marked as deleted, in milliseconds since the epoch.

String LIMIT_PARAM_KEY

Query parameter used to limit the number of call logs returned.

String LOCATION

A reference to the location that was sent via call composer.

String MISSED_REASON

Where the CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, indicates factors which may have lead the user to miss the call.

long MISSED_REASON_NOT_MISSED

Value for CallLog.Calls#MISSED_REASON, set as the default value when a call was not missed.

int MISSED_TYPE

Call log type for missed calls.

String NEW

Whether or not the call has been acknowledged

Type: INTEGER (boolean)

String NUMBER

The phone number as the user entered it.

String NUMBER_PRESENTATION

The number presenting rules set by the network.

String OFFSET_PARAM_KEY

Query parameter used to specify the starting record to return.

int OUTGOING_TYPE

Call log type for outgoing calls.

String PHONE_ACCOUNT_COMPONENT_NAME

The component name of the account used to place or receive the call; in string form.

String PHONE_ACCOUNT_ID

The identifier for the account used to place or receive the call.

String POST_DIAL_DIGITS

The post-dial portion of a dialed number, including any digits dialed after a TelecomManager#DTMF_CHARACTER_PAUSE or a TelecomManager.DTMF_CHARACTER_WAIT and these characters themselves.

int PRESENTATION_ALLOWED

Number is allowed to display for caller id.

int PRESENTATION_PAYPHONE

Number is a pay phone.

int PRESENTATION_RESTRICTED

Number is blocked by user.

int PRESENTATION_UNAVAILABLE

Number is unavailable.

int PRESENTATION_UNKNOWN

Number is not specified or unknown by network.

String PRIORITY

The priority of the call, as delivered via call composer.

int PRIORITY_NORMAL

Used as a value in the PRIORITY column.

int PRIORITY_URGENT

Used as a value in the PRIORITY column.

int REJECTED_TYPE

Call log type for calls rejected by direct user action.

String SUBJECT

The subject of the call, as delivered via call composer.

String TRANSCRIPTION

Transcription of the call or voicemail entry.

String TYPE

The type of the call (incoming, outgoing or missed).

long USER_MISSED_CALL_FILTERS_TIMEOUT

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when the call filters timed out.

long USER_MISSED_CALL_SCREENING_SERVICE_SILENCED

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call is silenced by the call screening service.

long USER_MISSED_DND_MODE

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call is silenced because the phone is in 'do not disturb mode'.

long USER_MISSED_LOW_RING_VOLUME

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call rings with a low ring volume.

long USER_MISSED_NO_ANSWER

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when the call was missed just because user didn't answer it.

long USER_MISSED_NO_VIBRATE

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE set this bit when this call rings without vibration.

long USER_MISSED_SHORT_RING

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call rang for a short period of time.

String VIA_NUMBER

For an incoming call, the secondary line number the call was received via.

int VOICEMAIL_TYPE

Call log type for voicemails.

String VOICEMAIL_URI

URI of the voicemail entry.

Inherited constants

Fields

public static final Uri CONTENT_FILTER_URI

The content:// style URL for filtering this table on phone numbers

public static final Uri CONTENT_URI

The content:// style URL for this table

public static final Uri CONTENT_URI_WITH_VOICEMAIL

Content uri used to access call log entries, including voicemail records.

Public constructors

Calls()

Public methods

static String getLastOutgoingCall(Context context)

Query the call log database for the last dialed number.

Inherited methods

Constants

ANSWERED_EXTERNALLY_TYPE

Added in API level 25
public static final int ANSWERED_EXTERNALLY_TYPE

Call log type for a call which was answered on another device. Used in situations where a call rings on multiple devices simultaneously and it ended up being answered on a device other than the current one.

Constant Value: 7 (0x00000007)

ASSERTED_DISPLAY_NAME

Added in API level 35
public static final String ASSERTED_DISPLAY_NAME

String that stores the asserted display name associated with business call.

Constant Value: "asserted_display_name"

AUTO_MISSED_EMERGENCY_CALL

Added in API level 31
public static final long AUTO_MISSED_EMERGENCY_CALL

Value for CallLog.Calls#MISSED_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE to indicate that a call was automatically rejected by system because an ongoing emergency call.

Constant Value: 1 (0x0000000000000001)

AUTO_MISSED_MAXIMUM_DIALING

Added in API level 31
public static final long AUTO_MISSED_MAXIMUM_DIALING

Value for CallLog.Calls#MISSED_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE to indicate that a call was automatically rejected by system because the system cannot support any more dialing calls.

Constant Value: 4 (0x0000000000000004)

AUTO_MISSED_MAXIMUM_RINGING

Added in API level 31
public static final long AUTO_MISSED_MAXIMUM_RINGING

Value for CallLog.Calls#MISSED_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE to indicate that a call was automatically rejected by system because the system cannot support any more ringing calls.

Constant Value: 2 (0x0000000000000002)

BLOCKED_TYPE

Added in API level 24
public static final int BLOCKED_TYPE

Call log type for calls blocked automatically.

Constant Value: 6 (0x00000006)

BLOCK_REASON_BLOCKED_NUMBER

Added in API level 29
public static final int BLOCK_REASON_BLOCKED_NUMBER

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because it is in the BlockedNumbers provider.

Constant Value: 3 (0x00000003)

BLOCK_REASON_CALL_SCREENING_SERVICE

Added in API level 29
public static final int BLOCK_REASON_CALL_SCREENING_SERVICE

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked by a CallScreeningService. The CallLog.Calls#CALL_SCREENING_COMPONENT_NAME and CallLog.Calls#CALL_SCREENING_APP_NAME columns will indicate which call screening service was responsible for blocking the call.

Constant Value: 1 (0x00000001)

BLOCK_REASON_DIRECT_TO_VOICEMAIL

Added in API level 29
public static final int BLOCK_REASON_DIRECT_TO_VOICEMAIL

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user configured a contact to be sent directly to voicemail.

Constant Value: 2 (0x00000002)

BLOCK_REASON_NOT_BLOCKED

Added in API level 29
public static final int BLOCK_REASON_NOT_BLOCKED

Value for CallLog.Calls#BLOCK_REASON, set as the default value when a call was not blocked by a CallScreeningService or any other system call blocking method.

Constant Value: 0 (0x00000000)

BLOCK_REASON_NOT_IN_CONTACTS

Added in API level 29
public static final int BLOCK_REASON_NOT_IN_CONTACTS

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from numbers not in their contacts.

Constant Value: 7 (0x00000007)

BLOCK_REASON_PAY_PHONE

Added in API level 29
public static final int BLOCK_REASON_PAY_PHONE

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from pay phones.

Constant Value: 6 (0x00000006)

BLOCK_REASON_RESTRICTED_NUMBER

Added in API level 29
public static final int BLOCK_REASON_RESTRICTED_NUMBER

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from restricted numbers.

Constant Value: 5 (0x00000005)

BLOCK_REASON_UNKNOWN_NUMBER

Added in API level 29
public static final int BLOCK_REASON_UNKNOWN_NUMBER

Value for CallLog.Calls#BLOCK_REASON, set when CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE to indicate that a call was blocked because the user has chosen to block all calls from unknown numbers.

Constant Value: 4 (0x00000004)

CACHED_FORMATTED_NUMBER

Added in API level 21
public static final String CACHED_FORMATTED_NUMBER

The cached phone number, formatted with formatting rules based on the country the user was in when the call was made or received.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "formatted_number"

CACHED_LOOKUP_URI

Added in API level 21
public static final String CACHED_LOOKUP_URI

The cached URI to look up the contact associated with the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "lookup_uri"

CACHED_MATCHED_NUMBER

Added in API level 21
public static final String CACHED_MATCHED_NUMBER

The cached phone number of the contact which matches this entry, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "matched_number"

CACHED_NAME

Added in API level 1
public static final String CACHED_NAME

The cached name associated with the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "name"

CACHED_NORMALIZED_NUMBER

Added in API level 21
public static final String CACHED_NORMALIZED_NUMBER

The cached normalized(E164) version of the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "normalized_number"

CACHED_NUMBER_LABEL

Added in API level 1
public static final String CACHED_NUMBER_LABEL

The cached number label, for a custom number type, associated with the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT

Constant Value: "numberlabel"

CACHED_NUMBER_TYPE

Added in API level 1
public static final String CACHED_NUMBER_TYPE

The cached number type (Home, Work, etc) associated with the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: INTEGER

Constant Value: "numbertype"

CACHED_PHOTO_ID

Added in API level 21
public static final String CACHED_PHOTO_ID

The cached photo id of the picture associated with the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: INTEGER (long)

Constant Value: "photo_id"

CACHED_PHOTO_URI

Added in API level 23
public static final String CACHED_PHOTO_URI

The cached photo URI of the picture associated with the phone number, if it exists.

This value is typically filled in by the dialer app for the caching purpose, so it's not guaranteed to be present, and may not be current if the contact information associated with this number has changed.

Type: TEXT (URI)

Constant Value: "photo_uri"

CALL_SCREENING_APP_NAME

Added in API level 29
public static final String CALL_SCREENING_APP_NAME

The name of the app which blocked a call. Will be populated when the CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE. Provided as a convenience so that the call log can still indicate which app blocked a call, even if that app is no longer installed.

Type: TEXT

Constant Value: "call_screening_app_name"

CALL_SCREENING_COMPONENT_NAME

Added in API level 29
public static final String CALL_SCREENING_COMPONENT_NAME

The ComponentName of the CallScreeningService which blocked this call. Will be populated when the CallLog.Calls#TYPE is CallLog.Calls#BLOCKED_TYPE.

Type: TEXT

Constant Value: "call_screening_component_name"

COMPOSER_PHOTO_URI

Added in API level 31
public static final String COMPOSER_PHOTO_URI

A reference to the picture that was sent via call composer. The string contained in this field should be converted to an Uri via Uri#parse(String), then passed to ContentResolver#openFileDescriptor in order to obtain a file descriptor to access the picture data. The user may choose to delete the picture associated with a call independently of the call log entry, in which case ContentResolver#openFileDescriptor may throw a FileNotFoundException. Note that pictures sent or received via call composer will not be included in any backups of the call log.

Type: TEXT

Constant Value: "composer_photo_uri"

CONTENT_ITEM_TYPE

Added in API level 1
public static final String CONTENT_ITEM_TYPE

The MIME type of a CONTENT_URI sub-directory of a single call.

Constant Value: "vnd.android.cursor.item/calls"

CONTENT_TYPE

Added in API level 1
public static final String CONTENT_TYPE

The MIME type of CONTENT_URI and CONTENT_FILTER_URI providing a directory of calls.

Constant Value: "vnd.android.cursor.dir/calls"

COUNTRY_ISO

Added in API level 21
public static final String COUNTRY_ISO

The ISO 3166-1 two letters country code of the country where the user received or made the call.

Type: TEXT

Constant Value: "countryiso"

DATA_USAGE

Added in API level 21
public static final String DATA_USAGE

The data usage of the call in bytes.

Type: INTEGER (long)

Constant Value: "data_usage"

DATE

Added in API level 1
public static final String DATE

The date the call occured, in milliseconds since the epoch

Type: INTEGER (long)

Constant Value: "date"

DEFAULT_SORT_ORDER

Added in API level 1
public static final String DEFAULT_SORT_ORDER

The default sort order for this table

Constant Value: "date DESC"

DURATION

Added in API level 1
public static final String DURATION

The duration of the call in seconds

Type: INTEGER (long)

Constant Value: "duration"

EXTRA_CALL_TYPE_FILTER

Added in API level 21
public static final String EXTRA_CALL_TYPE_FILTER

An optional extra used with Calls.CONTENT_TYPE and Intent#ACTION_VIEW to specify that the presented list of calls should be filtered for a particular call type. Applications implementing a call log UI should check for this extra, and display a filtered list of calls based on the specified call type. If not applicable within the application's UI, it should be silently ignored.

The following example brings up the call log, showing only missed calls.

 Intent intent = new Intent(Intent.ACTION_VIEW);
 intent.setType(CallLog.Calls.CONTENT_TYPE);
 intent.putExtra(CallLog.Calls.EXTRA_CALL_TYPE_FILTER, CallLog.Calls.MISSED_TYPE);
 startActivity(intent);
 

Constant Value: "android.provider.extra.CALL_TYPE_FILTER"

FEATURES

Added in API level 21
public static final String FEATURES

Bit-mask describing features of the call (e.g. video).

Type: INTEGER (int)

Constant Value: "features"

FEATURES_ASSISTED_DIALING_USED

Added in API level 30
public static final int FEATURES_ASSISTED_DIALING_USED

Indicates the call underwent Assisted Dialing.

Constant Value: 16 (0x00000010)

FEATURES_HD_CALL

Added in API level 26
public static final int FEATURES_HD_CALL

Call was HD.

Constant Value: 4 (0x00000004)

FEATURES_PULLED_EXTERNALLY

Added in API level 25
public static final int FEATURES_PULLED_EXTERNALLY

Call was pulled externally.

Constant Value: 2 (0x00000002)

FEATURES_RTT

Added in API level 28
public static final int FEATURES_RTT

Call was on RTT at some point

Constant Value: 32 (0x00000020)

FEATURES_VIDEO

Added in API level 21
public static final int FEATURES_VIDEO

Call had video.

Constant Value: 1 (0x00000001)

FEATURES_VOLTE

Added in API level 30
public static final int FEATURES_VOLTE

Call was VoLTE

Constant Value: 64 (0x00000040)

FEATURES_WIFI

Added in API level 26
public static final int FEATURES_WIFI

Call was WIFI call.

Constant Value: 8 (0x00000008)

GEOCODED_LOCATION

Added in API level 21
public static final String GEOCODED_LOCATION

A geocoded location for the number associated with this call.

The string represents a city, state, or country associated with the number.

Type: TEXT

Constant Value: "geocoded_location"

INCOMING_TYPE

Added in API level 1
public static final int INCOMING_TYPE

Call log type for incoming calls.

Constant Value: 1 (0x00000001)

IS_BUSINESS_CALL

Added in API level 35
public static final String IS_BUSINESS_CALL

Boolean indicating whether the call is a business call.

Constant Value: "is_business_call"

IS_READ

Added in API level 14
public static final String IS_READ

Whether this item has been read or otherwise consumed by the user.

Unlike the NEW field, which requires the user to have acknowledged the existence of the entry, this implies the user has interacted with the entry.

Type: INTEGER (boolean)

Constant Value: "is_read"

LAST_MODIFIED

Added in API level 24
public static final String LAST_MODIFIED

The date the row is last inserted, updated, or marked as deleted, in milliseconds since the epoch. Read only.

Type: INTEGER (long)

Constant Value: "last_modified"

LIMIT_PARAM_KEY

Added in API level 17
public static final String LIMIT_PARAM_KEY

Query parameter used to limit the number of call logs returned.

TYPE: integer

Constant Value: "limit"

LOCATION

Added in API level 31
public static final String LOCATION

A reference to the location that was sent via call composer. This column contains the content URI of the corresponding entry in Locations table, which contains the actual location data. The Manifest.permission#ACCESS_FINE_LOCATION permission is required to access that table. If your app has the appropriate permissions, the location data may be obtained by converting the value of this column to an Uri via Uri#parse, then passing the result to ContentResolver#query. The user may choose to delete the location associated with a call independently of the call log entry, in which case the Cursor returned from ContentResolver#query will either be null or empty, with Cursor#getCount() returning 0. This column will not be populated when a call is received while the device is locked, and it will not be part of any backups.

Type: TEXT

Constant Value: "location"

MISSED_REASON

Added in API level 31
public static final String MISSED_REASON

Where the CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, indicates factors which may have lead the user to miss the call.

Type: INTEGER

There are two main cases. Auto missed cases and user missed cases. Default value is:

Auto missed cases are those where a call was missed because it was not possible for the incoming call to be presented to the user at all. Possible values are:

User missed cases are those where the incoming call was presented to the user, but factors such as a low ringing volume may have contributed to the call being missed. Following bits can be set to indicate possible reasons for this:

Constant Value: "missed_reason"

MISSED_REASON_NOT_MISSED

Added in API level 31
public static final long MISSED_REASON_NOT_MISSED

Value for CallLog.Calls#MISSED_REASON, set as the default value when a call was not missed.

Constant Value: 0 (0x0000000000000000)

MISSED_TYPE

Added in API level 1
public static final int MISSED_TYPE

Call log type for missed calls.

Constant Value: 3 (0x00000003)

NEW

Added in API level 1
public static final String NEW

Whether or not the call has been acknowledged

Type: INTEGER (boolean)

Constant Value: "new"

NUMBER

Added in API level 1
public static final String NUMBER

The phone number as the user entered it.

Type: TEXT

Constant Value: "number"

NUMBER_PRESENTATION

Added in API level 19
public static final String NUMBER_PRESENTATION

The number presenting rules set by the network.

Allowed values:

Type: INTEGER

Constant Value: "presentation"

OFFSET_PARAM_KEY

Added in API level 17
public static final String OFFSET_PARAM_KEY

Query parameter used to specify the starting record to return.

TYPE: integer

Constant Value: "offset"

OUTGOING_TYPE

Added in API level 1
public static final int OUTGOING_TYPE

Call log type for outgoing calls.

Constant Value: 2 (0x00000002)

PHONE_ACCOUNT_COMPONENT_NAME

Added in API level 21
public static final String PHONE_ACCOUNT_COMPONENT_NAME

The component name of the account used to place or receive the call; in string form.

Type: TEXT

Constant Value: "subscription_component_name"

PHONE_ACCOUNT_ID

Added in API level 21
public static final String PHONE_ACCOUNT_ID

The identifier for the account used to place or receive the call.

Type: TEXT

Constant Value: "subscription_id"

POST_DIAL_DIGITS

Added in API level 24
public static final String POST_DIAL_DIGITS

The post-dial portion of a dialed number, including any digits dialed after a TelecomManager#DTMF_CHARACTER_PAUSE or a TelecomManager.DTMF_CHARACTER_WAIT and these characters themselves.

Type: TEXT

Constant Value: "post_dial_digits"

PRESENTATION_ALLOWED

Added in API level 19
public static final int PRESENTATION_ALLOWED

Number is allowed to display for caller id.

Constant Value: 1 (0x00000001)

PRESENTATION_PAYPHONE

Added in API level 19
public static final int PRESENTATION_PAYPHONE

Number is a pay phone.

Constant Value: 4 (0x00000004)

PRESENTATION_RESTRICTED

Added in API level 19
public static final int PRESENTATION_RESTRICTED

Number is blocked by user.

Constant Value: 2 (0x00000002)

PRESENTATION_UNAVAILABLE

Added in API level 33
public static final int PRESENTATION_UNAVAILABLE

Number is unavailable.

Constant Value: 5 (0x00000005)

PRESENTATION_UNKNOWN

Added in API level 19
public static final int PRESENTATION_UNKNOWN

Number is not specified or unknown by network.

Constant Value: 3 (0x00000003)

PRIORITY

Added in API level 31
public static final String PRIORITY

The priority of the call, as delivered via call composer. For outgoing calls, contains the priority set by the local user. For incoming calls, contains the priority set by the remote caller. If no priority was set or the call did not include call composer elements, defaults to PRIORITY_NORMAL. Valid values are PRIORITY_NORMAL and PRIORITY_URGENT.

Type: INTEGER

Constant Value: "priority"

PRIORITY_NORMAL

Added in API level 31
public static final int PRIORITY_NORMAL

Used as a value in the PRIORITY column. Indicates that the call is of normal priority. This is also the default value for calls that did not include call composer elements.

Constant Value: 0 (0x00000000)

PRIORITY_URGENT

Added in API level 31
public static final int PRIORITY_URGENT

Used as a value in the PRIORITY column. Indicates that the call is of urgent priority.

Constant Value: 1 (0x00000001)

REJECTED_TYPE

Added in API level 24
public static final int REJECTED_TYPE

Call log type for calls rejected by direct user action.

Constant Value: 5 (0x00000005)

SUBJECT

Added in API level 31
public static final String SUBJECT

The subject of the call, as delivered via call composer. For outgoing calls, contains the subject set by the local user. For incoming calls, contains the subject set by the remote caller. May be null if no subject was set.

Type: TEXT

Constant Value: "subject"

TRANSCRIPTION

Added in API level 21
public static final String TRANSCRIPTION

Transcription of the call or voicemail entry. This will only be populated for call log entries of type VOICEMAIL_TYPE that have valid transcriptions.

Constant Value: "transcription"

TYPE

Added in API level 1
public static final String TYPE

The type of the call (incoming, outgoing or missed).

Type: INTEGER (int)

Allowed values:

Constant Value: "type"

USER_MISSED_CALL_FILTERS_TIMEOUT

Added in API level 31
public static final long USER_MISSED_CALL_FILTERS_TIMEOUT

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when the call filters timed out.

Constant Value: 4194304 (0x0000000000400000)

USER_MISSED_CALL_SCREENING_SERVICE_SILENCED

Added in API level 31
public static final long USER_MISSED_CALL_SCREENING_SERVICE_SILENCED

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call is silenced by the call screening service.

Constant Value: 2097152 (0x0000000000200000)

USER_MISSED_DND_MODE

Added in API level 31
public static final long USER_MISSED_DND_MODE

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call is silenced because the phone is in 'do not disturb mode'.

Constant Value: 262144 (0x0000000000040000)

USER_MISSED_LOW_RING_VOLUME

Added in API level 31
public static final long USER_MISSED_LOW_RING_VOLUME

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call rings with a low ring volume.

Constant Value: 524288 (0x0000000000080000)

USER_MISSED_NO_ANSWER

Added in API level 31
public static final long USER_MISSED_NO_ANSWER

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when the call was missed just because user didn't answer it.

Constant Value: 65536 (0x0000000000010000)

USER_MISSED_NO_VIBRATE

Added in API level 31
public static final long USER_MISSED_NO_VIBRATE

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE set this bit when this call rings without vibration.

Constant Value: 1048576 (0x0000000000100000)

USER_MISSED_SHORT_RING

Added in API level 31
public static final long USER_MISSED_SHORT_RING

When CallLog.Calls#TYPE is CallLog.Calls#MISSED_TYPE, set this bit when this call rang for a short period of time.

Constant Value: 131072 (0x0000000000020000)

VIA_NUMBER

Added in API level 24
public static final String VIA_NUMBER

For an incoming call, the secondary line number the call was received via. When a SIM card has multiple phone numbers associated with it, the via number indicates which of the numbers associated with the SIM was called.

Constant Value: "via_number"

VOICEMAIL_TYPE

Added in API level 21
public static final int VOICEMAIL_TYPE

Call log type for voicemails.

Constant Value: 4 (0x00000004)

VOICEMAIL_URI

Added in API level 21
public static final String VOICEMAIL_URI

URI of the voicemail entry. Populated only for VOICEMAIL_TYPE.

Type: TEXT

Constant Value: "voicemail_uri"

Fields

CONTENT_FILTER_URI

Added in API level 1
public static final Uri CONTENT_FILTER_URI

The content:// style URL for filtering this table on phone numbers

CONTENT_URI

Added in API level 1
public static final Uri CONTENT_URI

The content:// style URL for this table

CONTENT_URI_WITH_VOICEMAIL

Added in API level 21
public static final Uri CONTENT_URI_WITH_VOICEMAIL

Content uri used to access call log entries, including voicemail records. You must have the READ_CALL_LOG and WRITE_CALL_LOG permissions to read and write to the call log, as well as READ_VOICEMAIL and WRITE_VOICEMAIL permissions to read and write voicemails.

Public constructors

Calls

public Calls ()

Public methods

getLastOutgoingCall

Added in API level 8
public static String getLastOutgoingCall (Context context)

Query the call log database for the last dialed number.

Parameters
context Context: Used to get the content resolver.

Returns
String The last phone number dialed (outgoing) or an empty string if none exist yet.