From 93aa779f2f6919a2dfd7115c2881b10bf2ca813b Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 22 May 2017 16:36:15 +0900 Subject: [PATCH] Revert "Revert "Add codes for setting voice touch as auto mode"" This reverts commit d8f5c19874fee5e5846cb22010bf07599c01a283. Change-Id: I6e9b9596be2285813821eb9a84a252be6b38fec6 --- 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 6c91c98..bc52ac3 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 src/ui_base/ 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 9415865..eb36ddc 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 a8ea618..2696bfe 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" @@ -690,6 +692,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; appcore_ui_plugin_init(&ops, &hint); aul_app_get_appid_bypid(getpid(), appid, sizeof(appid)); @@ -704,6 +708,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"); @@ -736,6 +750,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(); appcore_ui_plugin_fini(); @@ -749,6 +766,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