summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInhong Han <inhong1.han@samsung.com>2024-08-29 11:21:48 +0900
committerInhong Han <inhong1.han@samsung.com>2024-08-29 11:23:39 +0900
commit860d8ce6ca43d258bab94c26d1c7071b07320075 (patch)
tree3a796ed6ae734422ea83c99656032c544394c706
parent3a2e57e228c2a8faaa35dd88c496d16e92ccc26d (diff)
downloadise-default-860d8ce6ca43d258bab94c26d1c7071b07320075.tar.gz
ise-default-860d8ce6ca43d258bab94c26d1c7071b07320075.tar.bz2
ise-default-860d8ce6ca43d258bab94c26d1c7071b07320075.zip
Modified to set the current language before setting IMEngine
If the current language is not changed first, IMEngine events can't be processed. Change-Id: I9def9e00b34c7e33146656a74ec872d11f569754
-rw-r--r--src/include/languages.h2
-rw-r--r--src/languages.cpp16
-rw-r--r--src/sdk.cpp3
3 files changed, 20 insertions, 1 deletions
diff --git a/src/include/languages.h b/src/include/languages.h
index 76f42cb..08de52a 100644
--- a/src/include/languages.h
+++ b/src/include/languages.h
@@ -127,6 +127,8 @@ public:
const sclchar* get_resource_file_path();
bool set_resource_file_path(const char * resource_file);
+ sclboolean set_current_language(const sclchar *language);
+
private:
/* enable languages, if languages num is 0, return false */
sclboolean enable_languages(const std::vector<std::string> &languages);
diff --git a/src/languages.cpp b/src/languages.cpp
index 5959fe5..5e64acf 100644
--- a/src/languages.cpp
+++ b/src/languages.cpp
@@ -135,7 +135,6 @@ ISELanguageManager::do_select_language(int language_info_index)
return ret;
}
- _current_language = language_info_index;
if (!language_info.enabled_temporarily) {
/* Save the selected language */
CONFIG_VALUES *config_values = get_config_values();
@@ -503,6 +502,21 @@ bool ISELanguageManager::set_resource_file_path(const char *resource_file)
return true;
}
+sclboolean
+ISELanguageManager::set_current_language(const sclchar *language)
+{
+ sclboolean ret = FALSE;
+
+ int language_info_index = _find_language_info(language, _language_vector);
+ if (language_info_index < 0 || language_info_index >= (int)_language_vector.size()) {
+ return FALSE;
+ } else {
+ _current_language = language_info_index;
+ }
+
+ return ret;
+}
+
scluint ISELanguageManager::get_languages_num()
{
return _language_vector.size();
diff --git a/src/sdk.cpp b/src/sdk.cpp
index 7e1d174..2404ada 100644
--- a/src/sdk.cpp
+++ b/src/sdk.cpp
@@ -423,6 +423,9 @@ sclboolean CSDKISE::on_language_selected(const sclchar *language, const sclchar
if (ret == PMINFO_R_OK) {
ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
if (ret == PMINFO_R_OK) {
+ if (!_language_manager.set_current_language(language))
+ LOGE("Failed to set current language");
+
if (table[loop].load_in_ime) {
ime_set_engine_loader_flag(false);
ime_set_imengine(table[loop].keyboard_ise_uuid);