Call forceLoad() when loader is not started to load hi-res photo

The bug occurs because the loader may not actually be in the state
of "started" after calling restartLoader. If this happens, QuickContact
will not get the newly updated hi-res photo since onContentChanged()
will not call forceLoad(). So we call forceLoad() explicitly in this
case. There will be exactly 1 extra load when we call forceLoad()
and will be no extra load otherwise.

Bug 25204200

Change-Id: I41cc35381f7b24c0d461a4b8ed482b675e8ccad9
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 577eebe..e18324c 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -1176,6 +1176,12 @@
             destroyInteractionLoaders();
             mContactLoader = (ContactLoader) getLoaderManager().restartLoader(
                     LOADER_CONTACT_ID, null, mLoaderContactCallbacks);
+            // mContactLoader may not be in the state of "started". If not, onContentChanged() will
+            // not call forceLoad(), so QuickContact will not get the newly updated hi-res
+            // photo. If this is the case, we call forceLoad explicitly. See b/25204200.
+            if (!mContactLoader.isStarted()) {
+                mContactLoader.forceLoad();
+            }
             mCachedCp2DataCardModel = null;
         }