mirror of
https://github.com/etesync/android
synced 2025-07-18 20:48:10 +00:00
Minor bug fixes
* work-around for crash when remote ETag is empty (shouldn't happen but happens sometimes) * fetch multiple contact URLs (not only the first one) from contacts provider (fixes #150)
This commit is contained in:
parent
4f1488ece5
commit
b3f145f6a8
@ -439,7 +439,7 @@ public class LocalAddressBook extends LocalCollection<Contact> {
|
|||||||
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Website.URL },
|
@Cleanup Cursor cursor = providerClient.query(dataURI(), new String[] { Website.URL },
|
||||||
Website.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
Website.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + "=?",
|
||||||
new String[] { String.valueOf(c.getLocalID()), Website.CONTENT_ITEM_TYPE }, null);
|
new String[] { String.valueOf(c.getLocalID()), Website.CONTENT_ITEM_TYPE }, null);
|
||||||
if (cursor != null && cursor.moveToNext())
|
while (cursor != null && cursor.moveToNext())
|
||||||
c.getURLs().add(cursor.getString(0));
|
c.getURLs().add(cursor.getString(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class SyncManager {
|
|||||||
for (Resource remoteResource : remoteResources) {
|
for (Resource remoteResource : remoteResources) {
|
||||||
try {
|
try {
|
||||||
Resource localResource = local.findByRemoteName(remoteResource.getName(), false);
|
Resource localResource = local.findByRemoteName(remoteResource.getName(), false);
|
||||||
if (!remoteResource.getETag().equals(localResource.getETag()))
|
if (localResource.getETag() == null || localResource.getETag() != remoteResource.getETag())
|
||||||
remotelyUpdated.add(remoteResource);
|
remotelyUpdated.add(remoteResource);
|
||||||
} catch(RecordNotFoundException e) {
|
} catch(RecordNotFoundException e) {
|
||||||
remotelyAdded.add(remoteResource);
|
remotelyAdded.add(remoteResource);
|
||||||
|
Loading…
Reference in New Issue
Block a user