GArray *task_info_app_array,
GArray *task_info_proc_array,
unsigned long totalram_kb);
-
+ int (*get_kill_candidates_post)(GArray *candidates);
+ int (*get_kill_candidates_post_with_wss)(GArray *candidates);
+ int (*get_kill_candidates_post_with_foreground)(GArray *candidates);
} syscommon_plugin_backend_resourced_memory_lmk_funcs;
#ifdef __cplusplus
GArray *task_info_proc_array,
unsigned long totalram_kb);
+/**
+ * @brief Reorder candidates list, sorted first by get_kill_candidates fuction,
+ according to custom rule
+ * @param[in] candidates is a GArray to return kill candidates, it is already
+ sorted by get_kill_candidates
+ * @return @c zero on success,
+ * otherwise a negative error value
+ */
+int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post(
+ GArray *candidates);
+
+/**
+ * @brief Reorder candidates list sorted first by get_kill_candidates fuction
+ according to working set size rule
+ * @param[in] candidates is a GArray to return kill candidates, it is already
+ sorted by get_kill_candidates
+ * @return @c zero on success,
+ * otherwise a negative error value
+ */
+int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
+ GArray *candidates);
+
+/**
+ * @brief Reorder candidates list sorted first by get_kill_candidates fuction
+ according to foreground rule (i.e., rule for foreground apps)
+ * @param[in] candidates is a GArray to return kill candidates, it is already
+ sorted by get_kill_candidates
+ * @return @c zero on success,
+ * otherwise a negative error value
+ */
+int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_foreground(
+ GArray *candidates);
+
#ifdef __cplusplus
}
#endif
* THE SOFTWARE.
*/
+#include <assert.h>
#include <glib.h>
#include "syscommon-plugin-common.h"
task_info_proc_array,
totalram_kb);
}
+
+EXPORT
+int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post(
+ GArray *candidates)
+{
+ int ret = 0;
+
+ if (!funcs) {
+ ret = syscommon_plugin_resourced_memory_lmk_get_backend();
+ if (ret < 0)
+ return ret;
+ }
+
+ assert(funcs);
+ if (!funcs->get_kill_candidates_post) {
+ _E("No \"get_kill_candidates_post\" function");
+ return -ENOTSUP;
+ }
+
+ return funcs->get_kill_candidates_post(candidates);
+}
+
+EXPORT
+int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_wss(
+ GArray *candidates)
+{
+ int ret = 0;
+
+ if (!funcs) {
+ ret = syscommon_plugin_resourced_memory_lmk_get_backend();
+ if (ret < 0)
+ return ret;
+ }
+
+ assert(funcs);
+ if (!funcs->get_kill_candidates_post_with_wss) {
+ _E("No \"get_kill_candidates_post_with_wss\" function");
+ return -ENOTSUP;
+ }
+
+ return funcs->get_kill_candidates_post_with_wss(candidates);
+}
+
+EXPORT
+int syscommon_plugin_resourced_memory_lmk_get_kill_candidates_post_with_foreground(
+ GArray *candidates)
+{
+ int ret = 0;
+
+ if (!funcs) {
+ ret = syscommon_plugin_resourced_memory_lmk_get_backend();
+ if (ret < 0)
+ return ret;
+ }
+
+ assert(funcs);
+ if (!funcs->get_kill_candidates_post_with_foreground) {
+ _E("No \"get_kill_candidates_post_with_foreground\" function");
+ return -ENOTSUP;
+ }
+
+ return funcs->get_kill_candidates_post_with_foreground(candidates);
+}