Fixed contacts fetch during longer each time it is called

This commit is contained in:
Sylvain Berfini 2017-03-15 15:37:45 +01:00
parent e602d15b75
commit 14ef7c35b9
2 changed files with 5 additions and 0 deletions

View file

@ -278,6 +278,7 @@ public class ContactsManager extends ContentObserver {
for (LinphoneFriend friend : lc.getFriendList()) {
LinphoneContact contact = (LinphoneContact)((LinphoneFriendImpl)friend).getUserData();
if (contact != null) {
contact.clearAddresses();
contacts.add(contact);
if (contact.getAndroidId() != null) {
androidContactsCache.put(contact.getAndroidId(), contact);

View file

@ -500,6 +500,10 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
LinphoneManager.getLcIfManagerNotDestroyedOrNull().removeFriend(friend);
}
}
public void clearAddresses() {
addresses.clear();
}
public void refresh() {
addresses = new ArrayList<LinphoneNumberOrAddress>();