From 45b4950c3f60033cc1d23dee4203a1f0e94da27b Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 3 Feb 2020 18:25:09 +0900 Subject: [PATCH] Implement NotifyChangedEvent Signed-off-by: hyunho --- watch-holder/src/common.hh | 3 +++ watch-holder/src/watch.cc | 12 ++++++++++++ watch-holder/src/watch.hh | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/watch-holder/src/common.hh b/watch-holder/src/common.hh index 3955fc2..3d70a68 100644 --- a/watch-holder/src/common.hh +++ b/watch-holder/src/common.hh @@ -22,4 +22,7 @@ #endif #define EXPORT_API __attribute__((visibility("default"))) +#define NOTIFY_CHANGED_EVENT_END_POINT "watch_holder,changed" +#define NOTIFY_CHANGED_EVENT_APPID "watch_holder,changed,appid" + #endif // __WATCH_HOLDER_COMMON_HH__ diff --git a/watch-holder/src/watch.cc b/watch-holder/src/watch.cc index bfd95b5..2a6da1c 100644 --- a/watch-holder/src/watch.cc +++ b/watch-holder/src/watch.cc @@ -16,6 +16,7 @@ #include #include +#include #include "watch.hh" @@ -105,4 +106,15 @@ void Watch::OnEvasChanged(const std::string& appId, const std::string& instId, listener_->OnUpdated(*this); } +int Watch::NotifyChangedEvent() { + tizen_base::Bundle b; + b.Add(NOTIFY_CHANGED_EVENT_APPID, appid_); + int ret = aul_app_com_send(NOTIFY_CHANGED_EVENT_END_POINT, b.GetHandle()); + if (ret != 0) { + LOGE("Fail to send noti (%d)", ret); + return -1; + } + return 0; +} + } // namspace watch_holder diff --git a/watch-holder/src/watch.hh b/watch-holder/src/watch.hh index 8bf2464..53aa4ae 100644 --- a/watch-holder/src/watch.hh +++ b/watch-holder/src/watch.hh @@ -43,7 +43,7 @@ class EXPORT_API Watch : private screen_connector::RemoteSurfaceEvas { void Bind(Evas_Object* win); void Unbind(); Evas_Object* GetCurrentImage() const ; - void NotifyChangedEvent(); + int NotifyChangedEvent(); bool IsBound(); std::string GetAppId(); int GetPid() const ; -- 2.7.4