Add badge icon for work contact in search result
BUG=26021888 BUG=28016344 (cherry picked from commit 6e00763823cd1b27ff88d25d0eb11f8addc3b2e6) Change-Id: If0e2f7b1c58cd064ebfdae8a9b735b391c5009fc
This commit is contained in:
@@ -46,6 +46,9 @@ public class ContactListItemData {
|
||||
// existing chip for which we show full contact detail for the selected contact).
|
||||
private boolean mSingleRecipient;
|
||||
|
||||
// Is the contact in managed profile.
|
||||
private boolean mIsWorkContact;
|
||||
|
||||
/**
|
||||
* Bind to a contact cursor in the contact list.
|
||||
*/
|
||||
@@ -77,6 +80,8 @@ public class ContactListItemData {
|
||||
mRecipientEntry = ContactUtil.createRecipientEntry(displayName,
|
||||
DisplayNameSources.STRUCTURED_NAME, destination, destinationType, destinationLabel,
|
||||
contactId, lookupKey, dataId, photoThumbnailUri, isFirstLevel);
|
||||
|
||||
mIsWorkContact = ContactUtil.isEnterpriseContactId(contactId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,13 +89,15 @@ public class ContactListItemData {
|
||||
* optional styled name & destination for showing bold search match.
|
||||
*/
|
||||
public void bind(final RecipientEntry entry, final CharSequence styledName,
|
||||
final CharSequence styledDestination, final boolean singleRecipient) {
|
||||
final CharSequence styledDestination, final boolean singleRecipient,
|
||||
final boolean isWorkContact) {
|
||||
Assert.isTrue(entry.isValid());
|
||||
mRecipientEntry = entry;
|
||||
mStyledName = styledName;
|
||||
mStyledDestination = styledDestination;
|
||||
mAlphabetHeader = null;
|
||||
mSingleRecipient = singleRecipient;
|
||||
mIsWorkContact = isWorkContact;
|
||||
}
|
||||
|
||||
public CharSequence getDisplayName() {
|
||||
@@ -157,4 +164,11 @@ public class ContactListItemData {
|
||||
public RecipientEntry getRecipientEntry() {
|
||||
return mRecipientEntry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether the contact is in managed profile.
|
||||
*/
|
||||
public boolean getIsWorkContact() {
|
||||
return mIsWorkContact;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user