public static class CallLog.Calls extends Object implements BaseColumns
Modifier and Type | Field and Description |
---|---|
static String |
ADD_FOR_ALL_USERS
Indicates that the entry will be copied from primary user to other users.
|
static String |
ALLOW_VOICEMAILS_PARAM_KEY
An optional URI parameter which instructs the provider to allow the operation to be
applied to voicemail records as well.
|
static int |
ANSWERED_EXTERNALLY_TYPE
Call log type for a call which was answered on another device.
|
static int |
BLOCKED_TYPE
Call log type for calls blocked automatically.
|
static 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.
|
static String |
CACHED_LOOKUP_URI
The cached URI to look up the contact associated with the phone number, if it exists.
|
static String |
CACHED_MATCHED_NUMBER
The cached phone number of the contact which matches this entry, if it exists.
|
static String |
CACHED_NAME
The cached name associated with the phone number, if it exists.
|
static String |
CACHED_NORMALIZED_NUMBER
The cached normalized(E164) version of the phone number, if it exists.
|
static String |
CACHED_NUMBER_LABEL
The cached number label, for a custom number type, associated with the
phone number, if it exists.
|
static String |
CACHED_NUMBER_TYPE
The cached number type (Home, Work, etc) associated with the
phone number, if it exists.
|
static String |
CACHED_PHOTO_ID
The cached photo id of the picture associated with the phone number, if it exists.
|
static String |
CACHED_PHOTO_URI
The cached photo URI of the picture associated with the phone number, if it exists.
|
static Uri |
CONTENT_FILTER_URI
The content:// style URL for filtering this table on phone numbers
|
static String |
CONTENT_ITEM_TYPE
The MIME type of a
CONTENT_URI sub-directory of a single
call. |
static String |
CONTENT_TYPE
The MIME type of
CONTENT_URI and CONTENT_FILTER_URI
providing a directory of calls. |
static Uri |
CONTENT_URI
The content:// style URL for this table
|
static Uri |
CONTENT_URI_WITH_VOICEMAIL
Content uri used to access call log entries, including voicemail records.
|
static String |
COUNTRY_ISO
The ISO 3166-1 two letters country code of the country where the
user received or made the call.
|
static String |
DATA_USAGE
The data usage of the call in bytes.
|
static String |
DATE
The date the call occured, in milliseconds since the epoch
Type: INTEGER (long)
|
static String |
DEFAULT_SORT_ORDER
The default sort order for this table
|
static String |
DURATION
The duration of the call in seconds
Type: INTEGER (long)
|
static 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. |
static String |
FEATURES
Bit-mask describing features of the call (e.g. video).
|
static int |
FEATURES_PULLED_EXTERNALLY
Call was pulled externally.
|
static int |
FEATURES_VIDEO
Call had video.
|
static String |
GEOCODED_LOCATION
A geocoded location for the number associated with this call.
|
static int |
INCOMING_TYPE
Call log type for incoming calls.
|
static String |
IS_READ
Whether this item has been read or otherwise consumed by the user.
|
static String |
LAST_MODIFIED
The date the row is last inserted, updated, or marked as deleted, in milliseconds
since the epoch.
|
static String |
LIMIT_PARAM_KEY
Query parameter used to limit the number of call logs returned.
|
static int |
MISSED_TYPE
Call log type for missed calls.
|
static String |
NEW
Whether or not the call has been acknowledged
Type: INTEGER (boolean)
|
static String |
NUMBER
The phone number as the user entered it.
|
static String |
NUMBER_PRESENTATION
The number presenting rules set by the network.
|
static String |
OFFSET_PARAM_KEY
Query parameter used to specify the starting record to return.
|
static int |
OUTGOING_TYPE
Call log type for outgoing calls.
|
static String |
PHONE_ACCOUNT_ADDRESS
The address associated with the account used to place or receive the call; in string
form.
|
static String |
PHONE_ACCOUNT_COMPONENT_NAME
The component name of the account used to place or receive the call; in string form.
|
static String |
PHONE_ACCOUNT_HIDDEN
Indicates that the entry will be hidden from all queries until the associated
PhoneAccount is registered with the system. |
static String |
PHONE_ACCOUNT_ID
The identifier for the account used to place or receive the call.
|
static 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. |
static int |
PRESENTATION_ALLOWED
Number is allowed to display for caller id.
|
static int |
PRESENTATION_PAYPHONE
Number is a pay phone.
|
static int |
PRESENTATION_RESTRICTED
Number is blocked by user.
|
static int |
PRESENTATION_UNKNOWN
Number is not specified or unknown by network.
|
static int |
REJECTED_TYPE
Call log type for calls rejected by direct user action.
|
static Uri |
SHADOW_CONTENT_URI |
static String |
SUB_ID
The subscription ID used to place this call.
|
static String |
TRANSCRIPTION
Transcription of the call or voicemail entry.
|
static String |
TYPE
The type of the call (incoming, outgoing or missed).
|
static String |
VIA_NUMBER
For an incoming call, the secondary line number the call was received via.
|
static int |
VOICEMAIL_TYPE
Call log type for voicemails.
|
static String |
VOICEMAIL_URI
URI of the voicemail entry.
|
_COUNT, _ID
Constructor and Description |
---|
Calls() |
Modifier and Type | Method and Description |
---|---|
static Uri |
addCall(CallerInfo ci,
Context context,
String number,
int presentation,
int callType,
int features,
PhoneAccountHandle accountHandle,
long start,
int duration,
Long dataUsage)
Adds a call to the call log.
|
static Uri |
addCall(CallerInfo ci,
Context context,
String number,
String postDialDigits,
String viaNumber,
int presentation,
int callType,
int features,
PhoneAccountHandle accountHandle,
long start,
int duration,
Long dataUsage,
boolean addForAllUsers,
UserHandle userToBeInsertedTo)
Adds a call to the call log.
|
static Uri |
addCall(CallerInfo ci,
Context context,
String number,
String postDialDigits,
String viaNumber,
int presentation,
int callType,
int features,
PhoneAccountHandle accountHandle,
long start,
int duration,
Long dataUsage,
boolean addForAllUsers,
UserHandle userToBeInsertedTo,
boolean is_read)
Adds a call to the call log.
|
static String |
getLastOutgoingCall(Context context)
Query the call log database for the last dialed number.
|
static boolean |
shouldHaveSharedCallLogEntries(Context context,
UserManager userManager,
int userId) |
public static final Uri CONTENT_URI
public static final Uri SHADOW_CONTENT_URI
public static final Uri CONTENT_FILTER_URI
public static final String LIMIT_PARAM_KEY
TYPE: integer
public static final String OFFSET_PARAM_KEY
TYPE: integer
public static final String ALLOW_VOICEMAILS_PARAM_KEY
TYPE: Boolean
Using this parameter with a value of true
will result in a security error if the
calling package does not have appropriate permissions to access voicemails.
public static final String EXTRA_CALL_TYPE_FILTER
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);
public static final Uri CONTENT_URI_WITH_VOICEMAIL
public static final String DEFAULT_SORT_ORDER
public static final String CONTENT_TYPE
CONTENT_URI
and CONTENT_FILTER_URI
providing a directory of calls.public static final String CONTENT_ITEM_TYPE
CONTENT_URI
sub-directory of a single
call.public static final String TYPE
Type: INTEGER (int)
Allowed values:
public static final int INCOMING_TYPE
public static final int OUTGOING_TYPE
public static final int MISSED_TYPE
public static final int VOICEMAIL_TYPE
public static final int REJECTED_TYPE
public static final int BLOCKED_TYPE
public static final int ANSWERED_EXTERNALLY_TYPE
public static final String FEATURES
Type: INTEGER (int)
public static final int FEATURES_VIDEO
public static final int FEATURES_PULLED_EXTERNALLY
public static final String NUMBER
Type: TEXT
public static final String NUMBER_PRESENTATION
Allowed values:
Type: INTEGER
public static final int PRESENTATION_ALLOWED
public static final int PRESENTATION_RESTRICTED
public static final int PRESENTATION_UNKNOWN
public static final int PRESENTATION_PAYPHONE
public static final String COUNTRY_ISO
Type: TEXT
public static final String DATE
Type: INTEGER (long)
public static final String DURATION
Type: INTEGER (long)
public static final String DATA_USAGE
Type: INTEGER (long)
public static final String NEW
Type: INTEGER (boolean)
public static final String CACHED_NAME
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
public static final String CACHED_NUMBER_TYPE
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
public static final String CACHED_NUMBER_LABEL
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
public static final String VOICEMAIL_URI
VOICEMAIL_TYPE
.
Type: TEXT
public static final String TRANSCRIPTION
VOICEMAIL_TYPE
that have valid transcriptions.public static final String IS_READ
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)
public static final String GEOCODED_LOCATION
The string represents a city, state, or country associated with the number.
Type: TEXT
public static final String CACHED_LOOKUP_URI
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
public static final String CACHED_MATCHED_NUMBER
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
public static final String CACHED_NORMALIZED_NUMBER
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
public static final String CACHED_PHOTO_ID
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)
public static final String CACHED_PHOTO_URI
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)
public static final String CACHED_FORMATTED_NUMBER
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
public static final String PHONE_ACCOUNT_COMPONENT_NAME
Type: TEXT
public static final String PHONE_ACCOUNT_ID
Type: TEXT
public static final String PHONE_ACCOUNT_ADDRESS
Type: TEXT
public static final String PHONE_ACCOUNT_HIDDEN
PhoneAccount
is registered with the system.
Type: INTEGER
public static final String SUB_ID
Type: INTEGER
public static final String POST_DIAL_DIGITS
TelecomManager.DTMF_CHARACTER_PAUSE
or a TelecomManager.DTMF_CHARACTER_WAIT
and these characters themselves.
Type: TEXT
public static final String VIA_NUMBER
public static final String ADD_FOR_ALL_USERS
Type: INTEGER
public static final String LAST_MODIFIED
Type: INTEGER (long)
public static Uri addCall(CallerInfo ci, Context context, String number, int presentation, int callType, int features, PhoneAccountHandle accountHandle, long start, int duration, Long dataUsage)
ci
- the CallerInfo object to get the target contact from. Can be null
if the contact is unknown.context
- the context used to get the ContentResolvernumber
- the phone number to be added to the calls dbpresentation
- enum value from PhoneConstants.PRESENTATION_xxx, which
is set by the network and denotes the number presenting rules for
"allowed", "payphone", "restricted" or "unknown"callType
- enumerated values for "incoming", "outgoing", or "missed"features
- features of the call (e.g. Video).accountHandle
- The accountHandle object identifying the provider of the callstart
- time stamp for the call in millisecondsduration
- call duration in secondsdataUsage
- data usage for the call in bytes, null if data usage was not tracked for
the call.public static Uri addCall(CallerInfo ci, Context context, String number, String postDialDigits, String viaNumber, int presentation, int callType, int features, PhoneAccountHandle accountHandle, long start, int duration, Long dataUsage, boolean addForAllUsers, UserHandle userToBeInsertedTo)
ci
- the CallerInfo object to get the target contact from. Can be null
if the contact is unknown.context
- the context used to get the ContentResolvernumber
- the phone number to be added to the calls dbviaNumber
- the secondary number that the incoming call received with. If the
call was received with the SIM assigned number, then this field must be ''.presentation
- enum value from PhoneConstants.PRESENTATION_xxx, which
is set by the network and denotes the number presenting rules for
"allowed", "payphone", "restricted" or "unknown"callType
- enumerated values for "incoming", "outgoing", or "missed"features
- features of the call (e.g. Video).accountHandle
- The accountHandle object identifying the provider of the callstart
- time stamp for the call in millisecondsduration
- call duration in secondsdataUsage
- data usage for the call in bytes, null if data usage was not tracked for
the call.addForAllUsers
- If true, the call is added to the call log of all currently
running users. The caller must have the MANAGE_USERS permission if this is true.userToBeInsertedTo
- UserHandle
of user that the call is going to be
inserted to. null if it is inserted to the current user. The
value is ignored if @{link addForAllUsers} is true.public static Uri addCall(CallerInfo ci, Context context, String number, String postDialDigits, String viaNumber, int presentation, int callType, int features, PhoneAccountHandle accountHandle, long start, int duration, Long dataUsage, boolean addForAllUsers, UserHandle userToBeInsertedTo, boolean is_read)
ci
- the CallerInfo object to get the target contact from. Can be null
if the contact is unknown.context
- the context used to get the ContentResolvernumber
- the phone number to be added to the calls dbpostDialDigits
- the post-dial digits that were dialed after the number,
if it was outgoing. Otherwise it is ''.viaNumber
- the secondary number that the incoming call received with. If the
call was received with the SIM assigned number, then this field must be ''.presentation
- enum value from PhoneConstants.PRESENTATION_xxx, which
is set by the network and denotes the number presenting rules for
"allowed", "payphone", "restricted" or "unknown"callType
- enumerated values for "incoming", "outgoing", or "missed"features
- features of the call (e.g. Video).accountHandle
- The accountHandle object identifying the provider of the callstart
- time stamp for the call in millisecondsduration
- call duration in secondsdataUsage
- data usage for the call in bytes, null if data usage was not tracked for
the call.addForAllUsers
- If true, the call is added to the call log of all currently
running users. The caller must have the MANAGE_USERS permission if this is true.userToBeInsertedTo
- UserHandle
of user that the call is going to be
inserted to. null if it is inserted to the current user. The
value is ignored if @{link addForAllUsers} is true.is_read
- Flag to show if the missed call log has been read by the user or not.
Used for call log restore of missed calls.public static boolean shouldHaveSharedCallLogEntries(Context context, UserManager userManager, int userId)