New Google tasks don't have parents

pull/820/head
Alex Baker 6 years ago
parent 7458a276b5
commit c6a1fb65c6

@ -68,11 +68,10 @@ public class GtasksInvoker {
GtasksApiUtilities.unixTimeToGtasksCompletionTime(lastSyncDate).toStringRfc3339())); GtasksApiUtilities.unixTimeToGtasksCompletionTime(lastSyncDate).toStringRfc3339()));
} }
public @Nullable Task createGtask(String listId, Task task, String parent, String priorSiblingId) public @Nullable Task createGtask(String listId, Task task, String priorSiblingId)
throws IOException { throws IOException {
Timber.d("createGtask: %s", prettyPrint(task)); Timber.d("createGtask: %s", prettyPrint(task));
return execute( return execute(service.tasks().insert(listId, task).setPrevious(priorSiblingId));
service.tasks().insert(listId, task).setParent(parent).setPrevious(priorSiblingId));
} }
public void updateGtask(String listId, Task task) throws IOException { public void updateGtask(String listId, Task task) throws IOException {

@ -302,11 +302,10 @@ public class GoogleTaskSynchronizer {
return; return;
} }
} else { } else {
String parent = gtasksSyncService.getRemoteParentId(gtasksMetadata);
String priorSibling = gtasksSyncService.getRemoteSiblingId(listId, gtasksMetadata); String priorSibling = gtasksSyncService.getRemoteSiblingId(listId, gtasksMetadata);
com.google.api.services.tasks.model.Task created = com.google.api.services.tasks.model.Task created =
gtasksInvoker.createGtask(listId, remoteModel, parent, priorSibling); gtasksInvoker.createGtask(listId, remoteModel, priorSibling);
if (created != null) { if (created != null) {
// Update the metadata for the newly created task // Update the metadata for the newly created task

Loading…
Cancel
Save