*/
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.
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
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();
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;
(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)