From ee2db70acb39c5e44be2edeff57d3f2f9ffb7505 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 22 Jan 2019 14:55:10 +0100 Subject: [PATCH] Fix duplication of friend list --- src/android/org/linphone/LinphoneManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/org/linphone/LinphoneManager.java b/src/android/org/linphone/LinphoneManager.java index 010be3315..1d2037a40 100644 --- a/src/android/org/linphone/LinphoneManager.java +++ b/src/android/org/linphone/LinphoneManager.java @@ -183,6 +183,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou private boolean mProximitySensingEnabled; private boolean handsetON = false; private Address mCurrentChatRoomAddress; + private FriendList savedList; public String wizardLoginViewDomain = null; private LinphoneMediaScanner mMediaScanner; @@ -1143,7 +1144,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou //Obiane spec String linphoneRcPath = mServiceContext.getFilesDir().getAbsolutePath() + "/.linphonerc"; String linphoneRcBack = mServiceContext.getFilesDir().getAbsolutePath() + "/linphonerc.back"; - FriendList savedList = lc.getDefaultFriendList(); + savedList = lc.getDefaultFriendList(); if (savedList != null && savedList.getFriends() != null && savedList.getFriends().length > 0) { try { InputStream rc = new FileInputStream(linphoneRcPath); @@ -1676,6 +1677,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou wizardLoginViewDomain = (addr != null) ? addr.getDomain() : ""; } prefs.setPushNotificationEnabled(prefs.isPushNotificationEnabled()); + if (savedList != null) lc.removeFriendList(savedList); File backup = new File(linphoneRcBack); if (backup.exists()) backup.delete(); } else if (state == ConfiguringState.Failed) {