Add Organization and Note kinds to Exchange viewing/editing
Also add placeholder "chat" string to show as label for exchange im
items.
Fixes bug 2072710 and 2092920
Change-Id: I5c3ba0c73160f93b6d06b5b6a2ca20a84f56da18
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index b29a44c..36d9ee6 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -22,6 +22,7 @@
import com.android.contacts.model.ContactsSource;
import com.android.contacts.model.Sources;
import com.android.contacts.model.ContactsSource.DataKind;
+import com.android.contacts.model.HardCodedSources.SimpleInflater;
import com.android.contacts.ui.FastTrackWindow;
import com.android.contacts.util.NotifyingAsyncQueryHandler;
import com.android.internal.telephony.ITelephony;
@@ -993,6 +994,13 @@
entry.secondaryIntent = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("sms", entry.data, null));
entry.data = PhoneNumberUtils.stripSeparators(entry.data);
+
+ // If data is empty, don't show it.
+ if (TextUtils.isEmpty(entry.data)) {
+ Log.w(TAG, "empty data for contact method " + id);
+ continue;
+ }
+
entry.isPrimary = isSuperPrimary;
mPhoneEntries.add(entry);
@@ -1007,6 +1015,10 @@
// Build email entries
entry.intent = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto", entry.data, null));
+ // Temporary hack until we get real label resources for exchange.
+ if (TextUtils.isEmpty(entry.label)) {
+ entry.label = getString(R.string.email).toLowerCase();
+ }
entry.isPrimary = isSuperPrimary;
mEmailEntries.add(entry);
} else if (CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE.
@@ -1020,6 +1032,10 @@
Object protocolObj = entryValues.getAsInteger(Data.DATA5);
String host = null;
+ if (TextUtils.isEmpty(entry.label)) {
+ entry.label = getString(R.string.im).toLowerCase();
+ }
+
if (protocolObj instanceof Number) {
int protocol = ((Number) protocolObj).intValue();
host = ContactsUtils.lookupProviderNameFromId(