mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
parent
568c69c9be
commit
77e846d24e
@ -10,7 +10,6 @@ import android.provider.ContactsContract.Contacts;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.BitmapUtil;
|
||||
import org.thoughtcrime.securesms.util.LRUCache;
|
||||
|
||||
import java.io.InputStream;
|
||||
@ -60,12 +59,15 @@ public class ContactPhotoFactory {
|
||||
if (contactPhoto == null) {
|
||||
Cursor cursor = context.getContentResolver().query(uri, CONTENT_URI_PROJECTION,
|
||||
null, null, null);
|
||||
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
contactPhoto = getContactPhoto(context, Uri.withAppendedPath(Contacts.CONTENT_URI,
|
||||
cursor.getLong(0) + ""));
|
||||
} else {
|
||||
contactPhoto = getDefaultContactPhoto(context);
|
||||
try {
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
contactPhoto = getContactPhoto(context, Uri.withAppendedPath(Contacts.CONTENT_URI,
|
||||
cursor.getLong(0) + ""));
|
||||
} else {
|
||||
contactPhoto = getDefaultContactPhoto(context);
|
||||
}
|
||||
} finally {
|
||||
if (cursor != null) cursor.close();
|
||||
}
|
||||
|
||||
localUserContactPhotoCache.put(uri, contactPhoto);
|
||||
|
Loading…
x
Reference in New Issue
Block a user