alarm_info->end.month,
alarm_info->end.day,
alarm_info->mode.u_interval.day_of_week,
+ alarm_info->mode.u_interval.interval,
alarm_info->mode.repeat,
alarm_info->alarm_type,
alarm_info->reserved_info,
/* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_create_appsvc_sync()failed. alarm_id[%d], return_code[%d].", alarm_id, return_code);
- ALARM_MGR_EXCEPTION_PRINT("error->message is %s.", error->message);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
}
g_free(e_cookie);
/* error_code should be set */
ALARM_MGR_EXCEPTION_PRINT(
"alarm_manager_call_alarm_create_sync()failed. alarm_id[%d], return_code[%d]", alarm_id, return_code);
- ALARM_MGR_EXCEPTION_PRINT("error->message is %s", error->message);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
if (!alarm_manager_call_alarm_create_periodic_sync((AlarmManager*)context.proxy,
g_quark_to_string(context.quark_app_service_name),
g_quark_to_string(context.quark_app_service_name_mod),
- interval, is_ref, method,
- e_cookie,
- alarm_id, &return_code, NULL, &error)) {
+ interval, is_ref, method, e_cookie, alarm_id, &return_code, NULL, &error)) {
ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_create_periodic_sync()failed. alarm_id[%d], return_code[%d]",
alarm_id, return_code);
- ALARM_MGR_EXCEPTION_PRINT("error->message is %s", error->message);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
bundle *b = NULL;
char *e_cookie = NULL;
gchar *b_data = NULL;
- int len = 0;
e_cookie = __get_cookie(error_code);
if (e_cookie == NULL) {
/* 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].", alarm_id, return_code);
-
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
bool _send_alarm_set_rtc_time(alarm_context_t context, alarm_date_t *time, int *error_code){
GError *error = NULL;
+ int return_code = 0;
char *e_cookie = NULL;
e_cookie = __get_cookie(error_code);
}
if (!alarm_manager_call_alarm_set_rtc_time_sync
- ((AlarmManager*)context.proxy, context.pid,
- time->year, time->month, time->day,
- time->hour, time->min, time->sec,
- e_cookie, NULL, NULL, &error)) {
+ ((AlarmManager*)context.proxy, context.pid, time->year, time->month, time->day,
+ time->hour, time->min, time->sec, e_cookie, &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) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
g_free(e_cookie);
+ if (return_code != 0) {
+ if (error_code) {
+ *error_code = return_code;
+ }
+ return false;
+ }
+
return true;
}
/* 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]", alarm_id, return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
/* 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) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
GError *error = NULL;
GVariant *alarm_array = NULL;
int return_code = 0;
- int i = 0;
if (!alarm_manager_call_alarm_get_list_of_ids_sync((AlarmManager*)context.proxy,
context.pid, maxnum_of_ids, &alarm_array,
/* 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", alarm_id, return_code);
+ "alarm_manager_call_alarm_get_list_of_ids_sync() failed by dbus. alarm_id[%d], return_code[%d]", alarm_id, return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
if (!alarm_manager_call_alarm_get_number_of_ids_sync((AlarmManager*)context.proxy, context.pid, e_cookie, 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[%s].",
- return_code, error->message);
-
+ ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_number_of_ids_sync() failed by dbus. return_code[%d]", return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
/* 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", alarm_id, return_code);
+ "alarm_manager_call_alarm_get_info_sync() failed by dbus. alarm_id[%d], return_code[%d]", alarm_id, return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
}
if (!alarm_manager_call_alarm_get_next_duetime_sync((AlarmManager*)context.proxy,
- context.pid, alarm_id, e_cookie, duetime, &return_code, NULL, &error)) {
+ context.pid, alarm_id, e_cookie, (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", alarm_id, return_code);
+ "alarm_manager_call_alarm_get_next_duetime_sync() failed by dbus. alarm_id[%d], return_code[%d]", alarm_id, return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
if (!alarm_manager_call_alarm_get_all_info_sync((AlarmManager*)context.proxy, context.pid, e_cookie, 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][%s]", return_code, error->message);
+ ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_get_all_info_sync() failed by dbus. return_code[%d]", return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
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][%s]", return_code, error->message);
+ 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);
+ g_error_free(error);
+ }
+ if (error_code) {
+ *error_code = ERR_ALARM_SYSTEM_FAIL;
+ }
+ return false;
+ }
+
+ if (return_code != ALARMMGR_RESULT_SUCCESS) {
+ if (error_code) {
+ *error_code = return_code;
+ }
+ return false;
+ }
+
+ return true;
+}
+
+
+bool _send_alarm_set_time_with_propagation_delay(alarm_context_t context, unsigned int new_sec, unsigned int new_nsec, unsigned int req_sec, unsigned int req_nsec, int *error_code)
+{
+ GError *error = NULL;
+ 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) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}
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][%s]", return_code, error->message);
+ ALARM_MGR_EXCEPTION_PRINT("alarm_manager_call_alarm_set_timezone_sync() failed by dbus. return_code[%d]", return_code);
+ if (error) {
+ ALARM_MGR_EXCEPTION_PRINT("dbus error message: %s", error->message);
+ g_error_free(error);
+ }
if (error_code) {
*error_code = ERR_ALARM_SYSTEM_FAIL;
}