use of com.vodafone360.people.datatypes.ContactChanges in project 360-Engine-for-Android by 360.
the class DownloadServerContacts method syncContactChangesPage.
/**
* Processes the response from the server. First separates new contacts from
* existing ones, this is to optimise adding new contacts during first time
* sync.
*
* @param changes The contact change information received from the server
* @return SUCCESS or a suitable error code
*/
private ServiceStatus syncContactChangesPage(ContactChanges changes) {
mContactsChangedList.clear();
int i = 0;
for (Contact contact : changes.mContacts) {
i += 1;
updateProgressUi(contact, i);
if (Settings.ENABLED_CONTACTS_SYNC_TRACE) {
if (contact.details.size() == 0 || contact.deleted != null) {
LogUtils.logD("Contact In: " + contact.contactID + ", Del: " + contact.deleted + ", details: " + contact.details.size());
}
for (ContactDetail detail : contact.details) {
LogUtils.logD("Contact In: " + contact.contactID + ", Detail: " + detail.key + ", " + detail.unique_id + ", " + detail.keyType + " = " + detail.value + ", del = " + detail.deleted);
}
}
if (mServerIdSet.contains(contact.contactID)) {
mContactsChangedList.add(contact);
} else {
if (contact.deleted != null && contact.deleted.booleanValue()) {
if (EXTRA_DEBUG_TRACE) {
LogUtils.logD("DownloadServerContacts.syncDownContact() " + "Delete Contact (nothing to do) " + contact.contactID);
}
} else if (contact.details.size() > 0) {
if (EXTRA_DEBUG_TRACE) {
LogUtils.logD("DownloadServerContacts.syncDownContact() Adding " + contact.contactID);
}
mAddContactList.add(contact);
mSyncDataPending = true;
} else {
if (EXTRA_DEBUG_TRACE) {
LogUtils.logD("DownloadServerContacts.syncDownContact() Empty " + contact.contactID);
}
}
}
}
if (mSyncDataPending || mContactsChangedList.size() > 0) {
setTimeout(TIMEOUT_BETWEEN_PAGES_MS);
}
return ServiceStatus.SUCCESS;
}
Aggregations