upload tizen1.0 source
[framework/appfw/alarm-manager.git] / alarm-lib.c
index 014b4d3..da24dbd 100755 (executable)
@@ -187,6 +187,9 @@ static int __sub_init()
                return ALARMMGR_RESULT_SUCCESS;
        }
 
+       g_thread_init(NULL);
+       dbus_g_thread_init();
+
        alarm_context.bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
        if (alarm_context.bus == NULL) {
                ALARM_MGR_EXCEPTION_PRINT("dbus bus get failed\n");
@@ -271,9 +274,6 @@ EXPORT_API int alarmmgr_init(const char *pkg_name)
                return ALARMMGR_RESULT_SUCCESS;
        }
 
-       g_thread_init(NULL);
-       dbus_g_thread_init();
-
        ret = __sub_init();
        if (ret < 0)
                return ret;
@@ -528,6 +528,28 @@ static int __alarmmgr_init_appsvc(void)
 
 }
 
+EXPORT_API void *alarmmgr_get_alarm_appsvc_info(alarm_id_t alarm_id, int *return_code){
+
+       int ret = 0;
+
+       ret = __sub_init();
+       if (ret < 0){
+               if (return_code)
+                       *return_code = ret;
+               return NULL;
+       }
+
+       ALARM_MGR_LOG_PRINT("[alarm-lib]:alarmmgr_get_alarm_appsvc_info() is called\n");
+
+       if (alarm_id <= 0) {
+               if (return_code)
+                       *return_code = ERR_ALARM_INVALID_ID;
+               return NULL;
+       }
+
+       return _send_alarm_get_appsvc_info(alarm_context, alarm_id, return_code);
+
+}
 
 
 EXPORT_API int alarmmgr_add_alarm_appsvc_with_localtime(alarm_entry_t *alarm, void *bundle_data, alarm_id_t *alarm_id)