From: Suyeon Hwang Date: Tue, 11 Apr 2023 04:40:32 +0000 (+0900) Subject: Register fd handler when the client only sets the lang_cb X-Git-Tag: accepted/tizen/unified/20230411.161315~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57554881ad705d962840581695a7e6152907f5ca;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Register fd handler when the client only sets the lang_cb - Issue: Language changes callback is not invoked except by the setting client. - Solution: Previous code does not register inotify fd handler when the clients only set langauge changed callback. The callback needs fd handler registeration because the callback is called by fd handler. So this patch adds code to register the fd handler. Through this patch, the language changd callback will be invoked even if the client is not the setting client. Change-Id: I503a5097f7727721292974bd1dc2919401e17593 Signed-off-by: Suyeon Hwang --- diff --git a/common/vc_config_mgr.cpp b/common/vc_config_mgr.cpp index d45d930..1b98486 100644 --- a/common/vc_config_mgr.cpp +++ b/common/vc_config_mgr.cpp @@ -1094,6 +1094,13 @@ int vc_config_mgr_set_lang_cb(unsigned int uid, vc_config_lang_changed_cb lang_c } g_VoiceControlClients->setLanguageChangedCallback(uid, lang_cb); + + if (VC_CONFIG_ERROR_NONE != register_language_config_changed_event()) { + SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Fail to register config event"); + ecore_thread_main_loop_end(); + return VC_CONFIG_ERROR_OPERATION_FAILED; + } + ecore_thread_main_loop_end(); return VC_CONFIG_ERROR_NONE; } @@ -1108,6 +1115,9 @@ int vc_config_mgr_unset_lang_cb(unsigned int uid) } g_VoiceControlClients->setLanguageChangedCallback(uid, nullptr); + + unregister_language_config_event(); + ecore_thread_main_loop_end(); return VC_CONFIG_ERROR_NONE; }