From fb40893c3f4b9c3128da02ba6ce7f3411baaa6d5 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 15 Jan 2013 11:48:08 +0100 Subject: [PATCH] Fix issue in contact helper, where contact wasn't found if he didn't had a picture --- src/org/linphone/ContactHelper.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/org/linphone/ContactHelper.java b/src/org/linphone/ContactHelper.java index b9a80a8c9..1cb1480af 100644 --- a/src/org/linphone/ContactHelper.java +++ b/src/org/linphone/ContactHelper.java @@ -228,17 +228,19 @@ public final class ContactHelper { Uri contactUri = ContentUris.withAppendedId(android.provider.ContactsContract.Contacts.CONTENT_URI, id); Uri photoUri = Uri.withAppendedPath(contactUri, android.provider.ContactsContract.Contacts.Photo.CONTENT_DIRECTORY); if (photoUri == null) { - continue; - } +// continue; +// } String[] photoProj = {android.provider.ContactsContract.CommonDataKinds.Photo.PHOTO}; Cursor cursor = resolver.query(photoUri, photoProj, null, null, null); valid = testPhotoUriAndCloseCursor(cursor); + displayName = c.getString(c.getColumnIndex(android.provider.ContactsContract.PhoneLookup.DISPLAY_NAME)); if (valid) { - displayName = c.getString(c.getColumnIndex(android.provider.ContactsContract.PhoneLookup.DISPLAY_NAME)); foundPhotoUri = photoUri; - c.close(); - return true; + } else { + foundPhotoUri = null; } + c.close(); + return true; } c.close(); return false;