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