/*
 * Derived from com.android.mms.data.Contact
 * (tag android-4.4.4_r2.0.1)
 */

package ca.bmaupin.merge.sms.data;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;

public class Contact {
    private String mNumber;
    private String mName;
    
    private long mPersonId;
    private BitmapDrawable mAvatar;
    private byte [] mAvatarData;
	
    public synchronized boolean existsInDatabase() {
        return (mPersonId > 0);
    }
    
    public synchronized Drawable getAvatar(Context context, Drawable defaultValue) {
        if (mAvatar == null) {
            if (mAvatarData != null) {
                Bitmap b = BitmapFactory.decodeByteArray(mAvatarData, 0, mAvatarData.length);
                mAvatar = new BitmapDrawable(context.getResources(), b);
            }
        }
        return mAvatar != null ? mAvatar : defaultValue;
    }
    
    public synchronized String getName() {
        if (TextUtils.isEmpty(mName)) {
            return mNumber;
        } else {
            return mName;
        }
    }
}

@@ -112,16 +112,52 @@
 .data;%0A%0A
+import android.content.ContentUris;%0A
 import a
@@ -335,32 +335,107 @@
 wable.Drawable;%0A
+import android.net.Uri;%0Aimport android.provider.ContactsContract.Contacts;%0A
 import android.t
@@ -1311,10 +1311,136 @@
 %7D%0A    %7D%0A
+    %0A    public synchronized Uri getUri() %7B%0A        return ContentUris.withAppendedId(Contacts.CONTENT_URI, mPersonId);%0A    %7D%0A
 %7D%0A

Add getUri()