From: Ji-hoon Lee Date: Mon, 8 Aug 2016 08:28:56 +0000 (+0900) Subject: Modified the ISE not to access imedb directly X-Git-Tag: accepted/tizen/common/20160810.161735~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97ba48b86df5632fc87512c3a01163b725037e2a;p=platform%2Fcore%2Fuifw%2Fisf.git Modified the ISE not to access imedb directly Change-Id: Id0e41bf66516a0ba545b9a9f757147284b44a78a --- diff --git a/ism/src/Makefile.am b/ism/src/Makefile.am index f4e7677..95d9146 100644 --- a/ism/src/Makefile.am +++ b/ism/src/Makefile.am @@ -162,7 +162,8 @@ libscim@SCIM_EPOCH@_la_SOURCES = \ libscim@SCIM_EPOCH@_la_CXXFLAGS = @EVAS_CFLAGS@ \ @DLOG_CFLAGS@ \ @DB_UTIL_CFLAGS@ \ - @TZPLATFORM_CONFIG_CFLAGS@ + @TZPLATFORM_CONFIG_CFLAGS@ \ + @PKGMGR_INFO_CFLAGS@ libscim@SCIM_EPOCH@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION):$(SCIM_AGE) \ -export-dynamic \ @@ -174,6 +175,7 @@ libscim@SCIM_EPOCH@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION) @DLOG_LIBS@ \ @DB_UTIL_LIBS@ \ @TZPLATFORM_CONFIG_LIBS@ \ + @PKGMGR_INFO_LIBS@ \ -lstdc++ libscim@SCIM_EPOCH@_la_LIBADD = libltdlc.la diff --git a/ism/src/scim_helper.cpp b/ism/src/scim_helper.cpp index 6ff8408..2027eae 100644 --- a/ism/src/scim_helper.cpp +++ b/ism/src/scim_helper.cpp @@ -57,6 +57,9 @@ #include #include "isf_debug.h" #include "isf_message_queue.h" +#if HAVE_PKGMGR_INFO +#include +#endif // HAVE_PKGMGR_INFO #ifdef LOG_TAG # undef LOG_TAG @@ -2276,11 +2279,32 @@ HelperAgent::set_keyboard_ise_by_uuid (const String &uuid) const return; } - if (isf_db_select_ime_info_by_appid(uuid.c_str (), &imeInfo) < 1) { - LOGW ("ime_info row is not available for %s", uuid.c_str ()); +#if HAVE_PKGMGR_INFO + int ret = 0; + char *pkgid = NULL; + pkgmgrinfo_appinfo_h handle; + ret = pkgmgrinfo_appinfo_get_appinfo(uuid.c_str(), &handle); + if (ret != PMINFO_R_OK) { + LOGW("Retrieve app info failed : %s", uuid.c_str ()); return; } + ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid); + if (ret != PMINFO_R_OK) { + LOGW("Retrieve pkgid failed : %s, %p", uuid.c_str(), handle); + pkgmgrinfo_appinfo_destroy_appinfo(handle); + return; + } + + imeInfo.module_name = pkgid; + pkgmgrinfo_appinfo_destroy_appinfo(handle); +#else + if (isf_db_select_ime_info_by_appid(uuid.c_str(), &imeInfo) < 1) { + LOGW("ime_info row is not available for %s", uuid.c_str()); + return; + } +#endif + engine_module = &m_impl->engine_module; if (engine_module->valid() && imeInfo.module_name != engine_module->get_module_name()) { @@ -2289,7 +2313,6 @@ HelperAgent::set_keyboard_ise_by_uuid (const String &uuid) const } if (!engine_module->valid()) { - if (engine_module->load (imeInfo.module_name, m_impl->m_config) == false) { LOGW ("load module %s failed", imeInfo.module_name.c_str()); return; diff --git a/ism/src/scim_module.cpp b/ism/src/scim_module.cpp index be1ee8b..d6c793b 100644 --- a/ism/src/scim_module.cpp +++ b/ism/src/scim_module.cpp @@ -202,7 +202,8 @@ Module::load (const String &name, const String &type) ModuleExitFunc new_exit; if (type.compare("Helper") == 0) { - isf_db_select_module_path_by_mode(TOOLBAR_HELPER_MODE, mpath); + mpath.push_back(String(SCIM_MODULE_PATH) + String(SCIM_PATH_DELIM_STRING) + String(SCIM_BINARY_VERSION) + + String(SCIM_PATH_DELIM_STRING) + String("Helper")); for (i = 0; i < mpath.size(); i++) { module_path = mpath[i] + String (SCIM_PATH_DELIM_STRING) + name; new_handle = lt_dlopenext (module_path.c_str ()); @@ -211,7 +212,8 @@ Module::load (const String &name, const String &type) } } else if (type.compare("IMEngine") == 0 && name.compare("socket")) { - isf_db_select_module_path_by_mode(TOOLBAR_KEYBOARD_MODE, mpath); + mpath.push_back(String(SCIM_MODULE_PATH) + String(SCIM_PATH_DELIM_STRING) + String(SCIM_BINARY_VERSION) + + String(SCIM_PATH_DELIM_STRING) + String("IMEngine")); for (i = 0; i < mpath.size(); i++) { module_path = mpath[i] + String (SCIM_PATH_DELIM_STRING) + name; new_handle = lt_dlopenext (module_path.c_str ());