Fix pkgmgr status and move hello_timer into client handle
[platform/core/uifw/tts.git] / server / ttsd_main.c
index cb1fb14..34fd6ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved 
+*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 
 static Ecore_Timer* g_check_client_timer = NULL;
 
-const char* get_tag()
-{
-       return "ttsd";
-}
-
 const char* tts_tag()
 {
        return "ttsd";
@@ -37,63 +32,3 @@ ttsd_mode_e ttsd_get_mode()
 {
        return TTSD_MODE_DEFAULT;
 }
-
-/* Main of TTS Daemon */
-int main()
-{
-       SLOG(LOG_DEBUG, get_tag(), "  ");
-       SLOG(LOG_DEBUG, get_tag(), "  ");
-       SLOG(LOG_DEBUG, get_tag(), "===== TTS DAEMON DEFAULT INITIALIZE");
-
-       if (!ecore_init()) {
-               SLOG(LOG_ERROR, get_tag(), "[Main ERROR] Fail ecore_init()");
-               return -1;
-       }
-
-       if (0 != ttsd_dbus_open_connection()) {
-               SLOG(LOG_ERROR, get_tag(), "[Main ERROR] Fail to open dbus connection");
-               return EXIT_FAILURE;
-       }
-
-       if (0 != ttsd_initialize()) {
-               SLOG(LOG_ERROR, get_tag(), "[Main ERROR] Fail to initialize tts-daemon"); 
-               return EXIT_FAILURE;
-       }
-
-       if (0 != ttsd_network_initialize()) {
-               SLOG(LOG_WARN, get_tag(), "[Main WARNING] Fail to initialize network");
-       }
-
-       g_check_client_timer = ecore_timer_add(CLIENT_CLEAN_UP_TIME, ttsd_cleanup_client, NULL);
-       if (NULL == g_check_client_timer) {
-               SLOG(LOG_WARN, get_tag(), "[Main Warning] Fail to create timer of client check");
-       }
-
-       SLOG(LOG_DEBUG, get_tag(), "[Main] tts-daemon start..."); 
-       SLOG(LOG_DEBUG, get_tag(), "=====");
-       SLOG(LOG_DEBUG, get_tag(), "  ");
-       SLOG(LOG_DEBUG, get_tag(), "  ");
-       
-       ecore_main_loop_begin();
-
-       SLOG(LOG_DEBUG, get_tag(), "===== TTS DAEMON DEFAULT FINALIZE");
-
-       if (NULL != g_check_client_timer) {
-               ecore_timer_del(g_check_client_timer);
-       }
-
-       ttsd_dbus_close_connection();
-
-       ttsd_network_finalize();
-
-       ttsd_finalize();
-
-       ecore_shutdown();
-
-       SLOG(LOG_DEBUG, get_tag(), "=====");
-       SLOG(LOG_DEBUG, get_tag(), "  ");
-       SLOG(LOG_DEBUG, get_tag(), "  ");
-
-       return 0;
-}
-