Dedupe same entries in the fasttrack action list.
Fixes b/2159633.
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index 06296cc..a1aeca3 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -1026,39 +1026,19 @@
return false;
}
- if (Phone.CONTENT_ITEM_TYPE.equals(mimetype)
- && Phone.CONTENT_ITEM_TYPE.equals(entry.mimetype)) {
- if (!PhoneNumberUtils.compare(this.context, data, entry.data)) {
- return false;
- }
- } else {
- if (!equals(data, entry.data)) {
- return false;
- }
+ if (!ContactsUtils.areDataEqual(context, mimetype, data, entry.mimetype, entry.data)) {
+ return false;
}
- if (!equals(mimetype, entry.mimetype)
- || !intentCollapsible(intent, entry.intent)
- || !intentCollapsible(secondaryIntent, entry.secondaryIntent)
+ if (!TextUtils.equals(mimetype, entry.mimetype)
+ || !ContactsUtils.areIntentActionEqual(intent, entry.intent)
+ || !ContactsUtils.areIntentActionEqual(secondaryIntent, entry.secondaryIntent)
|| actionIcon != entry.actionIcon) {
return false;
}
return true;
}
-
- private boolean equals(Object a, Object b) {
- return a==b || (a != null && a.equals(b));
- }
-
- private boolean intentCollapsible(Intent a, Intent b) {
- if (a == b) {
- return true;
- } else if ((a != null && b != null) && equals(a.getAction(), b.getAction())) {
- return true;
- }
- return false;
- }
}
/** Cache of the children views of a row */