public class CallerInfo extends Object
Modifier and Type | Field and Description |
---|---|
Drawable |
cachedPhoto
Drawable representing the caller image.
|
Bitmap |
cachedPhotoIcon
Bitmap representing the caller image which has possibly lower
resolution than
cachedPhoto and thus more suitable for
icons (like notification icons). |
String |
cnapName |
Uri |
contactDisplayPhotoUri
Contact display photo URI.
|
boolean |
contactExists |
long |
contactIdOrZero |
Uri |
contactRefUri |
Uri |
contactRingtoneUri |
String |
geoDescription |
boolean |
isCachedPhotoCurrent
Boolean which indicates if
cachedPhoto and
cachedPhotoIcon is fresh enough. |
String |
lookupKey |
String |
name
Please note that, any one of these member variables can be null,
and any accesses to them should be prepared to handle such a case.
|
int |
namePresentation |
boolean |
needUpdate |
String |
normalizedNumber |
String |
numberLabel |
int |
numberPresentation |
int |
numberType |
String |
phoneLabel |
String |
phoneNumber |
int |
photoResource |
boolean |
shouldSendToVoicemail |
static long |
USER_TYPE_CURRENT |
static long |
USER_TYPE_WORK |
long |
userType |
Constructor and Description |
---|
CallerInfo() |
Modifier and Type | Method and Description |
---|---|
static CallerInfo |
getCallerInfo(Context context,
String number)
getCallerInfo given a phone number, look up in the call-log database
for the matching caller id info.
|
static CallerInfo |
getCallerInfo(Context context,
String number,
int subId)
getCallerInfo given a phone number and subscription, look up in the call-log database
for the matching caller id info.
|
static CallerInfo |
getCallerInfo(Context context,
Uri contactRef)
getCallerInfo given a URI, look up in the call-log database
for the uri unique key.
|
static CallerInfo |
getCallerInfo(Context context,
Uri contactRef,
Cursor cursor)
getCallerInfo given a Cursor.
|
protected static String |
getCurrentCountryIso(Context context) |
boolean |
isEmergencyNumber() |
boolean |
isVoiceMailNumber() |
String |
toString()
Returns a string representation of the object.
|
void |
updateGeoDescription(Context context,
String fallbackNumber)
Updates this CallerInfo's geoDescription field, based on the raw
phone number in the phoneNumber field.
|
public static final long USER_TYPE_CURRENT
public static final long USER_TYPE_WORK
public String name
public String phoneNumber
public String normalizedNumber
public String geoDescription
public String cnapName
public int numberPresentation
public int namePresentation
public boolean contactExists
public String phoneLabel
public int numberType
public String numberLabel
public int photoResource
public long contactIdOrZero
public boolean needUpdate
public Uri contactRefUri
public String lookupKey
public long userType
public Uri contactDisplayPhotoUri
public Uri contactRingtoneUri
public boolean shouldSendToVoicemail
public Drawable cachedPhoto
isCachedPhotoCurrent
flag indicates if the image
data needs to be reloaded.public Bitmap cachedPhotoIcon
cachedPhoto
and thus more suitable for
icons (like notification icons).
In usual cases this is just down-scaled image of cachedPhoto
.
If the down-scaling fails, this will just become null.
The isCachedPhotoCurrent
flag indicates if the image
data needs to be reloaded.public boolean isCachedPhotoCurrent
cachedPhoto
and
cachedPhotoIcon
is fresh enough. If it is false,
those images aren't pointing to valid objects.public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor)
context
- the context used to retrieve string constantscontactRef
- the URI to attach to this CallerInfo objectcursor
- the first object in the cursor is used to build the CallerInfo object.public static CallerInfo getCallerInfo(Context context, Uri contactRef)
context
- the context used to get the ContentResolvercontactRef
- the URI used to lookup caller idpublic static CallerInfo getCallerInfo(Context context, String number)
context
- the context used to get the ContentResolvernumber
- the phone number used to lookup caller idpublic static CallerInfo getCallerInfo(Context context, String number, int subId)
context
- the context used to get the ContentResolvernumber
- the phone number used to lookup caller idsubId
- the subscription for checking for if voice mail number or notpublic boolean isEmergencyNumber()
public boolean isVoiceMailNumber()
public void updateGeoDescription(Context context, String fallbackNumber)
context
- the context used to look up the current locale / countryfallbackNumber
- if this CallerInfo's phoneNumber field is empty,
this specifies a fallback number to use instead.public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())