diff --git a/src/com/android/contacts/CallDetailActivity.java b/src/com/android/contacts/CallDetailActivity.java
index cce48dd..e014938 100644
--- a/src/com/android/contacts/CallDetailActivity.java
+++ b/src/com/android/contacts/CallDetailActivity.java
@@ -103,7 +103,7 @@
         PhoneLookup.LABEL,
         PhoneLookup.NUMBER,
         PhoneLookup.NORMALIZED_NUMBER,
-        PhoneLookup.PHOTO_ID,
+        PhoneLookup.PHOTO_URI,
     };
     static final int COLUMN_INDEX_ID = 0;
     static final int COLUMN_INDEX_NAME = 1;
@@ -111,7 +111,7 @@
     static final int COLUMN_INDEX_LABEL = 3;
     static final int COLUMN_INDEX_NUMBER = 4;
     static final int COLUMN_INDEX_NORMALIZED_NUMBER = 5;
-    static final int COLUMN_INDEX_PHOTO_ID = 6;
+    static final int COLUMN_INDEX_PHOTO_URI = 6;
 
     @Override
     protected void onCreate(Bundle icicle) {
@@ -220,7 +220,7 @@
         // We know that all calls are from the same number and the same contact, so pick the first.
         mNumber = details[0].number.toString();
         final long personId = details[0].personId;
-        final long photoId = details[0].photoId;
+        final Uri photoUri = details[0].photoUri;
 
         // Set the details header, based on the first phone call.
         mPhoneCallDetailsHelper.setPhoneCallDetails(mPhoneCallDetailsViews,
@@ -327,7 +327,7 @@
         ListView historyList = (ListView) findViewById(R.id.history);
         historyList.setAdapter(
                 new CallDetailHistoryAdapter(this, mInflater, mCallTypeHelper, details));
-        loadContactPhotos(photoId);
+        loadContactPhotos(photoUri);
     }
 
     /** Return the phone call details for a given call log URI. */
@@ -356,7 +356,7 @@
             int numberType = 0;
             CharSequence numberLabel = "";
             long personId = -1L;
-            long photoId = 0L;
+            Uri photoUri = null;
             // If this is not a regular number, there is no point in looking it up in the contacts.
             if (!mPhoneNumberHelper.canPlaceCallsTo(number)) {
                 numberText = mPhoneNumberHelper.getDisplayNumber(number, null);
@@ -370,7 +370,8 @@
                     if (phonesCursor != null && phonesCursor.moveToFirst()) {
                         personId = phonesCursor.getLong(COLUMN_INDEX_ID);
                         nameText = phonesCursor.getString(COLUMN_INDEX_NAME);
-                        photoId = phonesCursor.getLong(COLUMN_INDEX_PHOTO_ID);
+                        String photoUriString = phonesCursor.getString(COLUMN_INDEX_PHOTO_URI);
+                        photoUri = photoUriString == null ? null : Uri.parse(photoUriString);
                         candidateNumberText = PhoneNumberUtils.formatNumber(
                                 phonesCursor.getString(COLUMN_INDEX_NUMBER),
                                 phonesCursor.getString(COLUMN_INDEX_NORMALIZED_NUMBER),
@@ -390,7 +391,7 @@
                 }
             }
             return new PhoneCallDetails(number, numberText, new int[]{ callType }, date, duration,
-                    nameText, numberType, numberLabel, personId, photoId);
+                    nameText, numberType, numberLabel, personId, photoUri);
         } finally {
             if (callCursor != null) {
                 callCursor.close();
@@ -399,8 +400,8 @@
     }
 
     /** Load the contact photos and places them in the corresponding views. */
-    private void loadContactPhotos(final long photoId) {
-        mContactPhotoManager.loadPhoto(mContactBackgroundView, photoId);
+    private void loadContactPhotos(Uri photoUri) {
+        mContactPhotoManager.loadPhoto(mContactBackgroundView, photoUri);
     }
 
     private String getVoicemailNumber() {
diff --git a/src/com/android/contacts/PhoneCallDetails.java b/src/com/android/contacts/PhoneCallDetails.java
index 6ab47aa..d4786d9 100644
--- a/src/com/android/contacts/PhoneCallDetails.java
+++ b/src/com/android/contacts/PhoneCallDetails.java
@@ -16,6 +16,7 @@
 
 package com.android.contacts;
 
+import android.net.Uri;
 import android.provider.CallLog.Calls;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
 
@@ -45,19 +46,22 @@
     public final CharSequence numberLabel;
     /** The id of the contact associated with this phone call. */
     public final long personId;
-    /** The photo id of the contact associated with this phone call. */
-    public final long photoId;
+    /**
+     * The photo uri of the picture of the contact that is associated with this phone call or
+     * null if there is none.
+     */
+    public final Uri photoUri;
 
     /** Create the details for a call with a number not associated with a contact. */
     public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int[] callTypes,
             long date, long duration) {
-        this(number, formattedNumber, callTypes, date, duration, "", 0, "", -1L, 0L);
+        this(number, formattedNumber, callTypes, date, duration, "", 0, "", -1L, null);
     }
 
     /** Create the details for a call with a number associated with a contact. */
     public PhoneCallDetails(CharSequence number, CharSequence formattedNumber, int[] callTypes,
             long date, long duration, CharSequence name, int numberType, CharSequence numberLabel,
-            long personId, long photoId) {
+            long personId, Uri photoUri) {
         this.number = number;
         this.formattedNumber = formattedNumber;
         this.callTypes = callTypes;
@@ -67,6 +71,6 @@
         this.numberType = numberType;
         this.numberLabel = numberLabel;
         this.personId = personId;
-        this.photoId = photoId;
+        this.photoUri = photoUri;
     }
 }
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index d4871ec..bf70e67 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -120,7 +120,7 @@
                 PhoneLookup.LABEL,
                 PhoneLookup.NUMBER,
                 PhoneLookup.NORMALIZED_NUMBER,
-                PhoneLookup.PHOTO_ID,
+                PhoneLookup.PHOTO_THUMBNAIL_URI,
                 PhoneLookup.LOOKUP_KEY};
 
         public static final int PERSON_ID = 0;
