Proper fix to avoid storing contact in duplicate object
This commit is contained in:
parent
8d8b625768
commit
3258c9f2ee
1 changed files with 12 additions and 23 deletions
|
@ -1063,35 +1063,24 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
|
|||
}
|
||||
sipContactList.add(contact);
|
||||
}
|
||||
for (int i = 0; i < contactCursor.getCount(); i++) {
|
||||
Contact contact = Compatibility.getContact(getContentResolver(), contactCursor, i);
|
||||
Log.e("Contact ID = " + contact.getID());
|
||||
for (Contact c : sipContactList) {
|
||||
if (c.getID().equals(contact.getID())) {
|
||||
Log.e("Match found : Temp ID = " + c.getID());
|
||||
contact = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
contactList.add(contact);
|
||||
}
|
||||
}
|
||||
});
|
||||
sipContactsHandler.start();
|
||||
|
||||
contactList = new ArrayList<Contact>();
|
||||
sipContactList = new ArrayList<Contact>();
|
||||
|
||||
Thread contactsHandler = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < contactCursor.getCount(); i++) {
|
||||
Contact contact = Compatibility.getContact(getContentResolver(), contactCursor, i);
|
||||
// contact.refresh(getContentResolver());
|
||||
//
|
||||
// for (String aon : contact.getNumerosOrAddresses()) {
|
||||
// if (LinphoneUtils.isSipAddress(aon)) {
|
||||
// if (!isContactPresenceDisabled) {
|
||||
// searchFriendAndAddToContact(contact);
|
||||
// }
|
||||
// if (!sipContactList.contains(contact)) {
|
||||
// sipContactList.add(contact);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
contactList.add(contact);
|
||||
}
|
||||
}
|
||||
});
|
||||
contactsHandler.start();
|
||||
}
|
||||
|
||||
private void initInCallMenuLayout(boolean callTransfer) {
|
||||
|
|
Loading…
Reference in a new issue