From fced467693d0f69c355fe12f0f3feecb5caca0da Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Fri, 22 Jan 2016 15:09:40 +0000 Subject: Open work profile QuickContacts for work contacts in personal dialer Set lookup key for enterprise contacts to allow QuickContacts to open it. It requires framework change in NYC to support it. BUG=26176780 Change-Id: I61345d52aa9fa296fdf95eca624b295c86925e46 --- InCallUI/src/com/android/incallui/CallerInfo.java | 4 +++- InCallUI/src/com/android/incallui/ContactInfoCache.java | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/InCallUI/src/com/android/incallui/CallerInfo.java b/InCallUI/src/com/android/incallui/CallerInfo.java index 609696130..670c3fd66 100644 --- a/InCallUI/src/com/android/incallui/CallerInfo.java +++ b/InCallUI/src/com/android/incallui/CallerInfo.java @@ -241,7 +241,9 @@ public class CallerInfo { columnIndex = getColumnIndexForPersonId(contactRef, cursor); if (columnIndex != -1) { contactId = cursor.getLong(columnIndex); - if (contactId != 0 && !Contacts.isEnterpriseContactId(contactId)) { + // QuickContacts in M doesn't support enterprise contact id + if (contactId != 0 && (ContactsUtils.FLAG_N_FEATURE + || !Contacts.isEnterpriseContactId(contactId))) { info.contactIdOrZero = contactId; Log.v(TAG, "==> got info.contactIdOrZero: " + info.contactIdOrZero); diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index bba973b1c..f50cc7e46 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -426,11 +426,14 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete cce.displayPhotoUri = info.contactDisplayPhotoUri; } - if (info.lookupKeyOrNull == null || info.contactIdOrZero == 0) { - Log.v(TAG, "lookup key is null or contact ID is 0. Don't create a lookup uri."); - cce.lookupUri = null; - } else { + // Support any contact id in N because QuickContacts in N starts supporting enterprise + // contact id + if (info.lookupKeyOrNull != null + && (ContactsUtils.FLAG_N_FEATURE || info.contactIdOrZero != 0)) { cce.lookupUri = Contacts.getLookupUri(info.contactIdOrZero, info.lookupKeyOrNull); + } else { + Log.v(TAG, "lookup key is null or contact ID is 0 on M. Don't create a lookup uri."); + cce.lookupUri = null; } cce.photo = photo; -- cgit v1.2.3