Make default group avatar icon actually work.

This commit is contained in:
Moxie Marlinspike
2014-03-02 13:17:51 -08:00
parent ee921a8f49
commit a2fe8a9d5c
2 changed files with 10 additions and 7 deletions

View File

@@ -18,9 +18,12 @@ import java.util.Map;
public class ContactPhotoFactory {
private static final Object defaultPhotoLock = new Object();
private static final Object defaultPhotoLock = new Object();
private static final Object defaultGroupPhotoLock = new Object();
private static Bitmap defaultContactPhoto;
private static Bitmap defaultGroupContactPhoto;
private static final Map<Uri,Bitmap> localUserContactPhotoCache =
Collections.synchronizedMap(new LRUCache<Uri,Bitmap>(2));
@@ -40,11 +43,11 @@ public class ContactPhotoFactory {
}
public static Bitmap getDefaultGroupPhoto(Context context) {
synchronized (defaultPhotoLock) {
if (defaultContactPhoto == null)
defaultContactPhoto = BitmapFactory.decodeResource(context.getResources(),
R.drawable.ic_group_photo);
return defaultContactPhoto;
synchronized (defaultGroupPhotoLock) {
if (defaultGroupContactPhoto == null)
defaultGroupContactPhoto = BitmapFactory.decodeResource(context.getResources(),
R.drawable.ic_group_photo);
return defaultGroupContactPhoto;
}
}