Lightbringer video calling now no longer overrides IMS video calling.
If a user has IMS video calling and Lightbringer video calling enabled, when
they searched for a contact through dialer search, they would perform a
lightbring video call. This was unintended as IMS should have priority.
Bug: 64125770
Test: ContactListItemViewTest
PiperOrigin-RevId: 164058129
Change-Id: Ib2919857ffebd71d7911011274df0a6d07960d5f
diff --git a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java
index b742798..dee5109 100644
--- a/java/com/android/contacts/common/list/PhoneNumberListAdapter.java
+++ b/java/com/android/contacts/common/list/PhoneNumberListAdapter.java
@@ -27,6 +27,7 @@
import android.provider.ContactsContract.CommonDataKinds.SipAddress;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Directory;
+import android.support.annotation.VisibleForTesting;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
@@ -357,7 +358,8 @@
bindPhoneNumber(view, cursor, directory.isDisplayNumber(), position);
}
- protected void bindPhoneNumber(
+ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
+ public void bindPhoneNumber(
ContactListItemView view, Cursor cursor, boolean displayNumber, int position) {
CharSequence label = null;
if (displayNumber && !cursor.isNull(PhoneQuery.PHONE_TYPE)) {
@@ -397,7 +399,8 @@
}
}
- if (LightbringerComponent.get(mContext).getLightbringer().isReachable(mContext, number)) {
+ if (action == ContactListItemView.NONE
+ && LightbringerComponent.get(mContext).getLightbringer().isReachable(mContext, number)) {
action = ContactListItemView.LIGHTBRINGER;
}