Buggy code:
@ VisibleForTesting public class ContactUtil { public static final int INDEX_CONTACT_ID = 0 ; public static final int INDEX_DISPLAY_NAME = 1 ; public static final int INDEX_PHOTO_URI = 2 ; public static final int INDEX_PHONE_EMAIL = 3 ; public static final int INDEX_PHONE_EMAIL_TYPE = 4 ; public static final int INDEX_PHONE_EMAIL_LABEL = 5 ; public static final int INDEX_LOOKUP_KEY = 6 ; public static final int INDEX_DATA_ID = 7 ; public static final int INDEX_SORT_KEY = 8 ; public static final int INDEX_LOOKUP_KEY_FREQUENT = 3 ; public static class PhoneQuery { public static final String SORT_KEY = Phone . SORT_KEY_PRIMARY ; public static final String [ ] PROJECTION = new String [ ] { Phone . CONTACT_ID , Phone . DISPLAY_NAME_PRIMARY , Phone . PHOTO_THUMBNAIL_URI , Phone . NUMBER , Phone . TYPE , Phone . LABEL , Phone . LOOKUP_KEY , Phone . _ID , ContactUtil . PhoneQuery . SORT_KEY } ; } public static class PhoneLookupQuery { public static final String [ ] PROJECTION = new String [ ] { PhoneLookup . _ID , PhoneLookup . DISPLAY_NAME , PhoneLookup . PHOTO_THUMBNAIL_URI , PhoneLookup . NUMBER , PhoneLookup . TYPE , PhoneLookup . LABEL , PhoneLookup . LOOKUP_KEY } ; } public static class FrequentContactQuery { public static final String [ ] PROJECTION = new String [ ] { Contacts . _ID , Contacts . DISPLAY_NAME , Contacts . PHOTO_URI , Phone . LOOKUP_KEY } ; } public static class EmailQuery { public static final String SORT_KEY = Email . SORT_KEY_PRIMARY ; public static final String [ ] PROJECTION = new String [ ] { Email . CONTACT_ID , Email . DISPLAY_NAME_PRIMARY , Email . PHOTO_THUMBNAIL_URI , Email . ADDRESS , Email . TYPE , Email . LABEL , Email . LOOKUP_KEY , Email . _ID , ContactUtil . EmailQuery . SORT_KEY } ; } public static final int INDEX_SELF_QUERY_LOOKUP_KEY = 3 ; public static class SelfQuery { public static final String [ ] PROJECTION = new String [ ] { Profile . _ID , Profile . DISPLAY_NAME_PRIMARY , Profile . PHOTO_THUMBNAIL_URI , Profile . LOOKUP_KEY } ; } public static class StructuredNameQuery { public static final String [ ] PROJECTION = new String [ ] { StructuredName . DISPLAY_NAME , StructuredName . GIVEN_NAME , StructuredName . FAMILY_NAME , StructuredName . PREFIX , StructuredName . MIDDLE_NAME , StructuredName . SUFFIX } ; } public static final int INDEX_STRUCTURED_NAME_DISPLAY_NAME = 0 ; public static final int INDEX_STRUCTURED_NAME_GIVEN_NAME = 1 ; public static final int INDEX_STRUCTURED_NAME_FAMILY_NAME = 2 ; public static final int INDEX_STRUCTURED_NAME_PREFIX = 3 ; public static final int INDEX_STRUCTURED_NAME_MIDDLE_NAME = 4 ; public static final int INDEX_STRUCTURED_NAME_SUFFIX = 5 ; public static final long INVALID_CONTACT_ID = - 1 ; private ContactUtil ( ) { } public static void showOrAddContact ( final View view , final LookupResponse lookupResponse ) { if ( lookupResponse != null ) { ContactBuilder builder = new ContactBuilder ( ContactBuilder . REVERSE_LOOKUP , lookupResponse . mNumber , lookupResponse . mNumber ) ; builder . setName ( Name . createDisplayName ( lookupResponse . mName ) ) ; builder . addPhoneNumber ( PhoneNumber . createMainNumber ( lookupResponse . mNumber ) ) ; <START_BUG> builder . setPhotoUri ( lookupResponse . mPhotoUrl ) ; <END_BUG> builder . setSpamCount ( lookupResponse . mSpamCount ) ; builder . setInfoProviderName ( lookupResponse . mProviderName ) ; builder . addAddress ( Address . createFormattedHome ( lookupResponse . mAddress ) ) ; final Uri lookupUri = builder . build ( ) . getLookupUri ( ) ; QuickContact . showQuickContact ( view . getContext ( ) , view , lookupUri , MODE_LARGE , null ) ; } } public static void showOrAddContact ( final View view , final long contactId , final String contactLookupKey , final Uri avatarUri , final String normalizedDestination ) { } @ VisibleForTesting public static CursorQueryData getSelf ( final Context context ) { } @ VisibleForTesting public static CursorQueryData getPhones ( final Context context ) { } public static CursorQueryData lookupDestination ( final Context context , final String destination ) { } private static boolean shouldFilterForEmail ( final String searchText ) { } public static CursorQueryData filterDestination ( final Context context , final String destination ) { } @ VisibleForTesting public static CursorQueryData filterPhones ( final Context context , final String query ) { } @ VisibleForTesting public static CursorQueryData lookupPhone ( final Context context , final String phone ) { } public static CursorQueryData getFrequentContacts ( final Context context ) { } @ VisibleForTesting public static CursorQueryData filterEmails ( final Context context , final String query ) { } @ VisibleForTesting public static CursorQueryData lookupEmail ( final Context context , final String email ) { } private static CursorQueryData lookupStructuredName ( final Context context , final long contactId , final boolean primaryOnly ) { } public static String lookupFirstName ( final Context context , final long contactId ) { } public static RecipientEntry createRecipientEntry ( final String displayName , final int displayNameSource , final String destination , final int destinationType , final String destinationLabel , final long contactId , final String lookupKey , final long dataId , final String photoThumbnailUri , final boolean firstLevel ) { } public static RecipientEntry createRecipientEntryForPhoneQuery ( final Cursor cursor , final boolean isFirstLevel ) { } public static boolean isValidContactId ( final long contactId ) { } public static boolean isEnterpriseContactId ( final long contactId ) { } public static boolean isWorkProfileSupported ( ) { } private static Uri getEmailContentLookupUri ( ) { } public static Uri getPhoneLookupUri ( ) { } public static boolean hasReadContactsPermission ( ) { } }

Fix:
builder . setPhotoUrl ( lookupResponse . mPhotoUrl ) ;