use of com.android.contacts.editor.AggregationSuggestionEngine.RawContact in project packages_apps_Contacts by AOKP.
the class AggregationSuggestionView method handleItemClickEvent.
public boolean handleItemClickEvent() {
if (mListener != null && isEnabled()) {
if (canEditSuggestedContact()) {
if (TextUtils.isEmpty(mLookupKey)) {
return false;
}
mListener.onEditAction(Contacts.getLookupUri(mContactId, mLookupKey));
} else {
ArrayList<Long> rawContactIds = Lists.newArrayList();
for (RawContact rawContact : mRawContacts) {
rawContactIds.add(rawContact.rawContactId);
}
mListener.onJoinAction(mContactId, rawContactIds);
}
return true;
}
return false;
}
use of com.android.contacts.editor.AggregationSuggestionEngine.RawContact in project packages_apps_Contacts by AOKP.
the class AggregationSuggestionView method canEditSuggestedContact.
/**
* Returns true if the suggested contact can be edited.
*/
private boolean canEditSuggestedContact() {
if (!mNewContact) {
return false;
}
AccountTypeManager accountTypes = AccountTypeManager.getInstance(getContext());
for (RawContact rawContact : mRawContacts) {
String accountType = rawContact.accountType;
String dataSet = rawContact.dataSet;
if (accountType == null) {
return true;
}
AccountType type = accountTypes.getAccountType(accountType, dataSet);
if (type.areContactsWritable()) {
return true;
}
}
return false;
}
Aggregations