/** * 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; }
UriUtils.nullForNonContactsUri(updatedInfo.photoUri); if (DialerCompatUtils.isCallsCachedPhotoUriCompatible() && !UriUtils.areEqual(updatedPhotoUriContactsOnly, callLogInfo.photoUri)) { if (DialerCompatUtils.isCallsCachedPhotoUriCompatible()) { values.put(Calls.CACHED_PHOTO_URI, UriUtils.uriToString( UriUtils.nullForNonContactsUri(updatedInfo.photoUri)));