@@ -129,7 +129,7 @@
         public static final int LABEL = 3;
         public static final int MATCHED_NUMBER = 4;
         public static final int NORMALIZED_NUMBER = 5;
-        public static final int PHOTO_ID = 6;
+        public static final int THUMBNAIL_URI = 6;
         public static final int LOOKUP_KEY = 7;
     }
 
@@ -158,7 +158,7 @@
         public String number;
         public String formattedNumber;
         public String normalizedNumber;
-        public long photoId;
+        public Uri thumbnailUri;
         public String lookupKey;
 
         public static ContactInfo EMPTY = new ContactInfo();
@@ -170,7 +170,7 @@
         public String name;
         public int numberType;
         public String numberLabel;
-        public long photoId;
+        public Uri thumbnailUri;
         public String lookupKey;
     }
 
@@ -342,15 +342,15 @@
             mContactInfoCache.expireAll();
         }
 
-        private void enqueueRequest(String number, boolean immediate, int position,
-                String name, int numberType, String numberLabel, long photoId, String lookupKey) {
+        private void enqueueRequest(String number, boolean immediate, int position, String name,
+                int numberType, String numberLabel, Uri thumbnailUri, String lookupKey) {
             CallerInfoQuery ciq = new CallerInfoQuery();
             ciq.number = number;
             ciq.position = position;
             ciq.name = name;
             ciq.numberType = numberType;
             ciq.numberLabel = numberLabel;
-            ciq.photoId = photoId;
+            ciq.thumbnailUri = thumbnailUri;
             ciq.lookupKey = lookupKey;
             synchronized (mRequests) {
                 mRequests.add(ciq);
@@ -431,8 +431,11 @@
                             info.number = dataTableCursor.getString(
                                     dataTableCursor.getColumnIndex(Data.DATA1));
                             info.normalizedNumber = null;  // meaningless for SIP addresses
-                            info.photoId = dataTableCursor.getLong(
-                                    dataTableCursor.getColumnIndex(Data.PHOTO_ID));
+                            final String thumbnailUriString = dataTableCursor.getString(
+                                    dataTableCursor.getColumnIndex(Data.PHOTO_THUMBNAIL_URI));
+                            info.thumbnailUri = thumbnailUriString == null
+                                    ? null
+                                    : Uri.parse(thumbnailUriString);
                             info.lookupKey = dataTableCursor.getString(
                                     dataTableCursor.getColumnIndex(Data.LOOKUP_KEY));
 
@@ -459,7 +462,11 @@
                                     .getString(PhoneQuery.MATCHED_NUMBER);
                             info.normalizedNumber = phonesCursor
                                     .getString(PhoneQuery.NORMALIZED_NUMBER);
-                            info.photoId = phonesCursor.getLong(PhoneQuery.PHOTO_ID);
+                            final String thumbnailUriString = phonesCursor.getString(
+                                    PhoneQuery.THUMBNAIL_URI);
+                            info.thumbnailUri = thumbnailUriString == null
+                                    ? null
+                                    : Uri.parse(thumbnailUriString);
                             info.lookupKey = phonesCursor.getString(PhoneQuery.LOOKUP_KEY);
 
                             infoUpdated = true;
@@ -697,7 +704,7 @@
                 mContactInfoCache.put(number, info);
                 Log.d(TAG, "Contact info missing: " + number);
                 // Request the contact details immediately since they are currently missing.
-                enqueueRequest(number, true, c.getPosition(), "", 0, "", 0L, "");
+                enqueueRequest(number, true, c.getPosition(), "", 0, "", null, "");
             } else if (info != ContactInfo.EMPTY) { // Has been queried
                 if (cachedInfo.isExpired()) {
                     Log.d(TAG, "Contact info expired: " + number);
@@ -707,7 +714,7 @@
                     // The contact info is no longer up to date, we should request it. However, we
                     // do not need to request them immediately.
                     enqueueRequest(number, false, c.getPosition(), info.name, info.type, info.label,
-                            info.photoId, info.lookupKey);
+                            info.thumbnailUri, info.lookupKey);
                 }
 
                 // Format and cache phone number for found contact
@@ -725,7 +732,7 @@
             final String name = info.name;
             final int ntype = info.type;
             final String label = info.label;
-            final long photoId = info.photoId;
+            final Uri thumbnailUri = info.thumbnailUri;
             final String lookupKey = info.lookupKey;
             // Assumes the call back feature is on most of the
             // time. For private and unknown numbers: hide it.
@@ -739,7 +746,7 @@
                 details = new PhoneCallDetails(number, formattedNumber, callTypes, date, duration);
             } else {
                 details = new PhoneCallDetails(number, formattedNumber, callTypes, date, duration,
-                        name, ntype, label, personId, photoId);
+                        name, ntype, label, personId, thumbnailUri);
             }
 
             final boolean isNew = isNewSection(c);
@@ -749,7 +756,7 @@
             final boolean isHighlighted = isNew;
             mCallLogViewsHelper.setPhoneCallDetails(views, details, useIcons, isHighlighted);
             if (views.photoView != null) {
-                bindQuickContact(views.photoView, photoId, personId, lookupKey);
+                bindQuickContact(views.photoView, thumbnailUri, personId, lookupKey);
             }
 
 
@@ -779,10 +786,10 @@
             return callTypes;
         }
 
-        private void bindQuickContact(QuickContactBadge view, long photoId, long contactId,
+        private void bindQuickContact(QuickContactBadge view, Uri thumbnailUri, long contactId,
                 String lookupKey) {
             view.assignContactUri(getContactUri(contactId, lookupKey));
-            mContactPhotoManager.loadPhoto(view, photoId);
+            mContactPhotoManager.loadPhoto(view, thumbnailUri);
         }
 
         private Uri getContactUri(long contactId, String lookupKey) {
