diff options
Diffstat (limited to 'src/launchpad.c')
-rwxr-xr-x | src/launchpad.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/launchpad.c b/src/launchpad.c index 6416bc1..5305dc6 100755 --- a/src/launchpad.c +++ b/src/launchpad.c @@ -1319,6 +1319,10 @@ static gboolean __handle_launch_event(gpointer data) __real_send(clifd, ret); clifd = -1; goto end; + case PAD_CMD_PING: + __real_send(clifd, 0); + clifd = -1; + goto end; } INIT_PERF(kb); @@ -1575,7 +1579,8 @@ static void __add_slot_from_info(gpointer data, gpointer user_data) candidate_process_context_t *cpc; bundle_raw *extra = NULL; int len; - int ret; + long long total = 0; + long long idle = 0; if (!strcmp(info->exe, "null")) { cpc = __add_slot(LAUNCHPAD_TYPE_USER + user_slot_offset, @@ -1600,11 +1605,11 @@ static void __add_slot_from_info(gpointer data, gpointer user_data) if (cpc == NULL) return; - ret = __prepare_candidate_process( - LAUNCHPAD_TYPE_USER + user_slot_offset, - PAD_LOADER_ID_STATIC); - if (ret != 0) - return; + _get_cpu_idle(&total, &idle); + cpc->cpu_idle_time = idle; + cpc->cpu_total_time = total; + cpc->idle_checker = g_timeout_add(CPU_CHECKER_TIMEOUT, + __handle_idle_checker, cpc); info->type = LAUNCHPAD_TYPE_USER + user_slot_offset; user_slot_offset++; @@ -1672,13 +1677,21 @@ static int __before_loop(int argc, char **argv) VCONFKEY_SETAPPL_APP_HW_ACCELERATION); } + __add_default_slots(); launcher_info_list = _launcher_info_load(LAUNCHER_INFO_PATH); + ret = _send_cmd_to_amd(LAUNCHPAD_LAUNCH_SIGNAL); + if (ret < 0) + _W("Failed to send cmd(%d) to amd", LAUNCHPAD_LAUNCH_SIGNAL); + return 0; } static void __after_loop(void) { + if (_send_cmd_to_amd(LAUNCHPAD_DEAD_SIGNAL) < 0) + _W("Failed to send cmd(%d) to amd", LAUNCHPAD_DEAD_SIGNAL); + _debug_fini(); _launcher_info_unload(launcher_info_list); |