diff options
author | Andrew Lee <anwlee@google.com> | 2015-09-15 13:07:55 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-09-15 13:27:25 -0700 |
commit | 9b33478f0034b3f7b50d30580f566c3347b8d7a9 (patch) | |
tree | a5a1a713faf84f2389ce0b18d762ef5b411c4c6f /src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java | |
parent | 411dd7401997a83a876446261bdf70b3e2c9c4de (diff) |
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.
Bug: 23640774
Change-Id: Ic83f1e73bfbb3b4e3920051f906a3d83524fc8cd
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java index 5a62a7da1..aa994d25a 100644 --- a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java +++ b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java @@ -156,9 +156,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); |