Apply to sending system-event in alarm-manager 46/53946/2 accepted/tizen/ivi/20160218.023400 accepted/tizen/mobile/20151212.071318 accepted/tizen/tv/20151212.072753 accepted/tizen/wearable/20151212.073414 submit/tizen/20151211.090312 submit/tizen_common/20151229.142028 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000002
authorJiwoong Im <jiwoong.im@samsung.com>
Thu, 10 Dec 2015 09:33:26 +0000 (18:33 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Thu, 10 Dec 2015 09:36:07 +0000 (01:36 -0800)
Change-Id: I843e91913d5f3877ca00a7a89cd77d712cab4561
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
CMakeLists.txt
alarm-manager.c
packaging/alarm-manager.spec

index 7e5447b..7f9c608 100644 (file)
@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(
        include
 )
 
-SET(DEPS_PKGS "glib-2.0 dlog aul bundle db-util appsvc pkgmgr-info vconf gio-2.0 gio-unix-2.0 capi-system-device libtzplatform-config libsystemd-login")
+SET(DEPS_PKGS "glib-2.0 dlog aul bundle db-util appsvc pkgmgr-info vconf gio-2.0 gio-unix-2.0 capi-system-device libtzplatform-config libsystemd-login eventsystem")
 
 IF(_APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG)
 ADD_DEFINITIONS("-D_APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG")
index 783ed25..4916f8a 100644 (file)
@@ -44,6 +44,7 @@
 #include <pkgmgr-info.h>
 #include <device/display.h>
 #include <systemd/sd-login.h>
+#include <eventsystem.h>
 
 #include <glib.h>
 #if !GLIB_CHECK_VERSION (2, 31, 0)
@@ -1666,6 +1667,11 @@ static void __on_system_time_external_changed(keynode_t *node, void *data)
        __set_time(cur_time);
 
        vconf_set_int(VCONFKEY_SYSTEM_TIME_CHANGED,(int)diff_time);
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add_str(b, EVT_KEY_TIME_CHANGED, EVT_VAL_TIME_CHANGED_TRUE);
+       eventsystem_send_system_event(SYS_EVENT_TIME_CHANGED, b);
+       bundle_free(b);
 
        __alarm_update_due_time_of_all_items_in_list(diff_time);
 
@@ -2000,6 +2006,11 @@ void __reschedule_alarms_with_newtime(int cur_time, int new_time, double diff_ti
 #endif
 
        vconf_set_int(VCONFKEY_SYSTEM_TIME_CHANGED,(int)diff_time);
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add_str(b, EVT_KEY_TIME_CHANGED, EVT_VAL_TIME_CHANGED_TRUE);
+       eventsystem_send_system_event(SYS_EVENT_TIME_CHANGED, b);
+       bundle_free(b);
 
        __alarm_update_due_time_of_all_items_in_list(diff_time);        // Rescheduling alarms with ALARM_TYPE_RELATIVE
        ALARM_MGR_LOG_PRINT("Next duetime is %d", alarm_context.c_due_time);
@@ -2230,6 +2241,17 @@ gboolean alarm_manager_alarm_set_timezone(AlarmManager *pObject, GDBusMethodInvo
        __rtc_set();
 
        vconf_set_int(VCONFKEY_SYSTEM_TIME_CHANGED, 0);
+       bundle *b = NULL;
+       b = bundle_create();
+       bundle_add_str(b, EVT_KEY_TIME_CHANGED, EVT_VAL_TIME_CHANGED_TRUE);
+       eventsystem_send_system_event(SYS_EVENT_TIME_CHANGED, b);
+       bundle_free(b);
+
+       b = NULL;
+       b = bundle_create();
+       bundle_add_str(b, EVT_KEY_TIME_ZONE, tzpath_str);
+       eventsystem_send_system_event(SYS_EVENT_TIME_ZONE, b);
+       bundle_free(b);
 
 done:
        g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", return_code));
index e30c9c6..bca8780 100644 (file)
@@ -24,6 +24,7 @@ BuildRequires: pkgconfig(gio-unix-2.0)
 BuildRequires: pkgconfig(capi-system-device)
 BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(libsystemd-login)
+BuildRequires: pkgconfig(eventsystem)
 BuildRequires: python-xml
 
 %description