diff --git a/src/at/bitfire/davdroid/syncadapter/SyncManager.java b/src/at/bitfire/davdroid/syncadapter/SyncManager.java index c806dcdc..2c048414 100644 --- a/src/at/bitfire/davdroid/syncadapter/SyncManager.java +++ b/src/at/bitfire/davdroid/syncadapter/SyncManager.java @@ -63,6 +63,11 @@ public class SyncManager { fetchCollection = true; } + if (!fetchCollection) { + Log.i(TAG, "No local changes and CTags match, ne need to sync"); + return; + } + // PHASE 2B: detect details of remote changes Log.i(TAG, "Fetching remote resource list"); Set remotelyAdded = new HashSet(), @@ -72,7 +77,7 @@ public class SyncManager { for (Resource remoteResource : remoteResources) { try { Resource localResource = local.findByRemoteName(remoteResource.getName(), false); - if (localResource.getETag() == null || localResource.getETag() != remoteResource.getETag()) + if (localResource.getETag() == null || !localResource.getETag().equals(remoteResource.getETag())) remotelyUpdated.add(remoteResource); } catch(RecordNotFoundException e) { remotelyAdded.add(remoteResource);