Add new enum for inexact interval 41/222341/8
authorInkyun Kil <inkyun.kil@samsung.com>
Tue, 14 Jan 2020 00:45:56 +0000 (09:45 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Fri, 7 Feb 2020 02:22:04 +0000 (11:22 +0900)
Previous inexact alarms were unpredictable.
So new inexact interval enum are added for pridiction

Change-Id: I3dea29c6073b2404d94aea8c21874130eac6f651
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
include/app_alarm.h

index 1b95f04..8a219d9 100644 (file)
@@ -72,6 +72,17 @@ typedef enum {
        ALARM_WEEK_FLAG_SATURDAY = 0x40 /**< Saturday */
 } alarm_week_flag_e;
 
+/**
+ * @brief Enumeration for inexact interval.
+ * @since_tizen 6.0
+ */
+typedef enum {
+       ALARM_STANDARD_INTERVAL_FIFTEEN_MINUTES = 900, /** 900 seconds */
+       ALARM_STANDARD_INTERVAL_HALF_HOUR = ALARM_STANDARD_INTERVAL_FIFTEEN_MINUTES * 2, /** 1800 seconds */
+       ALARM_STANDARD_INTERVAL_HOUR = ALARM_STANDARD_INTERVAL_HALF_HOUR * 2, /** 3600 seconds */
+       ALARM_STANDARD_INTERVAL_DAY = ALARM_STANDARD_INTERVAL_HOUR * 24 /** 86400 seconds */
+} alarm_standard_interval_e;
+
 
 /**
  * @brief Called once for each scheduled alarm to get the alarm ID.
@@ -102,10 +113,13 @@ typedef bool (*alarm_registered_alarm_cb)(int alarm_id, void *user_data);
  *          Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif If @a app_control is specified with service-application, the application is only allowed to run on which has Background Category.
  *          Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif If the appid of @a app_control is not specified, this function is not allowed. In other words, the explicit @a app_control is only allowed.
  *          Since 4.0, %http://tizen.org/privilege/appmanager.launch privilege is additionally required.
+ *          Since 6.0, You can use #alarm_standard_interval_e for @a period. If you use it, the period of alarm is guaranteed.
  *
  * @param[in] app_control The destination app_control to perform a specific task when the alarm is triggered
  * @param[in] delay The amount of time before the first execution (in seconds). Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, Although this is inexact, the alarm will not fire before this time
- * @param[in] period The amount of time between subsequent alarms (in seconds). Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, This value does not guarantee the accuracy. The actual interval is calculated by the OS. The minimum value is 600sec
+ * @param[in] period The amount of time between subsequent alarms (in seconds). Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, This value does not guarantee the accuracy. The actual interval is calculated by the OS.
+ *            Since 6.0 this can be one of the values of #alarm_standard_interval_e. If you uses raw integer value, the value will be phase-aligned with other period of alarm.
+
  * @param[out] alarm_id The alarm ID that uniquely identifies an alarm
  * @return @c 0 on success,
  *         otherwise a negative error value
@@ -501,10 +515,13 @@ int alarm_schedule_noti_once_at_date(notification_h noti, struct tm *date, int *
  *          will be treated as minimum values. Note that @a period cannot be less than 600 seconds, if
  *          a smaller request is supplied it will be silently adjusted to a request of 600.
  *          When the alarm goes off, Alarm Manager will turn on LCD to prohibit background jobs.
+ *          Since 6.0, You can use #alarm_standard_interval_e for @a period. If you use it, the period of alarm is guaranteed.
+ *          Since 6.0, Note that @a period cannot be less than 900 seconds.
  *
  * @param[in] noti The notification to be posted when the alarm is triggered
  * @param[in] delay The amount of time before the first execution (in seconds).
  * @param[in] period The amount of time between subsequent alarms (in seconds).
+ *            Since 6.0 this can be one of the values of #alarm_standard_interval_e. If you uses raw integer value, the value will be phase-aligned with other period of alarm.
  * @param[out] alarm_id The ID which uniquely identifies the scheduled alarm
  * @return @c 0 on success,
  *         otherwise a negative error value