From 93dcf128086a8732a9a236f1a8631b8423556206 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 18 Apr 2017 20:37:51 +0900 Subject: [PATCH] Add codes for setting voice touch as auto mode Change-Id: I043203eec71832e58714488142967c129fac0ce5 Signed-off-by: sooyeon.kim --- CMakeLists.txt | 2 +- packaging/app-core.spec | 1 + src/ui_base/appcore_ui_base.c | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5b35b7..4b4a9bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/packaging/app-core.spec b/packaging/app-core.spec index e7432e2..4e9c42e 100644 --- a/packaging/app-core.spec +++ b/packaging/app-core.spec @@ -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 diff --git a/src/ui_base/appcore_ui_base.c b/src/ui_base/appcore_ui_base.c index 31da1ef..b4b13b2 100644 --- a/src/ui_base/appcore_ui_base.c +++ b/src/ui_base/appcore_ui_base.c @@ -43,6 +43,8 @@ #include #include #include +#include +#include #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 */ -- 2.7.4