summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2016-07-01 15:38:18 +0900
committerJiwoong Im <jiwoong.im@samsung.com>2016-08-07 22:12:55 -0700
commit728bad55607f03df68803b02ef8e30fb17c46668 (patch)
tree82d4f4a987466356fc8a30419bf33c49f2d11a63
parentbbe66433261698b2d1decb5e09b9851de09b722c (diff)
downloadapplication-728bad55607f03df68803b02ef8e30fb17c46668.tar.gz
application-728bad55607f03df68803b02ef8e30fb17c46668.tar.bz2
application-728bad55607f03df68803b02ef8e30fb17c46668.zip
add event_keep_last_event_data apisubmit/tizen/20160809.011327
- keep last User-Event data for receiver applications Change-Id: If3e00902a943cc2777c34dc38cf2f73c9db43bc2 Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
-rw-r--r--event/event.c18
-rw-r--r--include/app_event.h16
2 files changed, 34 insertions, 0 deletions
diff --git a/event/event.c b/event/event.c
index 1f90517..edb6c16 100644
--- a/event/event.c
+++ b/event/event.c
@@ -264,3 +264,21 @@ int event_publish_trusted_app_event(const char *event_name, bundle *event_data)
return EVENT_ERROR_NONE;
}
+
+int event_keep_last_event_data(const char *event_name)
+{
+ int ret;
+
+ if (event_name == NULL)
+ return event_error(EVENT_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+ ret = eventsystem_keep_last_event_data(event_name);
+ if (ret < 0) {
+ if (ret == ES_R_ENOMEM)
+ return event_error(EVENT_ERROR_OUT_OF_MEMORY, __FUNCTION__, NULL);
+ else
+ return event_error(EVENT_ERROR_IO_ERROR, __FUNCTION__, NULL);
+ }
+
+ return EVENT_ERROR_NONE;
+}
diff --git a/include/app_event.h b/include/app_event.h
index 9a2b9a3..812d063 100644
--- a/include/app_event.h
+++ b/include/app_event.h
@@ -933,6 +933,22 @@ int event_publish_app_event(const char *event_name, bundle *event_data);
int event_publish_trusted_app_event(const char *event_name, bundle *event_data);
/**
+ * @brief Keeps last User-Event data for receiver applications.
+ *
+ * @since_tizen 3.0
+ * @remarks The receiver applications will receive this last event data after adding their new handlers via event_add_event_handler() API since the sender application called this API.
+ * @remarks If a sender application sends same event via trusted API and non-trusted API, then a trusted receiver will get latest data regardless of trusted or non-trusted, but non-trusted receiver will get the last data only from non-trusted API.
+ * @remarks The effect of this API continues during runtime. That means when the sender application process restarts, the sender application needs to call this api again to make the event to keep the last event.
+ * @param[in] event_name The event's name to keep last event data
+ * @return 0 on success, otherwise a negative error value
+ * @retval #EVENT_ERROR_NONE Successful
+ * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
+ * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int event_keep_last_event_data(const char *event_name);
+
+/**
* @}
*/