From f72637df6ee6cc0c5bc66205199ed6294f2eb623 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 15 Sep 2015 13:07:55 -0700 Subject: DO NOT MERGE Handle null contact lookup. If we have a null contact lookup, replace the local reference with an EMPTY contact info instance. This fixes a test failure, and possible lookup scenario. Already submitted to master, do not merge. Bug: 24134231 Change-Id: Ia6edd9f601de391257fb805910ef0e42e060c667 --- src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java index 1becc89af..22dece57c 100644 --- a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java +++ b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java @@ -155,9 +155,13 @@ public class CallLogAsyncTaskUtil { boolean isVoicemail = PhoneNumberUtil.isVoicemailNumber(context, accountHandle, number); boolean shouldLookupNumber = PhoneNumberUtil.canPlaceCallsTo(number, numberPresentation) && !isVoicemail; - ContactInfo info = shouldLookupNumber - ? contactInfoHelper.lookupNumber(number, countryIso) - : ContactInfo.EMPTY; + + ContactInfo info = ContactInfo.EMPTY; + if (shouldLookupNumber) { + ContactInfo lookupInfo = contactInfoHelper.lookupNumber(number, countryIso); + info = lookupInfo != null ? lookupInfo : ContactInfo.EMPTY; + } + PhoneCallDetails details = new PhoneCallDetails( context, number, numberPresentation, info.formattedNumber, isVoicemail); -- cgit v1.2.3