From 0b71ab13c936922fbb21d2025a2954197482ce36 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 6 Sep 2017 10:48:26 +0900 Subject: [PATCH] Try re-launch IME if launch request failure is detected Change-Id: I3ae551ec463bed100e4debff6f4338e88007c52f --- ism/extras/efl_panel/isf_panel_efl.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index aadfcdb..7857d99 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -1884,7 +1884,6 @@ static bool set_active_ise (const String &uuid, bool launch_ise) #ifdef HAVE_VCONF vconf_set_str (VCONFKEY_ISF_ACTIVE_KEYBOARD_UUID, uuid.c_str ()); #endif - LOGD ("Succeeded to launch IME (%s)\n", uuid.c_str ()); } else { LOGW ("Failed to launch IME (%s)\n", uuid.c_str ()); @@ -6208,15 +6207,20 @@ static void app_control_launch (const char *app_id) return; } - ret = app_control_send_launch_request (app_control, NULL, NULL); - if (ret != APP_CONTROL_ERROR_NONE) { + int tries = 0; + do { + if (tries != 0) usleep(1000000); /* If we are retrying to launch, pause for a while */ + ret = app_control_send_launch_request(app_control, NULL, NULL); LOGW ("app_control_send_launch_request returned %08x, app_id=%s\n", ret, app_id); - app_control_destroy (app_control); - return; - } + } while (ret != APP_CONTROL_ERROR_NONE && (++tries) < 3); app_control_destroy (app_control); - LOGD ("Succeeded to launch IME (%s)\n", app_id); + + if (ret != APP_CONTROL_ERROR_NONE) { + LOGW ("Failed to launch IME (%s)\n", app_id); + } else { + LOGD ("Succeeded to launch IME (%s)\n", app_id); + } } static void slot_run_helper (const String &uuid, const String &config, const String &display) -- 2.7.4