elm_cache_all_flush() is separated from appcore_base_flush_memory().
This patch adds trim_memory() callback function type to add entry point.
Change-Id: Id05f297cb76b2dcd2009dd35efbdfa5633e8f377
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
typedef void (*watch_base_finish_cb)(void);
typedef void (*watch_base_run_cb)(void *data);
typedef void (*watch_base_exit_cb)(void *data);
+typedef void (*watch_base_trim_memory_cb)(void *data);
typedef struct {
watch_base_create_cb create;
watch_base_finish_cb finish;
watch_base_run_cb run;
watch_base_exit_cb exit;
+ watch_base_trim_memory_cb trim_memory;
} watch_base_ops;
int watch_base_add_event_handler(app_event_handler_h *handler, app_event_type_e event_type, app_event_cb callback, void *user_data);
void watch_base_on_resume(void);
void watch_base_on_preresume(void);
void watch_base_on_terminate(void);
+void watch_base_on_trim_memory(void);
watch_base_ops watch_base_get_default_ops(void);
typedef enum {
watch_base_on_terminate();
}
+EXPORT_API void watch_base_on_trim_memory(void)
+{
+ appcore_ui_base_on_trim_memory();
+}
+
+static void __on_trim_memory(void *user_data)
+{
+ watch_base_on_trim_memory();
+}
+
EXPORT_API watch_base_ops watch_base_get_default_ops(void)
{
watch_base_ops ops;
ops.finish = NULL;
ops.run = NULL;
ops.exit = NULL;
+ ops.trim_memory = __on_trim_memory;
return ops;
}
}
}
+static void __on_trim_memory(void *user_data)
+{
+ _D("Trim memory");
+ elm_cache_all_flush();
+ watch_base_on_trim_memory();
+}
+
EXPORT_API int watch_app_main(int argc, char **argv,
watch_app_lifecycle_callback_s *callback, void *user_data)
{
ops.finish = __on_finish;
ops.run = __on_run;
ops.exit = __on_exit;
+ ops.trim_memory = __on_trim_memory;
__context.callback = *callback;
__context.data = user_data;