diff options
author | Victor Chang <vichang@google.com> | 2016-01-22 15:09:40 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2016-01-25 18:40:49 +0000 |
commit | fced467693d0f69c355fe12f0f3feecb5caca0da (patch) | |
tree | 2da3361ae5242f6831f735635c63efb00e980a46 | |
parent | 7f07f9f6f1e209359cf069b1fa4b0dfc0b371f64 (diff) |
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
-rw-r--r-- | InCallUI/src/com/android/incallui/CallerInfo.java | 4 | ||||
-rw-r--r-- | 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; |