summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/widget_instance.h1
-rw-r--r--src/widget_instance.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/include/widget_instance.h b/include/widget_instance.h
index 9167275..3ba303d 100644
--- a/include/widget_instance.h
+++ b/include/widget_instance.h
@@ -88,6 +88,7 @@ int widget_instance_listen_status(const char *widget_id, widget_instance_event_c
int widget_instance_unlisten_status(const char *widget_id);
int widget_instance_trigger_update_v2(const char *widget_id, const char *instance_id, const char *content_info, int force);
+int widget_instance_convert_event_to_lifecycle_status(int event);
#ifdef __cplusplus
}
diff --git a/src/widget_instance.c b/src/widget_instance.c
index 607cac3..3dd1dca 100644
--- a/src/widget_instance.c
+++ b/src/widget_instance.c
@@ -1306,3 +1306,19 @@ EAPI int widget_service_set_sdk_util(bundle *data)
return 0;
}
+
+EAPI int widget_instance_convert_event_to_lifecycle_status(int event)
+{
+ switch (event) {
+ case WIDGET_INSTANCE_EVENT_CREATE:
+ return WIDGET_LIFE_CYCLE_EVENT_CREATE;
+ case WIDGET_INSTANCE_EVENT_DESTROY:
+ return WIDGET_LIFE_CYCLE_EVENT_DESTROY;
+ case WIDGET_INSTANCE_EVENT_PAUSE:
+ return WIDGET_LIFE_CYCLE_EVENT_PAUSE;
+ case WIDGET_INSTANCE_EVENT_RESUME:
+ return WIDGET_LIFE_CYCLE_EVENT_RESUME;
+ }
+
+ return -1;
+}