Commit f10d338a authored by Ricki Hirner's avatar Ricki Hirner

Take LAST-MODIFIED of exceptions into consideration

parent 3dfe29c1
Pipeline #13888051 passed with stage
in 1 minute and 28 seconds
......@@ -254,7 +254,6 @@ class SyncAdapter(
private fun processEvents(events: List<Event>) {
Log.i(Constants.TAG, "Processing ${events.size} events")
//String[] uids = new String[events.size()];
val uids = HashSet<String>(events.size)
for (event in events) {
......@@ -272,9 +271,22 @@ class SyncAdapter(
} else {
val localEvent = localEvents.first()
val lastModified = event.lastModified
var lastModified = event.lastModified
if (lastModified != null) {
// process LAST-MODIFIED of exceptions
for (exception in event.exceptions) {
val exLastModified = exception.lastModified
if (exLastModified == null) {
lastModified = null
break
} else if (lastModified != null && exLastModified.dateTime.after(lastModified.date))
lastModified = exLastModified
}
}
if (lastModified == null || lastModified.dateTime.time > localEvent.lastModified) {
// no LAST-MODIFIED or LAST-MODIFIED has been increased
// either there is no LAST-MODIFIED, or LAST-MODIFIED has been increased
localEvent.update(event)
synchronized(syncResult) {
syncResult.stats.numUpdates++
......
Subproject commit ec7bfbc442d5af9f75d1e420ef7d3387d98f2808
Subproject commit 4604c15faf2024267cbee4f911831622855c5ad6
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment