Fix new contact not being loaded in QuickContact
When ContactLoader is loading new contact, the reference to old contact
should be set to null so that ContactLoader won't deliver the result for
old contact.
Bug: 30794914
Test: Maually followed repro steps observing new contact is loaded. Also
tested on editing and saving a contact which go through the same logic.
Change-Id: I6c4830ebadaedfdc03616d980999da9da5c46b0b
diff --git a/src/com/android/contacts/common/model/ContactLoader.java b/src/com/android/contacts/common/model/ContactLoader.java
index 0c569ba..2cafc1f 100644
--- a/src/com/android/contacts/common/model/ContactLoader.java
+++ b/src/com/android/contacts/common/model/ContactLoader.java
@@ -299,8 +299,9 @@
public static final int EXPORT_SUPPORT = 5;
}
- public void setLookupUri(Uri lookupUri) {
+ public void setNewLookup(Uri lookupUri) {
mLookupUri = lookupUri;
+ mContact = null;
}
@Override
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index a98baad..81a3741 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -1015,7 +1015,7 @@
destroyInteractionLoaders();
mContactLoader = (ContactLoader) (Loader<?>) getLoaderManager().getLoader(
LOADER_CONTACT_ID);
- mContactLoader.setLookupUri(mLookupUri);
+ mContactLoader.setNewLookup(mLookupUri);
mCachedCp2DataCardModel = null;
}
mContactLoader.forceLoad();