use of com.android.contacts.common.model.dataitem.PhotoDataItem in project android_packages_apps_Dialer by LineageOS.
the class ContactLoader method loadThumbnailBinaryData.
private void loadThumbnailBinaryData(Contact contactData) {
final long photoId = contactData.getPhotoId();
if (photoId <= 0) {
// No photo ID
return;
}
for (RawContact rawContact : contactData.getRawContacts()) {
for (DataItem dataItem : rawContact.getDataItems()) {
if (dataItem.getId() == photoId) {
if (!(dataItem instanceof PhotoDataItem)) {
break;
}
final PhotoDataItem photo = (PhotoDataItem) dataItem;
contactData.setThumbnailPhotoBinaryData(photo.getPhoto());
break;
}
}
}
}
Aggregations