g_variant_unref(noti_gv);
if (ret != TRUE) {
- /* g_dbus_proxy_call_sync error */
- /* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_create_noti_sync()failed. alarm_id[%d], return_code[%d].",
*(int *)alarm_id, return_code);
}
if (ret != TRUE) {
- /* g_dbus_proxy_call_sync error */
- /* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_create_appsvc_sync()failed. alarm_id[%d], return_code[%d].",
*(int *)alarm_id, return_code);
dst_service_name, dst_service_name_mod,
alarm_id, &return_code,
NULL, &error)) {
- /* g_dbus_proxy_call_sync error error */
- /* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_create_sync()failed. alarm_id[%d], return_code[%d]",
*(int *)alarm_id, return_code);
if (!alarm_manager_call_alarm_get_appsvc_info_sync
((AlarmManager *)context.proxy, alarm_id, &b_data, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_appsvc_info_sync() failed. alarm_id[%d], return_code[%d].",
(int)alarm_id, return_code);
if (error_code) {
if (!alarm_manager_call_alarm_get_noti_info_sync
((AlarmManager *)context.proxy, alarm_id, ¬i_data, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_appsvc_info_sync() failed. alarm_id[%d], return_code[%d].",
(int)alarm_id, return_code);
if (error_code) {
if (!alarm_manager_call_alarm_set_rtc_time_sync
((AlarmManager *)context.proxy, time->year, time->month, time->day,
time->hour, time->min, time->sec, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_set_rtc_time() failed. return_code[%d]", return_code);
if (error_code) {
if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
if (!alarm_manager_call_alarm_delete_sync
((AlarmManager *)context.proxy, alarm_id, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_delete_sync() failed. alarm_id[%d], return_code[%d]",
(int)alarm_id, return_code);
if (error_code) {
if (!alarm_manager_call_alarm_delete_all_sync
((AlarmManager *)context.proxy, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_delete_all_sync() failed. return_code[%d]", return_code);
if (error_code) {
if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
if (!alarm_manager_call_alarm_get_list_of_ids_sync((AlarmManager *)context.proxy,
maxnum_of_ids, &alarm_array,
num_of_ids, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_get_list_of_ids_sync() failed by dbus. alarm_id[%d], return_code[%d]\n",
*(int *)alarm_id, return_code);
gint return_code = 0;
if (!alarm_manager_call_alarm_get_number_of_ids_sync((AlarmManager *)context.proxy, num_of_ids, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_get_number_of_ids_sync() failed by dbus. return_code[%d]",
return_code);
&alarm_info->mode.u_interval.day_of_week,
(gint *)&alarm_info->mode.repeat,
&alarm_info->alarm_type, &alarm_info->reserved_info, &return_code, NULL, &error)) {
- /* g_dbus_proxy_call_sync error */
- /* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_get_info_sync() failed by dbus. alarm_id[%d], return_code[%d]\n",
(int)alarm_id, return_code);
if (!alarm_manager_call_alarm_get_next_duetime_sync((AlarmManager *)context.proxy,
alarm_id, (gint *)duetime, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_get_next_duetime_sync() failed by dbus. alarm_id[%d], return_code[%d]\n",
(int)alarm_id, return_code);
int return_code = 0;
if (!alarm_manager_call_alarm_get_all_info_sync((AlarmManager *)context.proxy, db_path, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_all_info_sync() failed by dbus. return_code[%d]", return_code);
if (error_code) {
if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
int return_code = 0;
if (!alarm_manager_call_alarm_set_time_sync((AlarmManager *)context.proxy, new_time, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_set_time_sync() failed by dbus. return_code[%d]", return_code);
if (error) {
ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
int return_code = 0;
if (!alarm_manager_call_alarm_set_time_with_propagation_delay_sync((AlarmManager *)context.proxy, new_sec, new_nsec, req_sec, req_nsec, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_set_time_with_propagation_delay_sync() failed by dbus. return_code[%d]", return_code);
if (error_code) {
if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
int return_code = 0;
if (!alarm_manager_call_alarm_set_timezone_sync((AlarmManager *)context.proxy, tzpath_str, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_set_timezone_sync() failed by dbus. return_code[%d]", return_code);
if (error_code) {
if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
int return_code = 0;
if (!alarm_manager_call_alarm_set_global_sync((AlarmManager *)context.proxy, alarm_id, global, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_set_global_sync() failed by dbus. return_code[%d]", return_code);
if (error_code) {
if (error && error->code == G_DBUS_ERROR_ACCESS_DENIED)
gboolean _global;
if (!alarm_manager_call_alarm_get_global_sync((AlarmManager *)context.proxy, alarm_id, &_global, &return_code, NULL, &error)) {
- /*g_dbus_proxy_call_sync error */
- /*error_code should be set */
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_global_sync() failed by dbus. return_code[%d]", return_code);
if (error_code) {
if (error->code == G_DBUS_ERROR_ACCESS_DENIED)
NULL
};
-void _initialize_alarm_info(alarm_info_t *alarm)
+void _initialize_alarm_info(alarm_info_t *alarm_info, int alarm_type,
+ time_t trigger_at_time, time_t interval, bool precision)
{
- memset(alarm, 0, sizeof(alarm_info_t));
+ struct timeval current_time;
+ struct tm duetime_tm;
- alarm->mode.repeat = ALARM_REPEAT_MODE_ONCE;
- alarm->alarm_type = ALARM_TYPE_DEFAULT;
+ gettimeofday(¤t_time, NULL);
+
+ memset(alarm_info, 0, sizeof(alarm_info_t));
+
+ alarm_info->mode.repeat = ALARM_REPEAT_MODE_ONCE;
+ alarm_info->alarm_type = alarm_type;
+
+ if (current_time.tv_usec > 500 * 1000) {
+ /* When the millisecond part of the current_time is bigger than 500ms,
+ * the duetime increases by extra 1sec. */
+ current_time.tv_sec += (trigger_at_time + 1);
+ } else {
+ current_time.tv_sec += trigger_at_time;
+ }
+ alarm_info->reserved_info = current_time.tv_sec;
+
+ tzset(); /* Processes the TZ environment variable, and Set timezone, daylight, and tzname. */
+ localtime_r(¤t_time.tv_sec, &duetime_tm);
+
+ alarm_info->start.year = duetime_tm.tm_year + 1900;
+ alarm_info->start.month = duetime_tm.tm_mon + 1;
+ alarm_info->start.day = duetime_tm.tm_mday;
+
+ alarm_info->end.year = 0;
+ alarm_info->end.month = 0;
+ alarm_info->end.day = 0;
+
+ alarm_info->start.hour = duetime_tm.tm_hour;
+ alarm_info->start.min = duetime_tm.tm_min;
+ alarm_info->start.sec = duetime_tm.tm_sec;
+
+ if (interval <= 0) {
+ alarm_info->mode.repeat = ALARM_REPEAT_MODE_ONCE;
+ alarm_info->mode.u_interval.interval = 0;
+ } else {
+ alarm_info->mode.repeat = ALARM_REPEAT_MODE_REPEAT;
+ alarm_info->mode.u_interval.interval = interval;
+ }
+
+ alarm_info->msec = precision ? (int)current_time.tv_usec / 1000 : 0;
+
+ ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d),\
+ repeat(%d), interval(%d), type(%d)",
+ trigger_at_time, alarm_info->start.day, alarm_info->start.month,
+ alarm_info->start.year, alarm_info->start.hour,
+ alarm_info->start.min, alarm_info->start.sec,
+ alarm_info->mode.repeat, (int)alarm_info->mode.u_interval.interval,
+ alarm_info->alarm_type);
}
static void __add_resultcb(alarm_id_t alarm_id, alarm_cb_t cb_func, void *data)
EXPORT_API int alarmmgr_add_alarm_appsvc_with_localtime(alarm_entry_t *alarm, void *bundle_data, alarm_id_t *alarm_id)
{
- alarm_info_t *alarm_info = NULL; /* = (alarm_info_t*)alarm; */
+ alarm_info_t *alarm_info = NULL;
const char *operation = NULL;
int error_code = 0;
const char *appid = NULL;
{
char dst_service_name[MAX_SERVICE_NAME_LEN] = { 0 };
char dst_service_name_mod[MAX_SERVICE_NAME_LEN] = { 0 };
- alarm_info_t *alarm_info; /* = (alarm_info_t*)alarm; */
+ alarm_info_t *alarm_info = NULL;
int ret;
int i = 0;
int j = 0;
EXPORT_API int alarmmgr_add_alarm_noti_with_localtime(alarm_entry_t *alarm, notification_h noti, alarm_id_t *alarm_id)
{
- alarm_info_t *alarm_info = NULL; /* = (alarm_info_t*)alarm; */
+ alarm_info_t *alarm_info = NULL;
int error_code = 0;
if (alarm == NULL)
}
alarm_info = (alarm_info_t *)alarm;
-
if (alarm_info == NULL || alarm_id == NULL) {
ALARM_MGR_EXCEPTION_PRINT("Invalid parameter\n");
return ERR_ALARM_INVALID_PARAM;
}
+
alarm_mode_t *mode = &alarm_info->mode;
ALARM_MGR_EXCEPTION_PRINT("start(%d-%d-%d, %02d:%02d:%02d), end(%d-%d-%d), repeat(%d), interval(%d), type(%d)",
{
int error_code = 0;
int result = 0;
- struct timeval current_time;
- struct tm duetime_tm;
alarm_info_t alarm_info;
const char *operation = NULL;
const char *appid = NULL;
return ERR_ALARM_INVALID_PARAM;
}
- _initialize_alarm_info(&alarm_info);
-
operation = appsvc_get_operation(b);
if (operation == NULL)
appsvc_set_operation(b, APPSVC_OPERATION_DEFAULT);
if (trigger_at_time < 0)
return ERR_ALARM_INVALID_PARAM;
- alarm_info.alarm_type = alarm_type;
- alarm_info.alarm_type |= ALARM_TYPE_RELATIVE;
-
- gettimeofday(¤t_time, NULL);
- if (current_time.tv_usec > 500 * 1000) {
- /* When the millisecond part of the current_time is bigger than 500ms,
- * the duetime increases by extra 1sec. */
- current_time.tv_sec += (trigger_at_time + 1);
- } else {
- current_time.tv_sec += trigger_at_time;
- }
- alarm_info.reserved_info = current_time.tv_sec;
-
- tzset(); /* Processes the TZ environment variable, and Set timezone, daylight, and tzname. */
- localtime_r(¤t_time.tv_sec, &duetime_tm);
-
- alarm_info.start.year = duetime_tm.tm_year + 1900;
- alarm_info.start.month = duetime_tm.tm_mon + 1;
- alarm_info.start.day = duetime_tm.tm_mday;
-
- alarm_info.end.year = 0;
- alarm_info.end.month = 0;
- alarm_info.end.day = 0;
+ _initialize_alarm_info(&alarm_info, alarm_type, trigger_at_time, interval,
+ false);
- alarm_info.start.hour = duetime_tm.tm_hour;
- alarm_info.start.min = duetime_tm.tm_min;
- alarm_info.start.sec = duetime_tm.tm_sec;
+ alarm_info.alarm_type |= ALARM_TYPE_RELATIVE;
+ ALARM_MGR_LOG_PRINT("alarm_info.type : %d", alarm_info.alarm_type);
if (__compare_api_version(&result, getuid()) < 0)
return ERR_ALARM_SYSTEM_FAIL;
alarm_info.alarm_type ^= ALARM_TYPE_INEXACT;
}
- if ((alarm_type & ALARM_TYPE_INEXACT) && interval < MIN_INEXACT_INTERVAL)
- interval = MIN_INEXACT_INTERVAL;
-
- if (interval <= 0) {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_ONCE;
- alarm_info.mode.u_interval.interval = 0;
- } else {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_REPEAT;
- alarm_info.mode.u_interval.interval = interval;
- }
-
- ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
- trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
- alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
- alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+ if ((alarm_type & ALARM_TYPE_INEXACT) &&
+ alarm_info.mode.u_interval.interval < MIN_INEXACT_INTERVAL)
+ alarm_info.mode.u_interval.interval = MIN_INEXACT_INTERVAL;
if (!_send_alarm_create_appsvc(alarm_context, &alarm_info, alarm_id, b, &error_code))
return error_code;
alarm_id_t *alarm_id)
{
int error_code = 0;
- struct timeval current_time;
- struct tm duetime_tm;
alarm_info_t alarm_info;
if (__alarmmgr_init_appsvc() < 0) {
if (trigger_at_time < 0)
return ERR_ALARM_INVALID_PARAM;
- _initialize_alarm_info(&alarm_info);
+ _initialize_alarm_info(&alarm_info, alarm_type, trigger_at_time, interval,
+ false);
- alarm_info.alarm_type = alarm_type;
alarm_info.alarm_type |= ALARM_TYPE_RELATIVE;
+ ALARM_MGR_LOG_PRINT("alarm_info.type : %d", alarm_info.alarm_type);
- gettimeofday(¤t_time, NULL);
- if (current_time.tv_usec > 500 * 1000) {
- /* When the millisecond part of the current_time is bigger than 500ms,
- * the duetime increases by extra 1sec. */
- current_time.tv_sec += (trigger_at_time + 1);
- } else {
- current_time.tv_sec += trigger_at_time;
- }
- alarm_info.reserved_info = current_time.tv_sec;
-
- tzset(); /* Processes the TZ environment variable, and Set timezone, daylight, and tzname. */
- localtime_r(¤t_time.tv_sec, &duetime_tm);
-
- alarm_info.start.year = duetime_tm.tm_year + 1900;
- alarm_info.start.month = duetime_tm.tm_mon + 1;
- alarm_info.start.day = duetime_tm.tm_mday;
-
- alarm_info.end.year = 0;
- alarm_info.end.month = 0;
- alarm_info.end.day = 0;
-
- alarm_info.start.hour = duetime_tm.tm_hour;
- alarm_info.start.min = duetime_tm.tm_min;
- alarm_info.start.sec = duetime_tm.tm_sec;
-
- if ((alarm_info.alarm_type & ALARM_TYPE_INEXACT) && interval < MIN_INEXACT_INTERVAL)
- interval = MIN_INEXACT_INTERVAL;
-
- if (interval <= 0) {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_ONCE;
- alarm_info.mode.u_interval.interval = 0;
- } else {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_REPEAT;
- alarm_info.mode.u_interval.interval = interval;
- }
-
- ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
- trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
- alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
- alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+ if ((alarm_info.alarm_type & ALARM_TYPE_INEXACT) &&
+ alarm_info.mode.u_interval.interval < MIN_INEXACT_INTERVAL)
+ alarm_info.mode.u_interval.interval = MIN_INEXACT_INTERVAL;
if (!_send_alarm_create_noti(alarm_context, &alarm_info, alarm_id, noti, &error_code))
return error_code;
int i = 0;
int j = 0;
int error_code;
- struct timeval current_time;
- struct tm duetime_tm;
alarm_info_t alarm_info;
int ret;
- gettimeofday(¤t_time, NULL);
-
- _initialize_alarm_info(&alarm_info);
-
ret = __sub_init();
if (ret < 0)
return ret;
return ERR_ALARM_INVALID_PARAM;
}
- alarm_info.alarm_type = alarm_type;
- alarm_info.alarm_type |= ALARM_TYPE_RELATIVE;
-
-
- if (current_time.tv_usec > 500 * 1000) {
- /* When the millisecond part of the current_time is bigger than 500ms,
- * the duetime increases by extra 1sec. */
- current_time.tv_sec += (trigger_at_time + 1);
- } else {
- current_time.tv_sec += trigger_at_time;
- }
- alarm_info.reserved_info = current_time.tv_sec;
-
- tzset(); /* Processes the TZ environment variable, and Set timezone, daylight, and tzname. */
- localtime_r(¤t_time.tv_sec, &duetime_tm);
-
- alarm_info.start.year = duetime_tm.tm_year + 1900;
- alarm_info.start.month = duetime_tm.tm_mon + 1;
- alarm_info.start.day = duetime_tm.tm_mday;
-
- alarm_info.msec = precision ? (int)current_time.tv_usec / 1000 : 0;
+ _initialize_alarm_info(&alarm_info, alarm_type, trigger_at_time, interval,
+ precision);
- alarm_info.end.year = 0;
- alarm_info.end.month = 0;
- alarm_info.end.day = 0;
-
- alarm_info.start.hour = duetime_tm.tm_hour;
- alarm_info.start.min = duetime_tm.tm_min;
- alarm_info.start.sec = duetime_tm.tm_sec;
-
- if (interval <= 0) {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_ONCE;
- alarm_info.mode.u_interval.interval = 0;
- } else {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_REPEAT;
- alarm_info.mode.u_interval.interval = interval;
- }
+ alarm_info.alarm_type |= ALARM_TYPE_RELATIVE;
- ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
- trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
- alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
- alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+ ALARM_MGR_LOG_PRINT("alarm_info.type : %d", alarm_info.alarm_type);
if (destination != NULL) {
memset(dst_service_name, 0,
alarm_id_t *alarm_id, bool precision)
{
int error_code = 0;
- struct timeval current_time;
- struct tm duetime_tm;
alarm_info_t alarm_info;
int ret = 0;
- gettimeofday(¤t_time, NULL);
-
- _initialize_alarm_info(&alarm_info);
-
if (flag_appid_checked == 0) {
if (aul_app_get_appid_bypid(getpid(), g_appid, sizeof(g_appid)) != AUL_R_OK)
ALARM_MGR_EXCEPTION_PRINT("PID[%d] may not be app. Please call alarmmgr_init(caller name) in advance.", getpid());
if (trigger_at_time < 0)
return ERR_ALARM_INVALID_PARAM;
- alarm_info.alarm_type = alarm_type;
+ _initialize_alarm_info(&alarm_info, alarm_type, trigger_at_time, interval,
+ precision);
+
alarm_info.alarm_type |= ALARM_TYPE_RELATIVE;
alarm_info.alarm_type |= ALARM_TYPE_WITHCB;
- if (current_time.tv_usec > 500 * 1000) {
- /* When the millisecond part of the current_time is bigger than 500ms, */
- /* the duetime increases by extra 1sec. */
- current_time.tv_sec += (trigger_at_time + 1);
- } else {
- current_time.tv_sec += trigger_at_time;
- }
- alarm_info.reserved_info = current_time.tv_sec;
-
- tzset(); /* Processes the TZ environment variable, and Set timezone, daylight, and tzname. */
- localtime_r(¤t_time.tv_sec, &duetime_tm);
-
- alarm_info.start.year = duetime_tm.tm_year + 1900;
- alarm_info.start.month = duetime_tm.tm_mon + 1;
- alarm_info.start.day = duetime_tm.tm_mday;
-
- alarm_info.msec = precision ? (int)current_time.tv_usec / 1000 : 0;
-
- alarm_info.end.year = 0;
- alarm_info.end.month = 0;
- alarm_info.end.day = 0;
-
- alarm_info.start.hour = duetime_tm.tm_hour;
- alarm_info.start.min = duetime_tm.tm_min;
- alarm_info.start.sec = duetime_tm.tm_sec;
-
- if (interval <= 0) {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_ONCE;
- alarm_info.mode.u_interval.interval = 0;
- } else {
- alarm_info.mode.repeat = ALARM_REPEAT_MODE_REPEAT;
- alarm_info.mode.u_interval.interval = interval;
- }
-
- ALARM_MGR_LOG_PRINT("trigger_at_time(%ld), start(%d-%d-%d, %02d:%02d:%02d), repeat(%d), interval(%d), type(%d)",
- trigger_at_time, alarm_info.start.day, alarm_info.start.month, alarm_info.start.year,
- alarm_info.start.hour, alarm_info.start.min, alarm_info.start.sec,
- alarm_info.mode.repeat, (int)alarm_info.mode.u_interval.interval, alarm_info.alarm_type);
+ ALARM_MGR_LOG_PRINT("alarm_info.type : %d", alarm_info.alarm_type);
if (!_send_alarm_create(alarm_context, &alarm_info, alarm_id, "null", "null", &error_code))
return error_code;
SECURE_LOGD("alarm_manager_call_alarm_get_number_of_ids_sync() is called");
if (!alarm_manager_call_alarm_get_number_of_ids_sync(
(AlarmManager *)alarm_context.proxy, &maxnum_of_ids, &return_code, NULL, &error)) {
- /* dbus error. error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_get_number_of_ids_sync() is failed by dbus. return_code[%d], err message[%s] err code[%d]",
return_code, error->message, error->code);
SECURE_LOGD("alarm_manager_call_alarm_get_list_of_ids_sync() is called");
if (!alarm_manager_call_alarm_get_list_of_ids_sync(
(AlarmManager *)alarm_context.proxy, maxnum_of_ids, &alarm_array, &num_of_ids, &return_code, NULL, &error)) {
- /* dbus error. error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_get_list_of_ids_sync() failed by dbus. num_of_ids[%d], return_code[%d]. err message[%s] err code[%d]", num_of_ids, return_code, error->message, error->code);
if (error->code == G_DBUS_ERROR_ACCESS_DENIED)
return ALARMMGR_RESULT_SUCCESS;
}
-int alarmmgr_create(alarm_info_t *alarm_info, char *destination,
- alarm_id_t *alarm_id)
-{
- char dst_service_name[MAX_SERVICE_NAME_LEN] = { 0 };
- alarm_mode_t *mode = &alarm_info->mode;
- int error_code;
-
- ALARM_MGR_LOG_PRINT("[alarm-lib]:alarm_create() is called\n");
-
- if (alarm_info == NULL || alarm_id == NULL)
- return ERR_ALARM_INVALID_PARAM;
-
- ALARM_MGR_LOG_PRINT("alarm_info->start.year(%d), "
- "alarm_info->start.month(%d), alarm_info->start.day(%d)",
- alarm_info->start.year, alarm_info->start.month,
- alarm_info->start.day);
-
- /* TODO: This should be changed to > ALARM_REPEAT_MODE_MAX ? */
- if (mode->repeat >= ALARM_REPEAT_MODE_MAX)
- return ERR_ALARM_INVALID_PARAM;
-
- if (!__alarm_validate_date(&alarm_info->start, &error_code)) {
- ALARM_MGR_EXCEPTION_PRINT("start date error\n");
- return error_code;
- }
-
- if (!__alarm_validate_time(&alarm_info->start, &error_code)) {
- ALARM_MGR_EXCEPTION_PRINT("start time error\n");
- return error_code;
- }
-
- if (!__alarm_validate_date(&alarm_info->end, &error_code)) {
- ALARM_MGR_EXCEPTION_PRINT("end date error\n");
- return error_code;
- }
-
- if (destination != NULL) {
- memset(dst_service_name, 0,
- strlen(destination) + strlen("ALARM.") + 2);
- snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "ALARM.%s",
- destination);
- if (!_send_alarm_create(alarm_context, alarm_info,
- alarm_id, dst_service_name, "null",
- &error_code))
- return error_code;
- }
-
- /*TODO: Currently this API is not exported. Hence not modifying*/
- if (!_send_alarm_create(alarm_context, alarm_info, alarm_id,
- "null", "null", &error_code))
- return error_code;
-
- return ALARMMGR_RESULT_SUCCESS;
-}
-
int alarmmgr_get_number_of_ids(int *num_of_ids)
{
int error_code;
EXPORT_API int alarmmgr_update_alarm(alarm_id_t alarm_id,
alarm_entry_t *alarm, int update_flag)
{
- alarm_info_t *alarm_info; /* = (alarm_info_t*)alarm; */
+ alarm_info_t *alarm_info;
int ret;
ALARM_MGR_LOG_PRINT("[alarm-lib]:alarmmgr_update_alarm() is called\n");