From 1e550b5a74271121bcb7427b9f482a6f9442f99e Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 12 Sep 2018 14:54:17 +0200 Subject: [PATCH] Do not compute display name using first and last name if display name exists --- .../org/linphone/contacts/LinphoneContact.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/android/org/linphone/contacts/LinphoneContact.java b/src/android/org/linphone/contacts/LinphoneContact.java index 6cb6b5720..353ec689f 100644 --- a/src/android/org/linphone/contacts/LinphoneContact.java +++ b/src/android/org/linphone/contacts/LinphoneContact.java @@ -126,12 +126,14 @@ public class LinphoneContact implements Serializable, Comparable 0 && lastName.length() > 0) { - fullName = firstName + " " + lastName; - } else if (firstName != null && firstName.length() > 0) { - fullName = firstName; - } else if (lastName != null && lastName.length() > 0) { - fullName = lastName; + if (fullName == null) { + if (firstName != null && lastName != null && firstName.length() > 0 && lastName.length() > 0) { + fullName = firstName + " " + lastName; + } else if (firstName != null && firstName.length() > 0) { + fullName = firstName; + } else if (lastName != null && lastName.length() > 0) { + fullName = lastName; + } } }