{
GList *l = NULL;
_cal_server_alarm_get_latest(tt_alert, true, &l);
+ if (NULL == l)
+ return;
+
_cal_server_alarm_noti_with_callback(l);
_cal_server_alarm_noti_with_control(l);
+ /* DO NOT FREE LIST, list is freed in callback */
}
static int _alert_cb(alarm_id_t alarm_id, void *data)
{
vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED,
_cal_server_alarm_timechange_cb, NULL);
-
vconf_notify_key_changed(VCONFKEY_TELEPHONY_NITZ_GMT,
_cal_server_alarm_timechange_cb, NULL);
vconf_notify_key_changed(VCONFKEY_TELEPHONY_NITZ_EVENT_GMT,
_cal_server_alarm_timechange_cb, NULL);
}
+void _cal_server_alarm_unset_timechange(void)
+{
+ vconf_ignore_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED,
+ _cal_server_alarm_timechange_cb);
+ vconf_ignore_key_changed(VCONFKEY_TELEPHONY_NITZ_GMT,
+ _cal_server_alarm_timechange_cb);
+ vconf_ignore_key_changed(VCONFKEY_TELEPHONY_NITZ_EVENT_GMT,
+ _cal_server_alarm_timechange_cb);
+ vconf_ignore_key_changed(VCONFKEY_TELEPHONY_NITZ_ZONE,
+ _cal_server_alarm_timechange_cb);
+}
+
static void _changed_cb(const char* view_uri, void* data)
{
CAL_FN_CALL();
return 0;
}
+static void _cal_server_alarm_unset_inotify(calendar_db_changed_cb callback)
+{
+ cal_inotify_unsubscribe(CAL_NOTI_EVENT_CHANGED, callback, NULL);
+ cal_inotify_unsubscribe(CAL_NOTI_TODO_CHANGED, callback, NULL);
+}
+
int cal_server_alarm_init(void)
{
CAL_FN_CALL();
void cal_server_alarm_deinit(void)
{
alarmmgr_fini();
+ _cal_server_alarm_unset_inotify(_changed_cb);
+ _cal_server_alarm_unset_timechange();
+
}
void cal_server_contacts_deinit(void)
{
+ if (_cal_server_contacts_sync_thread)
+ g_thread_join(_cal_server_contacts_sync_thread);
+
contacts_db_remove_changed_cb(_contacts_event._uri, _changed_cb, NULL);
contacts_db_remove_changed_cb(_contacts_name._uri, _changed_cb, NULL);