Fixed contact never found if a change in the native addressbook happens after the first fetch

This commit is contained in:
Sylvain Berfini 2017-02-16 16:17:48 +01:00
parent b4e5b5c0d7
commit 0fd4c17f28

View file

@ -328,8 +328,6 @@ public class ContactsManager extends ContentObserver {
boolean found = false;
for (LinphoneContact contact : contacts) {
if (refkey.equals(contact.getAndroidId())) {
// Native matching contact found, link the friend to it
contact.setFriend(friend);
found = true;
break;
}
@ -341,6 +339,7 @@ public class ContactsManager extends ContentObserver {
} else {
// Refkey not null but no contact access => can't link it to native contact so display it on is own
LinphoneContact contact = new LinphoneContact();
// Native matching contact found, link the friend to it
contact.setFriend(friend);
contact.refresh();
if (contact.hasAddress()) {