Added check emulator environment
[platform/core/connectivity/stc-manager.git] / src / stc-manager.c
index 69349ae..6af6b7b 100755 (executable)
@@ -15,6 +15,7 @@
  */
 
 #include "stc-manager.h"
+#include "stc-emulator.h"
 #include "stc-statistics.h"
 #include "stc-restriction.h"
 #include "stc-manager-gdbus.h"
@@ -98,13 +99,16 @@ gint32 main(gint32 argc, gchar *argv[])
        g_type_init();
 #endif
 
-       g_stc = __stc_manager_init();
-       if (!g_stc)
-               goto fail;
-
        /* Crate the GLIB main loop */
        main_loop = g_main_loop_new(NULL, FALSE);
-       g_stc->main_loop = main_loop;
+
+       stc_emulator_check_environment();
+       if (stc_emulator_is_emulated() == FALSE) {
+               g_stc = __stc_manager_init();
+               if (!g_stc)
+                       goto fail;
+               g_stc->main_loop = main_loop;
+       }
 
        /* Run the main loop */
        g_main_loop_run(main_loop);
@@ -112,7 +116,8 @@ gint32 main(gint32 argc, gchar *argv[])
        ret = 0;
 
 fail:
-       __stc_manager_deinit();
+       if (stc_emulator_is_emulated() == FALSE)
+               __stc_manager_deinit();
 
        if (main_loop)
                g_main_loop_unref(main_loop);