Implement NotifyChangedEvent
authorhyunho <hhstark.kang@samsung.com>
Mon, 3 Feb 2020 09:25:09 +0000 (18:25 +0900)
committerhyunho <hhstark.kang@samsung.com>
Mon, 3 Feb 2020 09:25:09 +0000 (18:25 +0900)
Signed-off-by: hyunho <hhstark.kang@samsung.com>
watch-holder/src/common.hh
watch-holder/src/watch.cc
watch-holder/src/watch.hh

index 3955fc2..3d70a68 100644 (file)
@@ -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__
index bfd95b5..2a6da1c 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <aul.h>
 #include <dlog.h>
+#include <aul_app_com.h>
 
 #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
index 8bf2464..53aa4ae 100644 (file)
@@ -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 ;