private ContactInfo createPhoneLookupContactInfo(Cursor phoneLookupCursor, String lookupKey) { ContactInfo info = new ContactInfo(); info.lookupKey = lookupKey; info.lookupUri = Contacts.getLookupUri(phoneLookupCursor.getLong(PhoneQuery.PERSON_ID), lookupKey); info.name = phoneLookupCursor.getString(PhoneQuery.NAME); info.type = phoneLookupCursor.getInt(PhoneQuery.PHONE_TYPE); info.label = phoneLookupCursor.getString(PhoneQuery.LABEL); info.number = phoneLookupCursor.getString(PhoneQuery.MATCHED_NUMBER); info.normalizedNumber = phoneLookupCursor.getString(PhoneQuery.NORMALIZED_NUMBER); info.photoId = phoneLookupCursor.getLong(PhoneQuery.PHOTO_ID); info.photoUri = UriUtils.parseUriOrNull(phoneLookupCursor.getString(PhoneQuery.PHOTO_URI)); info.formattedNumber = null; info.userType = ContactsUtils.determineUserType(null, phoneLookupCursor.getLong(PhoneQuery.PERSON_ID)); return info; }
/** * Returns the contact information stored in an entry of the call log. * * @param c A cursor pointing to an entry in the call log. */ public static ContactInfo getContactInfo(Cursor c) { ContactInfo info = new ContactInfo(); info.lookupUri = UriUtils.parseUriOrNull(c.getString(CallLogQuery.CACHED_LOOKUP_URI)); info.name = c.getString(CallLogQuery.CACHED_NAME); info.type = c.getInt(CallLogQuery.CACHED_NUMBER_TYPE); info.label = c.getString(CallLogQuery.CACHED_NUMBER_LABEL); String matchedNumber = c.getString(CallLogQuery.CACHED_MATCHED_NUMBER); String postDialDigits = CompatUtils.isNCompatible() ? c.getString(CallLogQuery.POST_DIAL_DIGITS) : ""; info.number = (matchedNumber == null) ? c.getString(CallLogQuery.NUMBER) + postDialDigits : matchedNumber; info.normalizedNumber = c.getString(CallLogQuery.CACHED_NORMALIZED_NUMBER); info.photoId = c.getLong(CallLogQuery.CACHED_PHOTO_ID); info.photoUri = DialerCompatUtils.isCallsCachedPhotoUriCompatible() ? UriUtils.nullForNonContactsUri( UriUtils.parseUriOrNull(c.getString(CallLogQuery.CACHED_PHOTO_URI))) : null; info.formattedNumber = c.getString(CallLogQuery.CACHED_FORMATTED_NUMBER); return info; }
actionUri = UriUtils.parseUriOrNull(cursor.getString(VOICEMAIL_ACCESS_URI_INDEX)); actionUri = UriUtils.parseUriOrNull(cursor.getString(SETTINGS_URI_INDEX));