Add codes for setting voice touch as auto mode 97/125697/3
authorsooyeon.kim <sooyeon.kim@samsung.com>
Tue, 18 Apr 2017 11:37:51 +0000 (20:37 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Thu, 20 Apr 2017 05:54:40 +0000 (14:54 +0900)
Change-Id: I043203eec71832e58714488142967c129fac0ce5
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
CMakeLists.txt
packaging/app-core.spec
src/ui_base/appcore_ui_base.c

index a5b35b7..4b4a9bd 100644 (file)
@@ -58,7 +58,7 @@ SET(SRCS_efl src/legacy/appcore-efl.c src/ui_base/appcore_ui_base.c)
 SET(HEADERS_efl appcore-efl.h appcore_ui_base.h)
 
 INCLUDE(FindPkgConfig)
-SET(APPCORE_PKG_CHECK_MODULES2 "elementary dlog ecore gobject-2.0 glib-2.0 aul pkgmgr-info ttrace capi-system-info")
+SET(APPCORE_PKG_CHECK_MODULES2 "elementary dlog ecore gobject-2.0 glib-2.0 aul pkgmgr-info ttrace capi-system-info voice-control-elm")
 
 pkg_check_modules(pkg_efl REQUIRED ${APPCORE_PKG_CHECK_MODULES2})
 
index e7432e2..4e9c42e 100644 (file)
@@ -24,6 +24,7 @@ BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(ttrace)
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(capi-system-info)
+BuildRequires:  pkgconfig(voice-control-elm)
 
 %description
 SLP common application basic
index 31da1ef..b4b13b2 100644 (file)
@@ -43,6 +43,8 @@
 #include <aul_svc.h>
 #include <bundle_internal.h>
 #include <ttrace.h>
+#include <voice_control_elm.h>
+#include <voice_control_elm_private.h>
 
 #include "appcore_base.h"
 #include "appcore_ui_base.h"
@@ -682,6 +684,8 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar
        const char *bg_launch;
        bundle *b;
        char appid[PATH_MAX] = {0, };
+       int r;
+       bool is_vc_vt_automode = false;
 
        aul_app_get_appid_bypid(getpid(), appid, sizeof(appid));
        __context.ops = ops;
@@ -695,6 +699,16 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar
        LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:main:done]", appid);
        elm_init(argc, argv);
 
+       r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
+       if (r != 0) {
+               _ERR("[VC] Fail to get vconfkey of vt_automode");
+       } else {
+               if (is_vc_vt_automode == true) {
+                       vc_elm_initialize();
+                       vc_elm_set_auto_register_mode(2, 0);
+               }
+       }
+
        if (__context.hint & APPCORE_UI_BASE_HINT_HW_ACC_CONTROL) {
                hwacc = getenv("HWACC");
 
@@ -727,6 +741,9 @@ EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **ar
 
 EXPORT_API void appcore_ui_base_fini(void)
 {
+       bool is_vc_vt_automode = false;
+       int r;
+
        appcore_base_fini();
 
        if (__context.hshow)
@@ -739,6 +756,15 @@ EXPORT_API void appcore_ui_base_fini(void)
                ecore_event_handler_del(__context.hlower);
 
        __finish_wl();
+
+       r = vc_elm_is_supported_vt_auto(&is_vc_vt_automode);
+       if (r != 0) {
+               _ERR("[VC] Fail to get vconfkey of vt_automode");
+       } else {
+               if (is_vc_vt_automode == true)
+                       vc_elm_deinitialize();
+       }
+
        elm_shutdown();
 
        /* Check loader case */