#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 ());
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)