From 3dc68df0b856eace41aaca6bd0266da023c18835 Mon Sep 17 00:00:00 2001 From: Tony Mak Date: Fri, 11 Mar 2016 15:06:14 +0000 Subject: Query lookup uri with work lookup key directly is not allowed Query lookup uri with work lookup key directly is not allowed, app crashes if doing so. And actually, all APIs do not support work lookup key except those explicitly say it does. This Cls changed two places: 1. Do not pass lookup uri with work lookup to NotificationManager to avoid NotificationManager using the uri to query. 2. Dialer perform query for alternative display name using lookup key. But if it is a work contact, do not do so. Bug: 27146678 Change-Id: Ie59c37ff43b6f953a96564c446d79d8812f5ada1 --- InCallUI/src/com/android/incallui/CallerInfo.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'InCallUI/src/com/android/incallui/CallerInfo.java') diff --git a/InCallUI/src/com/android/incallui/CallerInfo.java b/InCallUI/src/com/android/incallui/CallerInfo.java index a638e114c..f270678e0 100644 --- a/InCallUI/src/com/android/incallui/CallerInfo.java +++ b/InCallUI/src/com/android/incallui/CallerInfo.java @@ -237,12 +237,6 @@ public class CallerInfo { info.name = cursor.getString(columnIndex); } - columnIndex = cursor.getColumnIndex(PhoneLookup.LOOKUP_KEY); - if (columnIndex != -1) { - info.nameAlternative = ContactInfoHelper.lookUpDisplayNameAlternative( - context, cursor.getString(columnIndex)); - } - // Look for the number columnIndex = cursor.getColumnIndex(PhoneLookup.NUMBER); if (columnIndex != -1) { @@ -326,6 +320,9 @@ public class CallerInfo { : contactRef.getQueryParameter(ContactsContract.DIRECTORY_PARAM_KEY); final Long directoryId = directory == null ? null : Longs.tryParse(directory); info.userType = ContactsUtils.determineUserType(directoryId, contactId); + + info.nameAlternative = ContactInfoHelper.lookUpDisplayNameAlternative( + context, info.lookupKeyOrNull, info.userType); } cursor.close(); } -- cgit v1.2.3