diff --git a/src/googleplay/java/org/tasks/gtasks/GoogleTaskSyncAdapter.java b/src/googleplay/java/org/tasks/gtasks/GoogleTaskSyncAdapter.java index f50f7b85a..466bf7b03 100644 --- a/src/googleplay/java/org/tasks/gtasks/GoogleTaskSyncAdapter.java +++ b/src/googleplay/java/org/tasks/gtasks/GoogleTaskSyncAdapter.java @@ -53,7 +53,6 @@ import com.todoroo.astrid.gtasks.api.GtasksInvoker; import com.todoroo.astrid.gtasks.api.HttpNotFoundException; import com.todoroo.astrid.gtasks.sync.GtasksSyncService; import com.todoroo.astrid.gtasks.sync.GtasksTaskContainer; -import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.utility.Constants; import org.tasks.Broadcaster; @@ -93,7 +92,6 @@ public class GoogleTaskSyncAdapter extends InjectingAbstractThreadedSyncAdapter @Inject GtasksPreferenceService gtasksPreferenceService; @Inject Broadcaster broadcaster; - @Inject TaskService taskService; @Inject StoreObjectDao storeObjectDao; @Inject GtasksSyncService gtasksSyncService; @Inject GtasksListService gtasksListService; @@ -389,7 +387,7 @@ public class GoogleTaskSyncAdapter extends InjectingAbstractThreadedSyncAdapter // merge astrid dates with google dates if(task.task.isSaved()) { - Task local = taskService.fetchById(task.task.getId(), Task.PROPERTIES); + Task local = taskDao.fetch(task.task.getId(), Task.PROPERTIES); if (local == null) { task.task.clearValue(Task.ID); task.task.clearValue(Task.UUID); diff --git a/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java b/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java index 9f4f5d7c9..ea0cc29aa 100644 --- a/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java +++ b/src/main/java/com/todoroo/astrid/gcal/GCalHelper.java @@ -14,8 +14,8 @@ import android.text.TextUtils; import android.text.format.Time; import com.todoroo.andlib.utility.DateUtilities; +import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.service.TaskService; import org.tasks.R; import org.tasks.calendars.AndroidCalendarEvent; @@ -35,16 +35,16 @@ public class GCalHelper { /** If task has no estimated time, how early to set a task in calendar (seconds)*/ private static final long DEFAULT_CAL_TIME = DateUtilities.ONE_HOUR; - private final TaskService taskService; + private final TaskDao taskDao; private final Preferences preferences; private final PermissionChecker permissionChecker; private final CalendarEventProvider calendarEventProvider; private final ContentResolver cr; @Inject - public GCalHelper(@ForApplication Context context, TaskService taskService, Preferences preferences, + public GCalHelper(@ForApplication Context context, TaskDao taskDao, Preferences preferences, PermissionChecker permissionChecker, CalendarEventProvider calendarEventProvider) { - this.taskService = taskService; + this.taskDao = taskDao; this.preferences = preferences; this.permissionChecker = permissionChecker; this.calendarEventProvider = calendarEventProvider; @@ -56,7 +56,7 @@ public class GCalHelper { if (!TextUtils.isEmpty(task.getCalendarURI())) { uri = task.getCalendarURI(); } else { - task = taskService.fetchById(task.getId(), Task.CALENDAR_URI); + task = taskDao.fetch(task.getId(), Task.CALENDAR_URI); if(task == null) { return null; } @@ -151,7 +151,7 @@ public class GCalHelper { if(task.containsNonNullValue(Task.CALENDAR_URI)) { uri = task.getCalendarURI(); } else { - task = taskService.fetchById(task.getId(), Task.CALENDAR_URI); + task = taskDao.fetch(task.getId(), Task.CALENDAR_URI); if(task == null) { return false; } diff --git a/src/main/java/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java b/src/main/java/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java index adf070dba..16a803d4e 100644 --- a/src/main/java/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java +++ b/src/main/java/com/todoroo/astrid/gcal/GCalTaskCompleteListener.java @@ -14,8 +14,8 @@ import android.provider.CalendarContract; import android.text.TextUtils; import com.todoroo.astrid.api.AstridApiConstants; +import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.service.TaskService; import org.tasks.R; import org.tasks.injection.BroadcastComponent; @@ -27,7 +27,7 @@ import timber.log.Timber; public class GCalTaskCompleteListener extends InjectingBroadcastReceiver { - @Inject TaskService taskService; + @Inject TaskDao taskDao; @Override public void onReceive(Context context, Intent intent) { @@ -38,7 +38,7 @@ public class GCalTaskCompleteListener extends InjectingBroadcastReceiver { return; } - Task task = taskService.fetchById(taskId, Task.ID, Task.TITLE, Task.CALENDAR_URI); + Task task = taskDao.fetch(taskId, Task.ID, Task.TITLE, Task.CALENDAR_URI); if(task == null) { return; } diff --git a/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java b/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java index 24e27acbe..cb155c840 100644 --- a/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java +++ b/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java @@ -75,7 +75,7 @@ public class TimerPlugin { // if this call comes from tasklist, then we need to fill in the gaps to handle this correctly // this is needed just for stopping a task if (!task.containsNonNullValue(Task.TIMER_START)) { - task = taskService.fetchById(task.getId(), Task.ID, Task.TIMER_START, Task.ELAPSED_SECONDS); + task = taskDao.fetch(task.getId(), Task.ID, Task.TIMER_START, Task.ELAPSED_SECONDS); } if (task == null) { return; diff --git a/src/main/java/com/todoroo/astrid/timers/TimerTaskCompleteListener.java b/src/main/java/com/todoroo/astrid/timers/TimerTaskCompleteListener.java index 7cbac0ebe..8a7d22654 100644 --- a/src/main/java/com/todoroo/astrid/timers/TimerTaskCompleteListener.java +++ b/src/main/java/com/todoroo/astrid/timers/TimerTaskCompleteListener.java @@ -9,8 +9,8 @@ import android.content.Context; import android.content.Intent; import com.todoroo.astrid.api.AstridApiConstants; +import com.todoroo.astrid.dao.TaskDao; import com.todoroo.astrid.data.Task; -import com.todoroo.astrid.service.TaskService; import org.tasks.injection.BroadcastComponent; import org.tasks.injection.InjectingBroadcastReceiver; @@ -19,7 +19,7 @@ import javax.inject.Inject; public class TimerTaskCompleteListener extends InjectingBroadcastReceiver { - @Inject TaskService taskService; + @Inject TaskDao taskDao; @Inject TimerPlugin timerPlugin; @Override @@ -31,7 +31,7 @@ public class TimerTaskCompleteListener extends InjectingBroadcastReceiver { return; } - Task task = taskService.fetchById(taskId, Task.ID, Task.ELAPSED_SECONDS, + Task task = taskDao.fetch(taskId, Task.ID, Task.ELAPSED_SECONDS, Task.TIMER_START); if(task == null || task.getTimerStart() == 0) { return;