Fix lock issue when getting vconf value 01/143801/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 11 Aug 2017 09:35:36 +0000 (18:35 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 11 Aug 2017 09:35:39 +0000 (18:35 +0900)
Calling vconf_get_XXX function in vconf changed callback leads to lock up.
vconf_keynode_get_XXX function would be correct usage.

Change-Id: I7cae861225c770d19900d9d072888546338486e9
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/e_mod_main.c

index d171fd6..a657f19 100644 (file)
@@ -315,23 +315,24 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B
 static void
 _keyboard_mode_changed_cb(keynode_t *key, void* data)
 {
-   int val = 0;
-   if (vconf_get_bool(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &val) == 0)
+   bool val = vconf_keynode_get_bool(key);
+   LOGD("keyboard mode : %d\n", val);
+
+   if (val == false)
      {
-        if (val == 0)
-          {
-             /* Switching to S/W keyboard mode, hide input panel since it could be displaying candidate only */
-             if (g_disable_show_panel && g_text_input && g_text_input->resource && g_client)
-               _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE);
-             g_disable_show_panel = EINA_FALSE;
-          }
-        else
-          {
-             /* Switching to H/W keyboard mode, hide input panel only if there is no candidate */
-             if (!g_show_state_candidate && g_text_input && g_text_input->resource && g_client)
-               _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE);
-             g_disable_show_panel = EINA_TRUE;
-          }
+        /* Switching to S/W keyboard mode, hide input panel since it could be displaying candidate only */
+        if (g_disable_show_panel && g_text_input && g_text_input->resource && g_client)
+          _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE);
+
+        g_disable_show_panel = EINA_FALSE;
+     }
+   else
+     {
+        /* Switching to H/W keyboard mode, hide input panel only if there is no candidate */
+        if (!g_show_state_candidate && g_text_input && g_text_input->resource && g_client)
+          _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE);
+
+        g_disable_show_panel = EINA_TRUE;
      }
 }
 
@@ -339,7 +340,8 @@ static void
 _display_language_changed_cb(keynode_t *key, void* data)
 {
    int loop;
-   char *language = vconf_get_str(VCONFKEY_LANGSET);
+   char *language = vconf_keynode_get_str(key);
+   LOGD("language : %s\n", language);
 
    /* Just in case we did not find any matching language string */
    g_keymap_index = 0;
@@ -352,7 +354,6 @@ _display_language_changed_cb(keynode_t *key, void* data)
                   g_keymap_index = loop;
                }
           }
-        free(language);
      }
    /* We do not want to change the current keymap related behavior in TV profile for now */
    if (!_TV)