Refreshing view contact based on the result of editing
Specifically, when edit does joins, new contacts and deletes, the lookup key can change beyond recognition.
Change-Id: I6f8ec24ecaf3d1e80f765a5fa9e4fd3d371bf62c
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index 830dd73..6e993ba 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -56,8 +56,8 @@
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
-import android.provider.ContactsContract.Presence;
import android.provider.ContactsContract.RawContacts;
+import android.provider.ContactsContract.StatusUpdates;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
@@ -549,9 +549,13 @@
joinAggregate(contactId);
}
} else if (requestCode == REQUEST_EDIT_CONTACT) {
- // TODO: Bring this back
if (resultCode == EditContactActivity.RESULT_CLOSE_VIEW_ACTIVITY) {
finish();
+ } else {
+ mLookupUri = intent.getData();
+ if (mLookupUri == null) {
+ finish();
+ }
}
}
}
@@ -906,8 +910,8 @@
maxLabelLines = Math.max(maxLabelLines, entry.maxLabelLines);
// Choose the presence with the highest precedence.
- if (Presence.getPresencePrecedence(status)
- < Presence.getPresencePrecedence(entry.status)) {
+ if (StatusUpdates.getPresencePrecedence(status)
+ < StatusUpdates.getPresencePrecedence(entry.status)) {
status = entry.status;
}
@@ -1081,7 +1085,7 @@
presenceIcon = resources.getDrawable(entry.presenceIcon);
} else if (entry.status != -1) {
presenceIcon = resources.getDrawable(
- Presence.getPresenceIconResourceId(entry.status));
+ StatusUpdates.getPresenceIconResourceId(entry.status));
}
ImageView presenceIconView = views.presenceIcon;
if (presenceIcon != null) {