Modify aod event to broadcasing event
authorhyunho <hhstark.kang@samsung.com>
Thu, 5 Mar 2020 06:51:14 +0000 (15:51 +0900)
committerhyunho <hhstark.kang@samsung.com>
Fri, 6 Mar 2020 02:58:45 +0000 (11:58 +0900)
Change-Id: I7b7cb72293c7b957186e569c377056e31bc6352c
Signed-off-by: hyunho <hhstark.kang@samsung.com>
appcore_ui_app_ambient/include/ui_app_ambient.h
appcore_ui_app_ambient/src/ui_app_ambient.c

index 9d3702b4a96248e0ee3e8a0a108f10b8f6b2e59e..4193eb632b6f78b5c1e1b47427bdd8ffea344770 100644 (file)
@@ -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
 }
index 21a3d84e311b39ba44c5e7c7e61859f698228bc2..f621a53f987e4114b7b2db3e9a9dd324057b095f 100644 (file)
@@ -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;