From 81d7813614e40a6b49132bb284eb8577c34240f8 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Thu, 11 Jun 2015 23:57:41 +0200 Subject: [PATCH] Set _DIRTY=0 for new tasks explicitly (fixes #524) --- .../java/at/bitfire/davdroid/resource/LocalTaskList.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/at/bitfire/davdroid/resource/LocalTaskList.java b/app/src/main/java/at/bitfire/davdroid/resource/LocalTaskList.java index 4d975674..fa34426f 100644 --- a/app/src/main/java/at/bitfire/davdroid/resource/LocalTaskList.java +++ b/app/src/main/java/at/bitfire/davdroid/resource/LocalTaskList.java @@ -98,7 +98,7 @@ public class LocalTaskList extends LocalCollection { LinkedList taskList = new LinkedList<>(); while (cursor != null && cursor.moveToNext()) taskList.add(new LocalTaskList(account, providerClient, cursor.getInt(0), cursor.getString(1))); - return taskList.toArray(new LocalTaskList[0]); + return taskList.toArray(new LocalTaskList[taskList.size()]); } public LocalTaskList(Account account, ContentProviderClient providerClient, long id, String url) throws RemoteException { @@ -248,7 +248,8 @@ public class LocalTaskList extends LocalCollection { if (!update) builder .withValue(entryColumnParentID(), id) - .withValue(entryColumnRemoteName(), task.getName()); + .withValue(entryColumnRemoteName(), task.getName()) + .withValue(entryColumnDirty(), 0); // _DIRTY is INTEGER DEFAULT 1 in org.dmfs.provider.tasks builder.withValue(entryColumnUID(), task.getUid()) .withValue(entryColumnETag(), task.getETag())