Fixed VERSION check, persist changed values, IM changes.
Moved the buildDiff() VERSION assertion to the first
operation, since otherwise the value has already changed
when we reach it.
Added the few lines needed to start persisting any edited
data. Still need to write the back-off and retry when we
encounter a VERSION failure.
Cleaned up our hard-coded data types, added support for
StructuredPostal and IM editors. Standardized the EditText
flags for IME between the sources. Based on a pending
framework change, moved to using two fields for IM to mirror
how we handle TYPE values.
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index e549da7..751ef75 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -776,25 +776,27 @@
} else if (mimetype.equals(CommonDataKinds.Im.CONTENT_ITEM_TYPE)) {
String[] protocolStrings = getResources().getStringArray(
android.R.array.imProtocols);
- Object protocolObj = ContactsUtils.decodeImProtocol(
- aggCursor.getString(DATA_5_COLUMN));
+ Object protocolObj = aggCursor.getString(DATA_5_COLUMN);
String host = null;
- if (protocolObj instanceof Number) {
- int protocol = ((Number) protocolObj).intValue();
- entry.label = buildActionString(R.string.actionChat,
- protocolStrings[protocol], false);
- host = ContactsUtils.lookupProviderNameFromId(
- protocol).toLowerCase();
- if (protocol == CommonDataKinds.Im.PROTOCOL_GOOGLE_TALK
- || protocol == CommonDataKinds.Im.PROTOCOL_MSN) {
- entry.maxLabelLines = 2;
- }
- } else if (protocolObj != null) {
+ // TODO: fix by moving to contactssource-based rendering rules
+// Object protocolObj = ContactsUtils.decodeImProtocol(
+// aggCursor.getString(DATA_5_COLUMN));
+// if (protocolObj instanceof Number) {
+// int protocol = ((Number) protocolObj).intValue();
+// entry.label = buildActionString(R.string.actionChat,
+// protocolStrings[protocol], false);
+// host = ContactsUtils.lookupProviderNameFromId(
+// protocol).toLowerCase();
+// if (protocol == CommonDataKinds.Im.PROTOCOL_GOOGLE_TALK
+// || protocol == CommonDataKinds.Im.PROTOCOL_MSN) {
+// entry.maxLabelLines = 2;
+// }
+// } else if (protocolObj != null) {
String providerName = (String) protocolObj;
entry.label = buildActionString(R.string.actionChat,
providerName, false);
host = providerName.toLowerCase();
- }
+// }
// Only add the intent if there is a valid host
if (!TextUtils.isEmpty(host)) {