Add db create logic 92/68692/5 accepted/tizen/common/20160511.141835 accepted/tizen/ivi/20160511.080524 accepted/tizen/mobile/20160511.080425 accepted/tizen/tv/20160511.080443 accepted/tizen/wearable/20160511.080459 submit/tizen/20160510.090610
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 9 May 2016 09:25:51 +0000 (18:25 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Tue, 10 May 2016 08:24:01 +0000 (17:24 +0900)
Change-Id: Ia3b26af2276ca4d08d89556d56115a8f79286741
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
org.tizen.data-provider-master.service.in
src/badge_service.c
src/notification_service.c
src/service_common.c

index 641d3bd..5d60061 100644 (file)
@@ -2,4 +2,4 @@
 Name=org.tizen.data_provider_service
 Exec=/bin/false
 SystemdService=data-provider-master.service
-User=root
+User=app_fw
index 080eedc..3b4a51d 100755 (executable)
@@ -27,7 +27,6 @@
 #include "debug.h"
 
 #define PROVIDER_BADGE_INTERFACE_NAME "org.tizen.data_provider_badge_service"
-
 static GList *_monitoring_list = NULL;
 
 static void _on_name_appeared(GDBusConnection *connection,
@@ -564,13 +563,19 @@ int badge_get_setting_property(GVariant *parameters, GVariant **reply_body)
 HAPI int badge_service_init(void)
 {
        int result;
+       result = badge_db_init();
+       if (result != BADGE_ERROR_NONE) {
+               ErrPrint("badge db init fail %d", result);
+               return result;
+       }
 
        result = badge_register_dbus_interface();
        if (result != SERVICE_COMMON_ERROR_NONE) {
                ErrPrint("badge register dbus fail %d", result);
+               return BADGE_ERROR_IO_ERROR;
        }
 
-       return result;
+       return BADGE_ERROR_NONE;
 }
 
 HAPI int badge_service_fini(void)
index 0a2913a..0dc7fa5 100755 (executable)
 #include <notification_internal.h>
 #include <notification_ipc.h>
 #include <notification_setting_service.h>
+#include <notification_db.h>
 
 #define PROVIDER_NOTI_INTERFACE_NAME "org.tizen.data_provider_noti_service"
-
 static GList *_monitoring_list = NULL;
-
 static int _update_noti(GVariant **reply_body, notification_h noti);
 
 /*!
@@ -884,14 +883,18 @@ static int _package_uninstall_cb(const char *pkgname, enum pkgmgr_status status,
 HAPI int notification_service_init(void)
 {
        int result;
-       result = notification_register_dbus_interface();
+       result = notification_db_init();
+       if (result != NOTIFICATION_ERROR_NONE) {
+               ErrPrint("notification db init fail %d", result);
+               return result;
+       }
 
+       result = notification_register_dbus_interface();
        if (result != SERVICE_COMMON_ERROR_NONE) {
                ErrPrint("notification register dbus fail %d", result);
-               return result;
+               return NOTIFICATION_ERROR_IO_ERROR;
        }
        _notification_data_init();
-
        notification_setting_refresh_setting_table();
 
        pkgmgr_init();
@@ -899,14 +902,14 @@ HAPI int notification_service_init(void)
        pkgmgr_add_event_callback(PKGMGR_EVENT_UPDATE, _package_install_cb, NULL);
        pkgmgr_add_event_callback(PKGMGR_EVENT_UNINSTALL, _package_uninstall_cb, NULL);
        DbgPrint("Successfully initiated\n");
-       return SERVICE_COMMON_ERROR_NONE;
+       return NOTIFICATION_ERROR_NONE;
 }
 
 HAPI int notification_service_fini(void)
 {
        pkgmgr_fini();
        DbgPrint("Successfully Finalized\n");
-       return SERVICE_COMMON_ERROR_NONE;
+       return NOTIFICATION_ERROR_NONE;
 }
 
 /* End of a file */
index 1cb8851..a66ff23 100755 (executable)
@@ -235,4 +235,4 @@ out:
                g_dbus_node_info_unref(introspection_data);
 
        return result;
-}
+}
\ No newline at end of file