Fix voice-control-elm initialization 86/203186/4
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 Apr 2019 10:33:30 +0000 (19:33 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 11 Apr 2019 01:36:44 +0000 (10:36 +0900)
If the automode of voice touch feature is not enabled,
appcore-efl-base doesn't load libvc-control-elm library.

Change-Id: I6e297c98aa661e3b9138f00a481191c098f61d4d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/efl_base/appcore_efl_base.c

index d193f3858688e36740c6018e0d48f3a86fc90c2b..825e43e33ad99f07db91dc077f4cf2d0729f6929 100644 (file)
@@ -133,6 +133,9 @@ static void __vc_elm_init(void)
 
 static void __vc_elm_finish(void)
 {
+       if (!__vc_elm_handle)
+               return;
+
        vconf_ignore_key_changed(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE,
                        __vc_vtauto_changed_cb);
        if (__vc_elm_initialized) {
@@ -145,6 +148,7 @@ static void __efl_app_init(int argc, char **argv, void *data)
 {
        int hint;
        const char *hwacc;
+       int vt_automode = 0;
 
        elm_init(argc, argv);
 
@@ -164,15 +168,15 @@ static void __efl_app_init(int argc, char **argv, void *data)
                }
        }
 
+       vconf_get_int(VCONFKEY_VC_VOICE_TOUCH_AUTOMODE, &vt_automode);
        /* VC voice touch setting */
-       if (!getenv("VC_ELM_INIT"))
+       if (vt_automode)
                __vc_elm_init();
 }
 
 static void __efl_app_finish(void)
 {
        __vc_elm_finish();
-       unsetenv("VC_ELM_INIT");
 
        elm_shutdown();