BootTask

data class BootTask(val taskKey: String, val mode: BackgroundMode = BackgroundMode.WorkManagerOnce(uniqueName = taskKey), val rescheduleScheduled: BackgroundMode.WorkManagerScheduled? = null)(source)

Descriptor for a task to run automatically on device boot.

Parameters

taskKey

Key of a pre-registered worker (via BackgroundHelper.registerWorker).

mode

Which strategy to use after boot — defaults to BackgroundMode.WorkManagerOnce. Use BackgroundMode.WorkManagerScheduled to resume a weekly schedule after reboot.

rescheduleScheduled

If the task was a BackgroundMode.WorkManagerScheduled, pass the original mode here so the schedule is re-registered correctly on boot.

Constructors

Link copied to clipboard
constructor(taskKey: String, mode: BackgroundMode = BackgroundMode.WorkManagerOnce(uniqueName = taskKey), rescheduleScheduled: BackgroundMode.WorkManagerScheduled? = null)

Properties

Link copied to clipboard
Link copied to clipboard