summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorinkyun.kil <inkyun.kil@samsung.com>2015-11-26 14:07:20 +0900
committerJiwoong Im <jiwoong.im@samsung.com>2015-12-08 10:09:44 +0900
commitbb5484a3a939f06edb4bb5478cc234aa995af52b (patch)
tree738d9e450776c34bce658545e3d831e8af2eb66e /include
parent03531adba4e99b162a5a58f04af3da39c59ac5f2 (diff)
downloadalarm-manager-bb5484a3a939f06edb4bb5478cc234aa995af52b.tar.gz
alarm-manager-bb5484a3a939f06edb4bb5478cc234aa995af52b.tar.bz2
alarm-manager-bb5484a3a939f06edb4bb5478cc234aa995af52b.zip
Add new apis to support global alarm
- add api 'alarmmgr_set_global()' and 'alarmmgr_get_global()' - add privilege check for added method call in alarm-server - find login user in launching global alarm Change-Id: I43d22b28d1c36f8817233d4e985027791cb4d1f7
Diffstat (limited to 'include')
-rw-r--r--include/alarm-internal.h3
-rw-r--r--include/alarm.h29
2 files changed, 32 insertions, 0 deletions
diff --git a/include/alarm-internal.h b/include/alarm-internal.h
index 4298c27..87b48b0 100644
--- a/include/alarm-internal.h
+++ b/include/alarm-internal.h
@@ -140,6 +140,8 @@ bool _send_alarm_set_time_with_propagation_delay(alarm_context_t context, unsign
bool _send_alarm_set_timezone(alarm_context_t context, char *tzpath_str, int *error_code);
bool _send_alarm_create_periodic(alarm_context_t context, int interval, int is_ref, int method, alarm_id_t *alarm_id, int *error_code);
bool _send_alarm_set_time(alarm_context_t context, int new_time, int *error_code);
+bool _send_alarm_set_global(alarm_context_t context, int alarm_id, bool global, int *error_code);
+bool _send_alarm_get_global(alarm_context_t context, int alarm_id, bool *global, int *error_code);
/* alarm manager*/
typedef struct {
@@ -170,6 +172,7 @@ typedef struct {
periodic_method_e method;
long requested_interval;
int is_ref;
+ bool global;
} __alarm_info_t;
typedef struct {
diff --git a/include/alarm.h b/include/alarm.h
index fe34d18..0edd294 100644
--- a/include/alarm.h
+++ b/include/alarm.h
@@ -1404,6 +1404,35 @@ int alarmmgr_set_systime_with_propagation_delay(struct timespec new_time, struct
*/
int alarmmgr_set_timezone(char *tzpath_str);
+/**
+ * This function sets global
+ * @remarks The @a alarm_id must be id of alarm which will launch global application.
+ * The function returns an error (error code #ERR_ALARM_INVALID_ID) if it is not.
+ * @param [in] alarm_id the id of the alarm
+ * @param [in] global value to set global or not
+ *
+ * @return @c ALARMMGR_RESULT_SUCCESS on success,
+ * otherwise a negative error value
+ * @retval #ALARMMGR_RESULT_SUCCESS Successful
+ * @retval #ERR_ALARM_INVALID_PARAM Invalid parameter
+ * @retval #ERR_ALARM_INVALID_ID Invaild id of the alarm
+ * @retval #ERR_ALARM_SYSTEM_FAIL System failure
+ */
+int alarmmgr_set_global(alarm_id_t alarm_id, bool global);
+
+/**
+ * This function gets global
+ * @param [in] alarm_id the id of the alarm
+ * @param [out] global Whether the alarm is global or not
+ *
+ * @return @c ALARMMGR_RESULT_SUCCESS on success,
+ * otherwise a negative error value
+ * @retval #ALARMMGR_RESULT_SUCCESS Successful
+ * @retval #ERR_ALARM_INVALID_PARAM Invalid parameter
+ * @retval #ERR_ALARM_INVALID_ID Invaild id of the alarm
+ * @retval #ERR_ALARM_SYSTEM_FAIL System failure
+ */
+int alarmmgr_get_global(const alarm_id_t alarm_id, bool *global);
int alarmmgr_add_alarm_withcb(int alarm_type, time_t trigger_at_time,
time_t interval, alarm_cb_t handler, void *user_param, alarm_id_t *alarm_id);