int result;
int pid = -1;
int command = -1;
- char appname[PROC_NAME_MAX];
struct proc_status ps;
+ struct proc_app_info *pai = NULL;
do_expr_unless_g_variant_get_typechecked(return, params, "(ii)", &pid, &command);
if (pid < 0 || command < 0) {
return;
}
- result = proc_get_cmdline(pid, appname, sizeof appname);
- if (result != RESOURCED_ERROR_NONE) {
+ pai = find_app_info(pid);
+
+ if (pai == NULL) {
_E("[WATCHDOG] ERROR : invalid pid(%d)", pid);
return;
}
- result = fixed_app_and_service_watchdog_action(appname, APP_TYPE);
+ result = fixed_app_and_service_watchdog_action(pai->appid, APP_TYPE);
if (result == PROC_ACTION_IGNORE) {
- _I("[WATCHDOG] appname (%s), pid (%d) is watchdog excluded app", appname, pid);
+ _I("[WATCHDOG] appname (%s), pid (%d) is watchdog excluded app", pai->appid, pid);
return;
}
if (current_lcd_state == LCD_STATE_OFF) {
- _E("[WATCHDOG] Receive watchdog signal to pid: %d(%s) but don't show ANR popup in LCD off state\n", pid, appname);
+ _E("[WATCHDOG] Receive watchdog signal to pid: %d(%s) but don't show ANR popup in LCD off state\n", pid, pai->appid);
return;
}
- _E("[WATCHDOG] Receive watchdog signal to app %s, pid %d\n", appname, pid);
- ps.pai = find_app_info(pid);
+ _E("[WATCHDOG] Receive watchdog signal to app %s, pid %d\n", pai->appid, pid);
+ ps.pai = pai;
ps.pid = pid;
resourced_notify(RESOURCED_NOTIFIER_APP_ANR, &ps);
- if (proc_dbus_show_popup(appname) < 0)
+ if (proc_dbus_show_popup(pai->appid) < 0)
_E("[WATCHDOG] Failed to show ANR popup");
if (app_watchdog_check_timer) {
if (app_watchdog.pid == pid) {
- _E("[WATCHDOG] app %s, pid %d has already received watchdog siganl but not terminated", appname, pid);
+ _E("[WATCHDOG] app %s, pid %d has already received watchdog siganl but not terminated", pai->appid, pid);
safe_kill(pid, SIGKILL);
app_watchdog.pid = -1;
app_watchdog.signum = -1;