Use contact name for incall view if available

This commit is contained in:
Sylvain Berfini 2013-04-15 10:54:05 +02:00
parent 4c6e9d0101
commit 0cce11b866

View file

@ -1304,14 +1304,18 @@ public class InCallActivity extends FragmentActivity implements
private void setContactName(LinearLayout callView, LinphoneAddress lAddress, String sipUri, Resources resources) {
TextView contact = (TextView) callView.findViewById(R.id.contactNameOrNumber);
if (lAddress.getDisplayName() == null) {
LinphoneUtils.findUriPictureOfContactAndSetDisplayName(lAddress, callView.getContext().getContentResolver());
String displayName = lAddress.getDisplayName();
if (displayName == null) {
if (resources.getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
contact.setText(LinphoneUtils.getUsernameFromAddress(sipUri));
} else {
contact.setText(sipUri);
}
} else {
contact.setText(lAddress.getDisplayName());
contact.setText(displayName);
}
}