Set _DIRTY=0 for new tasks explicitly (fixes #524)

This commit is contained in:
Ricki Hirner 2015-06-11 23:57:41 +02:00
parent 7309e6ab0b
commit 6ec0e6119f

View file

@ -98,7 +98,7 @@ public class LocalTaskList extends LocalCollection<Task> {
LinkedList<LocalTaskList> 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<Task> {
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())