Do not add LinphoneFriend in LinphoneFriendList if already done before

This commit is contained in:
Sylvain Berfini 2016-08-02 14:27:28 +02:00
parent 9f1360d796
commit 3b885639d0
2 changed files with 12 additions and 9 deletions

View file

@ -446,16 +446,19 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
}
friend.done();
if (!friend.isAlreadyPresentInFriendList()) {
try {
LinphoneManager.getLcIfManagerNotDestroyedOrNull().addFriend(friend);
} catch (LinphoneCoreException e) {
Log.e(e);
}
}
if (!ContactsManager.getInstance().hasContactsAccess()) {
// This refresh is only needed if app has no contacts permission to refresh the list of LinphoneFriends.
// Otherwise contacts will be refreshed due to changes in native contact and the handler in ContactsManager
ContactsManager.getInstance().fetchContactsAsync();
}
} catch (LinphoneCoreException e) {
Log.e(e);
}
}
public void save() {

@ -1 +1 @@
Subproject commit 61a3b8a98e6d35bff351b64e2c6717491792afb3
Subproject commit be38b3474cd4fc3ce48ebc09e645c71b2da857b3