/**
* @brief Sets the job to be automatically scheduled after the device reboots.
* @since_tizen 4.0
+ * @remarks If it's a one-time job, setting it to a persistent job returns
+ * a negative error value on scheduling by using job_scheduler_schedule().
* @param[in] job_info The job info handle
* @param[in] persistent @c true, if the job needs to be automatically scheduled
* @return @c 0 on success,
* otherwise a negative error value
* @retval #JOB_ERROR_NONE Successful
* @retval #JOB_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see job_info_set_once()
+ * @see job_scheduler_schedule()
*/
int job_info_set_persistent(job_info_h job_info, bool persistent);
/**
* @brief Sets the job not to be repeated.
* @since_tizen 4.0
+ * @remarks If it's a persistent job, setting it to a one-time job returns
+ * a negative error value on scheduling by using job_scheduler_schedule().
* @param[in] job_info The job info handle
* @param[in] once @c true, if the job does not need to be repeated
* @return @c 0 on success,
* otherwise a negative error value
* @retval #JOB_ERROR_NONE Successful
* @retval #JOB_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see job_info_set_persistent()
+ * @see job_scheduler_schedule()
*/
int job_info_set_once(job_info_h job_info, bool once);
/**
* @brief Sets the timeout interval of the requirements.
* @since_tizen 4.0
+ * @remarks If the requirements are not satisfied within the timeout value,
+ * the job does not start.
* @param[in] job_info The job info handle
* @param[in] timeout The timeout interval (ms)
* @return @c 0 on success,
#define ARRAY_SIZE(x) ((sizeof(x)) / (sizeof(x[0])))
+#define MAX_REQ_TIMEOUT 10000
+#define MIN_PERIODIC_INTERVAL 10
+
struct job_info_s {
char *job_id;
unsigned int interval; /* Periodic */
__LINE__, NULL);
}
+ if (interval < MIN_PERIODIC_INTERVAL)
+ interval = MIN_PERIODIC_INTERVAL;
+
job_info->interval = interval;
return JOB_ERROR_NONE;
__LINE__, NULL);
}
+ if (timeout > MAX_REQ_TIMEOUT)
+ timeout = MAX_REQ_TIMEOUT;
+
job_info->timeout = timeout;
return JOB_ERROR_NONE;