#define PAD_ERR_INVALID_PATH -4
#define CPU_CHECKER_TIMEOUT 1000
#define PI 3.14159265
-#define EVENT_BOOTING -1
typedef struct {
int type;
int cur_event;
bool on_boot;
bool app_exists;
+ bool touched;
} candidate_process_context_t;
typedef struct {
__update_threshold(cpc, -0.02f * (per - cpc->threshold));
__prepare_candidate_process(cpc->type, cpc->loader_id);
cpc->idle_checker = 0;
+ cpc->touched = true;
__add_idle_checker(cpc->cur_event, g_list_next(list));
return G_SOURCE_REMOVE;
}
continue;
}
- if (detection_method == EVENT_BOOTING && !cpc->on_boot) {
+ if (!cpc->touched && !cpc->on_boot) {
iter = g_list_next(iter);
continue;
}
}
if (cpc->pid == CANDIDATE_NONE &&
- (detection_method == EVENT_BOOTING ||
+ (!cpc->touched ||
(cpc->detection_method & detection_method))) {
if (cpc->timer > 0) {
g_source_remove(cpc->timer);
cpc->threshold_min = threshold_min;
cpc->on_boot = on_boot;
cpc->app_exists = app_exists;
+ cpc->touched = false;
+ cpc->cur_event = 0;
fd = __listen_candidate_process(cpc->type, cpc->loader_id);
if (fd == -1) {
user_slot_offset = 0;
g_list_foreach(loader_info_list, __add_slot_from_info, NULL);
- __add_idle_checker(EVENT_BOOTING, candidate_slot_list);
+ __add_idle_checker(0, candidate_slot_list);
return 0;
}