Added missing code to initialize Remote Input vconf value 90/274990/1
authorInHong Han <inhong1.han@samsung.com>
Fri, 13 May 2022 06:02:27 +0000 (15:02 +0900)
committerInHong Han <inhong1.han@samsung.com>
Fri, 13 May 2022 06:11:39 +0000 (06:11 +0000)
Change-Id: I8921509619cc21b1cb71a8e2f722f12f60c5cd2a

ism/src/isf_info_manager.cpp

index f5a7165..6dfd8aa 100644 (file)
@@ -63,6 +63,8 @@
 #include <dlog.h>
 #include <unistd.h>
 #include <sys/socket.h>
+#include <vconf.h>
+#include <vconf-keys.h>
 #include "scim_private.h"
 #include "scim.h"
 #include "scim_stl_map.h"
@@ -257,6 +259,13 @@ contexts_equal (uint32 first, uint32 second)
     return ((first & 0x7FFF) == (second & 0x7FFF));
 }
 
+static void
+initialize_remote_input_vconf_key ()
+{
+    if (vconf_set_bool (VCONFKEY_ISF_REMOTE_INPUT_DETECTED, 0) != 0)
+        LOGW ("Failed to set vconf key");
+}
+
 //==================================== InfoManager ===========================
 class InfoManager::InfoManagerImpl
 {
@@ -3751,11 +3760,15 @@ client context helpers: %zu, helpers uuid count: %zu",
         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
         ISF_PROF_DEBUG ("first message")
         socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
+        if (_TV)
+            initialize_remote_input_vconf_key ();
     }
     //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
     void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
         socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
+        if (_TV)
+            initialize_remote_input_vconf_key ();
     }
 
     //SCIM_TRANS_CMD_COMMIT_STRING
@@ -3786,6 +3799,8 @@ client context helpers: %zu, helpers uuid count: %zu",
 
                 if (client_info.type == FRONTEND_CLIENT) {
                     m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
+                    if (_TV)
+                        initialize_remote_input_vconf_key ();
                 } else {
                     std::cerr << "target client is not existed!!!" << "\n";
                 }
@@ -3820,6 +3835,8 @@ client context helpers: %zu, helpers uuid count: %zu",
 
         if (client_info.type == FRONTEND_CLIENT) {
             m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
+            if (_TV)
+                initialize_remote_input_vconf_key ();
         }
     }
     //SCIM_TRANS_CMD_GET_SELECTION
@@ -3929,6 +3946,8 @@ client context helpers: %zu, helpers uuid count: %zu",
 
             if (client_info.type == FRONTEND_CLIENT) {
                 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
+                if (_TV)
+                    initialize_remote_input_vconf_key ();
             }
         }
     }
@@ -3973,6 +3992,8 @@ client context helpers: %zu, helpers uuid count: %zu",
 
             if (client_info.type == FRONTEND_CLIENT) {
                 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
+                if (_TV)
+                    initialize_remote_input_vconf_key ();
             }
         }
     }