Search in sources :

Example 1 with JsonExportTask

use of com.battlelancer.seriesguide.dataliberation.JsonExportTask in project SeriesGuide by UweTrottmann.

the class TaskManager method tryBackupTask.

/**
 * If no {@link AddShowTask} or {@link JsonExportTask} created by this {@link
 * com.battlelancer.seriesguide.util.TaskManager} is running a
 * {@link JsonExportTask} is scheduled in silent mode.
 */
@MainThread
public synchronized boolean tryBackupTask(Context context) {
    if (!isAddTaskRunning() && (backupTask == null || backupTask.isCompleted())) {
        JsonExportTask exportTask = new JsonExportTask(context, null, false, true, null);
        backupTask = exportTask.launch();
        return true;
    }
    return false;
}
Also used : JsonExportTask(com.battlelancer.seriesguide.dataliberation.JsonExportTask) MainThread(androidx.annotation.MainThread)

Example 2 with JsonExportTask

use of com.battlelancer.seriesguide.dataliberation.JsonExportTask in project SeriesGuide by UweTrottmann.

the class TaskManager method tryBackupTask.

/**
     * If no {@link AddShowTask} or {@link JsonExportTask} created by this {@link
     * com.battlelancer.seriesguide.util.TaskManager} is running a
     * {@link JsonExportTask} is scheduled in silent mode.
     */
public synchronized void tryBackupTask() {
    if (!isAddTaskRunning() && (mBackupTask == null || mBackupTask.getStatus() == AsyncTask.Status.FINISHED)) {
        mBackupTask = new JsonExportTask(mContext, null, null, false, true);
        AsyncTaskCompat.executeParallel(mBackupTask);
    }
}
Also used : JsonExportTask(com.battlelancer.seriesguide.dataliberation.JsonExportTask)

Aggregations

JsonExportTask (com.battlelancer.seriesguide.dataliberation.JsonExportTask)2 MainThread (androidx.annotation.MainThread)1