Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f72637df authored by Andrew Lee's avatar Andrew Lee
Browse files

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
parent 269d8cc7
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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);