Fixing picture loading for directory contacts.

The problem was that LoaderManager no longer delivers
result if it is "the same".  In our case it was not
actually the same (it now had a photo), but it was the
same object, so loader manager ignored the change.

Bug: 3349056
Change-Id: Ifa2379bacaf0f11ac920b9235f0033eebbbc67f2
diff --git a/src/com/android/contacts/ContactLoader.java b/src/com/android/contacts/ContactLoader.java
index 92826fc..f4baf3b 100644
--- a/src/com/android/contacts/ContactLoader.java
+++ b/src/com/android/contacts/ContactLoader.java
@@ -168,6 +168,39 @@
             mStatusResPackage = statusResPackage;
         }
 
+        private Result(Result from) {
+            mLookupUri = from.mLookupUri;
+            mUri = from.mUri;
+            mDirectoryId = from.mDirectoryId;
+            mLookupKey = from.mLookupKey;
+            mId = from.mId;
+            mNameRawContactId = from.mNameRawContactId;
+            mDisplayNameSource = from.mDisplayNameSource;
+            mPhotoId = from.mPhotoId;
+            mPhotoUri = from.mPhotoUri;
+            mDisplayName = from.mDisplayName;
+            mPhoneticName = from.mPhoneticName;
+            mStarred = from.mStarred;
+            mPresence = from.mPresence;
+            mEntities = from.mEntities;
+            mStatuses = from.mStatuses;
+            mStatus = from.mStatus;
+            mStatusTimestamp = from.mStatusTimestamp;
+            mStatusLabel = from.mStatusLabel;
+            mStatusResPackage = from.mStatusResPackage;
+
+            mDirectoryDisplayName = from.mDirectoryDisplayName;
+            mDirectoryType = from.mDirectoryType;
+            mDirectoryAccountType = from.mDirectoryAccountType;
+            mDirectoryAccountName = from.mDirectoryAccountName;
+            mDirectoryExportSupport = from.mDirectoryExportSupport;
+
+            mGroups = from.mGroups;
+
+            mLoadingPhoto = from.mLoadingPhoto;
+            mPhotoBinaryData = from.mPhotoBinaryData;
+        }
+
         /**
          * @param exportSupport See {@link Directory#EXPORT_SUPPORT}.
          */
@@ -932,6 +965,7 @@
         @Override
         protected void onPostExecute(byte[] data) {
             if (mContact != null) {
+                mContact = new Result(mContact);
                 mContact.setPhotoBinaryData(data);
                 mContact.setLoadingPhoto(false);
                 deliverResult(mContact);