use of com.android.incallui.ContactInfoCache.ContactCacheEntry in project android_packages_apps_Dialer by MoKee.
the class ConferenceParticipantListAdapter method getView.
/**
* Creates or populates an existing conference participant row.
*
* @param position The position of the item within the adapter's data set of the item whose view
* we want.
* @param convertView The old view to reuse, if possible.
* @param parent The parent that this view will eventually be attached to
* @return The populated view.
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Make sure we have a valid convertView to start with
final View result = convertView == null ? mLayoutInflater.inflate(R.layout.caller_in_conference, parent, false) : convertView;
ParticipantInfo participantInfo = mConferenceParticipants.get(position);
Call call = participantInfo.getCall();
ContactCacheEntry contactCache = participantInfo.getContactCacheEntry();
final ContactInfoCache cache = ContactInfoCache.getInstance(mContext);
// photo, do it now.
if (!participantInfo.isCacheLookupComplete()) {
cache.findInfo(participantInfo.getCall(), participantInfo.getCall().getState() == Call.State.INCOMING, new ContactLookupCallback(this));
}
boolean thisRowCanSeparate = mParentCanSeparate && call.getTelecomCall().getDetails().can(android.telecom.Call.Details.CAPABILITY_SEPARATE_FROM_CONFERENCE);
boolean thisRowCanDisconnect = call.getTelecomCall().getDetails().can(android.telecom.Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE);
setCallerInfoForRow(result, contactCache.namePrimary, ContactDisplayUtils.getPreferredDisplayName(contactCache.namePrimary, contactCache.nameAlternative, mContactsPreferences), contactCache.number, contactCache.label, contactCache.lookupKey, contactCache.displayPhotoUri, thisRowCanSeparate, thisRowCanDisconnect, getResourceforState(call.getTrueState()));
// Tag the row in the conference participant list with the call id to make it easier to
// find calls when contact cache information is loaded.
result.setTag(call.getId());
return result;
}
Aggregations