Suppress refresh and sync during import

gtask_related_email
Alex Baker 5 years ago
parent 40a542b945
commit 4902a3aedd

@ -1,5 +1,7 @@
package org.tasks.backup; package org.tasks.backup;
import static com.todoroo.astrid.dao.TaskDao.TRANS_SUPPRESS_REFRESH;
import static com.todoroo.astrid.data.SyncFlags.GTASKS_SUPPRESS_SYNC;
import static org.tasks.backup.TasksJsonExporter.UTF_8; import static org.tasks.backup.TasksJsonExporter.UTF_8;
import static org.tasks.data.Place.newPlace; import static org.tasks.data.Place.newPlace;
@ -13,6 +15,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.todoroo.andlib.utility.DialogUtilities; import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.SyncFlags;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@ -179,6 +182,8 @@ public class TasksJsonImporter {
skipCount++; skipCount++;
continue; continue;
} }
task.putTransitory(TRANS_SUPPRESS_REFRESH, true);
task.putTransitory(GTASKS_SUPPRESS_SYNC, true);
taskDao.createNew(task); taskDao.createNew(task);
long taskId = task.getId(); long taskId = task.getId();
String taskUuid = task.getUuid(); String taskUuid = task.getUuid();

Loading…
Cancel
Save