static GList *candidate_slot_list;
static app_labels_monitor *label_monitor;
static GList *launcher_info_list;
+static GHashTable *__pid_table;
static candidate_process_context_t *__add_slot(int type, int loader_id,
int caller_pid, const char *loader_path, const char *extra,
int fd = lc->gpollfd->fd;
struct signalfd_siginfo siginfo;
ssize_t s;
+ char *appid;
do {
s = read(fd, &siginfo, sizeof(struct signalfd_siginfo));
break;
_signal_process_sigchld(&siginfo);
+
+ appid = g_hash_table_lookup(__pid_table,
+ GINT_TO_POINTER(siginfo.ssi_pid));
+ if (appid) {
+ security_manager_cleanup_app(appid, siginfo.ssi_uid);
+ g_hash_table_remove(__pid_table,
+ GINT_TO_POINTER(siginfo.ssi_pid));
+ }
+
cpc = __find_slot_from_pid(siginfo.ssi_pid);
if (cpc != NULL) {
__reset_slot(cpc);
if (clifd != -1)
close(clifd);
- if (pid > 0)
+ if (pid > 0) {
_signal_send_app_launch_signal(pid, menu_info->appid);
+ g_hash_table_insert(__pid_table, GINT_TO_POINTER(pid),
+ strdup(menu_info->appid));
+ }
if (menu_info != NULL)
_appinfo_free(menu_info);
if (ret < 0)
_W("Failed to send cmd(%d) to amd", LAUNCHPAD_LAUNCH_SIGNAL);
+ __pid_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
+ NULL, free);
+ if (!__pid_table) {
+ _E("Failed to create pid table");
+ return -1;
+ }
+
return 0;
}
static void __after_loop(void)
{
+ if (__pid_table)
+ g_hash_table_destroy(__pid_table);
+
if (_send_cmd_to_amd(LAUNCHPAD_DEAD_SIGNAL) < 0)
_W("Failed to send cmd(%d) to amd", LAUNCHPAD_DEAD_SIGNAL);