diff options
author | Victor Chang <vichang@google.com> | 2015-12-17 09:14:15 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2016-01-13 22:10:00 +0000 |
commit | 240523d3e1b4502326c8d0d313dd1787aa8ff024 (patch) | |
tree | d6478e553604cbd844704d03d80708c0951bd23b /src/com/android/dialer/list/RegularSearchListAdapter.java | |
parent | 90a13e94e3d918da73e83d80ab12c6e5f3f76f7e (diff) |
Show work badge icon/description in InCallUI/Dialer
Add work badge icon in calllog for work contacts
To see this feature
1. Receive/Make a call from work contact
(a contact in work profile has the phone number)
2. Drop/miss the call. See a badge icon next to phone label in calllog
BUG=26082618
Change-Id: I7371795e3c3ef925739096f39a70f03722dd430b
Diffstat (limited to 'src/com/android/dialer/list/RegularSearchListAdapter.java')
-rw-r--r-- | src/com/android/dialer/list/RegularSearchListAdapter.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/dialer/list/RegularSearchListAdapter.java b/src/com/android/dialer/list/RegularSearchListAdapter.java index 748f4dcda..4d8bb6df7 100644 --- a/src/com/android/dialer/list/RegularSearchListAdapter.java +++ b/src/com/android/dialer/list/RegularSearchListAdapter.java @@ -21,6 +21,8 @@ import android.net.Uri; import android.text.TextUtils; import com.android.contacts.common.CallUtil; +import com.android.contacts.common.ContactsUtils; +import com.android.contacts.common.compat.DirectoryCompat; import com.android.contacts.common.list.DirectoryPartition; import com.android.contacts.common.util.PhoneNumberHelper; import com.android.dialer.calllog.ContactInfo; @@ -45,19 +47,21 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter { CachedContactInfo cacheInfo = lookupService.buildCachedContactInfo(info); final Cursor item = (Cursor) getItem(position); if (item != null) { + final DirectoryPartition partition = + (DirectoryPartition) getPartition(getPartitionForPosition(position)); + final long directoryId = partition.getDirectoryId(); + info.name = item.getString(PhoneQuery.DISPLAY_NAME); info.type = item.getInt(PhoneQuery.PHONE_TYPE); info.label = item.getString(PhoneQuery.PHONE_LABEL); info.number = item.getString(PhoneQuery.PHONE_NUMBER); final String photoUriStr = item.getString(PhoneQuery.PHOTO_URI); info.photoUri = photoUriStr == null ? null : Uri.parse(photoUriStr); + info.userType = DirectoryCompat.isEnterpriseDirectoryId(directoryId) + ? ContactsUtils.USER_TYPE_WORK : ContactsUtils.USER_TYPE_CURRENT; cacheInfo.setLookupKey(item.getString(PhoneQuery.LOOKUP_KEY)); - final int partitionIndex = getPartitionForPosition(position); - final DirectoryPartition partition = - (DirectoryPartition) getPartition(partitionIndex); - final long directoryId = partition.getDirectoryId(); final String sourceName = partition.getLabel(); if (isExtendedDirectory(directoryId)) { cacheInfo.setExtendedSource(sourceName, directoryId); |