From 833040afc89050dc6900573779475201707bd380 Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 5 Mar 2020 15:51:14 +0900 Subject: Modify aod event to broadcasing event Change-Id: I7b7cb72293c7b957186e569c377056e31bc6352c Signed-off-by: hyunho --- appcore_ui_app_ambient/include/ui_app_ambient.h | 8 +++----- appcore_ui_app_ambient/src/ui_app_ambient.c | 14 +++----------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/appcore_ui_app_ambient/include/ui_app_ambient.h b/appcore_ui_app_ambient/include/ui_app_ambient.h index 9d3702b..4193eb6 100644 --- a/appcore_ui_app_ambient/include/ui_app_ambient.h +++ b/appcore_ui_app_ambient/include/ui_app_ambient.h @@ -43,8 +43,7 @@ typedef enum { */ typedef enum { UI_APP_AMBIENT_EVENT_PREPARE, - UI_APP_AMBIENT_EVENT_READY, - UI_APP_AMBIENT_EVENT_CHANGED, + UI_APP_AMBIENT_EVENT_READY } ui_app_ambient_event_e; /** @@ -115,15 +114,14 @@ int ui_app_ambient_set_update_period(ui_app_ambient_update_period_e period); int ui_app_ambient_get_update_period(ui_app_ambient_update_period_e *period); /** - * @brief Sends event with bundle data to the @a receiver. + * @brief Notifies event with bundle data to the @a receiver. * @remark This function only for internal applications - * @param[in] receiver application id of receiver * @param[in] event ambient event type * @param[in] extra extra bundle data * @return @c 0 on success, * otherwise a negative error value */ -int ui_app_ambient_send_event(const char *receiver, ui_app_ambient_event_e event, bundle *extra); +int ui_app_ambient_notify_event(ui_app_ambient_event_e event, bundle *extra); #ifdef __cplusplus } diff --git a/appcore_ui_app_ambient/src/ui_app_ambient.c b/appcore_ui_app_ambient/src/ui_app_ambient.c index 21a3d84..f621a53 100644 --- a/appcore_ui_app_ambient/src/ui_app_ambient.c +++ b/appcore_ui_app_ambient/src/ui_app_ambient.c @@ -291,20 +291,13 @@ int ui_app_ambient_get_update_period(ui_app_ambient_update_period_e *period) return 0; } -int ui_app_ambient_send_event(const char *receiver, - ui_app_ambient_event_e event, bundle *extra) +int ui_app_ambient_notify_event(ui_app_ambient_event_e event, bundle *extra) { char buf[32]; - char endpoint[APPID_BUFFER_MAX]; char appid_buf[APPID_BUFFER_MAX] = {0, }; int ret; bundle *envelope; - if (!receiver) { - LOGE("receiver should not be null"); - return -1; - } - if (extra == NULL) { LOGE("extra data is null"); envelope = bundle_create(); @@ -339,14 +332,13 @@ int ui_app_ambient_send_event(const char *receiver, return -1; } - snprintf(endpoint, sizeof(endpoint), "send_extra_data:%s", receiver); - - ret = aul_app_com_send(endpoint, envelope); + ret = aul_app_com_send("aod.ambientevent", envelope); if (ret != AUL_R_OK) { LOGE("Failed aul_app_com_send"); bundle_free(envelope); return -1; } + LOGI("Send AOD Event(%d) done", event); bundle_free(envelope); return 0; -- cgit v1.2.3