diff options
author | Andrew Lee <anwlee@google.com> | 2015-09-15 13:07:55 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-10-12 11:50:06 -0700 |
commit | f72637df6ee6cc0c5bc66205199ed6294f2eb623 (patch) | |
tree | 6cda0abe08fc2a2f3cf1518ae56a0c3f261646b6 | |
parent | 269d8cc77c4c8ca3d64555b6f554e1333f1e0cb7 (diff) |
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
-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 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); |