/* GDBus Declaration */
#define ALARM_MGR_DBUS_PATH "/org/tizen/alarm/manager"
#define ALARM_MGR_DBUS_NAME "org.tizen.alarm.manager"
-GDBusObjectManagerServer *alarmmgr_server = NULL;
static AlarmManager* interface = NULL;
sqlite3 *alarmmgr_db;
alarm_tm = gmtime_r(¤t_time, &tm);
if (alarm_tm == NULL) {
ALARM_MGR_EXCEPTION_PRINT("alarm_tm is NULL");
+ return_code = ERR_ALARM_SYSTEM_FAIL;
+ g_dbus_method_invocation_return_value(invoc, g_variant_new("(i)", return_code));
return true;
}
guint subsc_id;
ALARM_MGR_LOG_PRINT("__initialize_dbus Enter");
- alarmmgr_server = g_dbus_object_manager_server_new(ALARM_MGR_DBUS_PATH);
- if (alarmmgr_server == NULL) {
- ALARM_MGR_EXCEPTION_PRINT("Creating a new server object is failed.");
- return false;
- }
-
connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (connection == NULL) {
ALARM_MGR_EXCEPTION_PRINT("g_bus_get_sync() is failed");
interface = alarm_manager_skeleton_new();
if (interface == NULL) {
ALARM_MGR_EXCEPTION_PRINT("Creating a skeleton object is failed.");
+ g_object_unref(connection);
return false;
}
ALARM_MGR_EXCEPTION_PRINT("Subscribing to signal for invoking callback is failed.");
g_object_unref(interface);
interface = NULL;
+ g_object_unref(connection);
return false;
}
ALARM_MGR_EXCEPTION_PRINT("Exporting the interface is failed.");
g_object_unref(interface);
interface = NULL;
+ g_object_unref(connection);
return false;
}
- g_dbus_object_manager_server_set_connection(alarmmgr_server, connection);
-
guint owner_id = g_bus_own_name_on_connection(connection,
ALARM_MGR_DBUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE,
NULL, NULL, NULL, NULL);
if (owner_id == 0) {
ALARM_MGR_EXCEPTION_PRINT("Acquiring the own name is failed.");
g_object_unref(interface);
- g_object_unref(alarmmgr_server);
+ interface = NULL;
+ g_object_unref(connection);
return false;
}