static String ime_list_app = "";
static Ecore_Timer *_ise_check_pid_alive_timer = NULL;
-static const double _ise_check_pid_alive_time = 1.0f;
+static const double _ise_check_pid_alive_time = 3.0f;
static String _ise_check_pid_alive_uuid;
enum {
static Eina_Bool ise_check_pid_alive_timer(void *data)
{
Eina_Bool ret = ECORE_CALLBACK_RENEW;
- long int ime_pid = (long int)data;
+ Eina_Bool retry = EINA_FALSE;
- int status = aul_app_get_status_bypid(ime_pid);
- LOGD("STATUS : %d %d", status, (int)ime_pid);
+ int status = aul_app_get_status (_ise_check_pid_alive_uuid.c_str ());
+ LOGD ("STATUS : %d", status);
+ if (status >= STATUS_LAUNCHING) {
+ /* If the status is not one of STATUS_LAUNCHING, STATUS_VISIBLE, STATUS_BG */
+ if (status >= STATUS_DYING) {
+ LOGE ("aul_app_get_status reports %d", status);
+ retry = EINA_TRUE;
+ }
+ }
+ else {
+ /* Status query not successful, the ISE could have failed launching */
+ LOGE ("aul_app_get_status failed. %d", status);
+ retry = EINA_TRUE;
+ }
- /* If the status is not one of STATUS_LAUNCHING, STATUS_VISIBLE, STATUS_BG */
- if (status >= STATUS_DYING || status == -1) {
+ if (retry) {
_soft_keyboard_launched = false;
-
- String uuid = _config->read(SCIM_CONFIG_DEFAULT_HELPER_ISE, String(""));
+ String uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String(""));
/* The start_helper() function below will going to call slot_run_helper,
which will going to assign a new timer handle to the _ise_check_pid_alive_timer variable.
*/
- LOGW("The previous attempt to launch %s seems to be failed, restarting", uuid.c_str());
- if (_info_manager->start_helper(uuid))
+ LOGW ("The previous attempt to launch %s seems to be failed, restarting",
+ _ise_check_pid_alive_uuid.c_str ());
+ if (_info_manager->start_helper (uuid))
_soft_keyboard_launched = true;
-
ret = ECORE_CALLBACK_CANCEL;
}
return (ret == APP_CONTROL_ERROR_NONE);
}
+static void add_ise_check_pid_alive_timer(const String &uuid) {
+ delete_ise_check_pid_alive_timer ();
+ LOGD ("Register check_alive timer for uuid : %s", uuid.c_str ());
+ _ise_check_pid_alive_uuid = uuid;
+ _ise_check_pid_alive_timer = ecore_timer_add (_ise_check_pid_alive_time,
+ ise_check_pid_alive_timer, NULL);
+}
+
static void slot_run_helper (const String &uuid, const String &config, const String &display)
{
ISF_SAVE_LOG ("time:%ld pid:%d %s %s uuid(%s)",
String scim_helper_path;
- delete_ise_check_pid_alive_timer();
+ delete_ise_check_pid_alive_timer ();
#ifdef HAVE_PKGMGR_INFO
char *execpath = NULL;
/* Try to get in global packages */
ret = pkgmgr_get_appinfo (uuid.c_str (), &appinfo_handle);
if (ret != PMINFO_R_OK) {
- LOGW ("pkgmgrinfo_appinfo_get_appinfo () & get_usr_appinfo () failed. appid : %s, ret : %d ", uuid.c_str (), ret);
+ LOGE ("pkgmgr_get_appinfo failed. appid : %s, ret : %d ", uuid.c_str (), ret);
+ add_ise_check_pid_alive_timer (uuid);
return;
}
/* Get exec path */
ret = pkgmgrinfo_appinfo_get_exec (appinfo_handle, &execpath);
if (ret != PMINFO_R_OK) {
+ LOGE ("pkgmgrinfo_appinfo_get_exec failed. appid : %s, ret : %d ", uuid.c_str (), ret);
pkgmgrinfo_appinfo_destroy_appinfo (appinfo_handle);
+ add_ise_check_pid_alive_timer (uuid);
return;
}
}
/* execute type IME */
LOGD ("Try to launch IME (%s)", uuid.c_str ());
- bool launched = app_control_launch (uuid.c_str ());
-
- if (launched) {
- long int ime_pid = aul_app_get_pid(uuid.c_str());
- if (ime_pid > 0) {
- LOGD ("Register check_alive timer for pid : %d", (int)ime_pid);
- _ise_check_pid_alive_uuid = uuid;
- _ise_check_pid_alive_timer = ecore_timer_add (_ise_check_pid_alive_time,
- ise_check_pid_alive_timer, (void*)ime_pid);
- }
- }
+ app_control_launch (uuid.c_str ());
+
+ /* ISE check alive only works for AUL based IMEs */
+ add_ise_check_pid_alive_timer (uuid);
}
else {
/* shared object (so) type IME */