}
proc_set_service_oomscore(svc->main_pid, oom_score_adj, svc);
+
+ /* The svc->memory.oom_score_adj should have been updated by the
+ * subroutine of proc_set_service_oomscore(). But at this stage,
+ * the proc_app_info of service app is not added to the app list. As a
+ * result the subroutine cannot update proc_app_info of a service app.
+ * Therefore, manually update oom_score_adj of service app. */
+ retval = proc_get_oom_score_adj(svc->main_pid, &oom_score_adj);
+ if (retval == RESOURCED_ERROR_NONE)
+ svc->memory.oom_score_adj = oom_score_adj;
+
}
static struct proc_program_info *proc_add_program_list(const int type,
ppi->app_list = g_slist_prepend(ppi->app_list, pai);
else {
ppi->svc_list = g_slist_prepend(ppi->svc_list, pai);
+ if (!restore)
+ proc_set_default_svc_oomscore(ppi, pai);
}
return ppi;
}
if (!ps.pai)
break;
- proc_set_default_svc_oomscore(ps.pai->program, ps.pai);
-
resourced_notify(RESOURCED_NOTIFIER_SERVICE_LAUNCH, &ps);
if (!(CHECK_BIT(ps.pai->flags, PROC_BGCTRL_APP)) ||
ps.pai->categories)