Modify aod event to broadcasing event 47/226747/4
authorhyunho <hhstark.kang@samsung.com>
Thu, 5 Mar 2020 06:09:09 +0000 (15:09 +0900)
committerhyunho <hhstark.kang@samsung.com>
Thu, 5 Mar 2020 08:44:54 +0000 (17:44 +0900)
Change-Id: I6884f03d1a633621d7d0a939a3a2fa31bec1f81f
Signed-off-by: hyunho <hhstark.kang@samsung.com>
include/watch_app_internal.h
include/watch_base.h
src/base/watch_base.c
src/efl_base/watch_app_main.c

index 5a4f821..7a9d449 100644 (file)
@@ -30,20 +30,18 @@ extern "C" {
  */
 typedef enum {
        WATCH_APP_AMBIENT_EVENT_PREPARE,
-       WATCH_APP_AMBIENT_EVENT_READY,
-       WATCH_APP_AMBIENT_EVENT_CHANGED
+       WATCH_APP_AMBIENT_EVENT_READY
 } watch_app_ambient_event_e;
 
 /**
- * @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] data extra bundle data
  * @return @c 0 on success,
  *         otherwise a negative error value
  */
-int watch_app_ambient_send_event(const char *receiver, watch_app_ambient_event_e event, bundle *data);
+int watch_app_ambient_notify_event(watch_app_ambient_event_e event, bundle *data);
 
 /**
  * @brief Gets extra bundle data from ambient-viewer.
index 79c8fac..a6845cd 100755 (executable)
@@ -125,7 +125,7 @@ int watch_base_time_get_utc_time(watch_base_time_h watch_base_time, struct tm *u
 int watch_base_time_get_utc_timestamp(watch_base_time_h watch_base_time, time_t *utc_timestamp);
 int watch_base_time_get_time_zone(watch_base_time_h watch_base_time, char **time_zone_id);
 int watch_base_time_get_dst_status(watch_base_time_h watch_base_time, bool *status);
-int watch_base_ambient_send_event(const char *receiver, watch_base_ambient_event_e event, bundle *extra);
+int watch_base_ambient_notify_event(watch_base_ambient_event_e event, bundle *extra);
 int watch_base_ambient_get_extra(bundle **extra);
 
 #ifdef __cplusplus
index 5aecff7..e6e7525 100755 (executable)
@@ -1158,20 +1158,14 @@ EXPORT_API int watch_base_get_time_tick_frequency(int *ticks, watch_base_time_ti
        return __get_time_tick_frequency(ticks, type);
 }
 
-EXPORT_API int watch_base_ambient_send_event(const char *receiver,
+EXPORT_API int watch_base_ambient_notify_event(
                watch_base_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) {
-               _E("receiver should not be null");
-               return APP_ERROR_INVALID_PARAMETER;
-       }
-
        if (extra == NULL) {
                _E("extra data is null");
                envelope = bundle_create();
@@ -1206,14 +1200,13 @@ EXPORT_API int watch_base_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) {
                _E("Failed aul_app_com_send");
                bundle_free(envelope);
                return -1;
        }
+       _I("Send AOD Event(%d) done", event);
 
        bundle_free(envelope);
        return APP_ERROR_NONE;
index 3ed00d5..2fb0335 100755 (executable)
@@ -368,10 +368,10 @@ EXPORT_API int watch_app_get_time_tick_frequency(int *ticks,
                        (watch_base_time_tick_resolution_e *)type);
 }
 
-EXPORT_API int watch_app_ambient_send_event(const char *receiver,
+EXPORT_API int watch_app_ambient_notify_event(
                watch_app_ambient_event_e event, bundle *extra)
 {
-       return watch_base_ambient_send_event(receiver, event, extra);
+       return watch_base_ambient_notify_event(event, extra);
 }
 
 EXPORT_API int watch_app_ambient_get_extra(bundle **extra)