int ambient_viewer_destroy(ambient_viewer_h handle);
/**
+ * @brief Blocks the ambient viewer's update events.
+ * @remarks This function only for internal applications.
+ * @param[in] handle The ambient viewer handle
+ * @param[in] enable Whether block buffer event or not
+ * @return #AMBIENT_VIEWER_ERROR_NONE On success, other value on failure
+ * @retval #AMBIENT_VIEWER_ERROR_NONE Success
+ * @retval #AMBIENT_VIEWER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int ambient_viewer_block_update(ambient_viewer_h handle, bool enable);
+
+/**
* @brief Notifies the ambient event.
* @remarks This function only for internal applications.
* @param[in] handle The ambient viewer handle
watch_surface_.reset();
}
+void AmbientViewer::BlockUpdate(bool enable) {
+ if (top_app_surface_ != nullptr && top_app_surface_.get() != nullptr) {
+ top_app_surface_->BlockUpdate(enable);
+ LOGW("Top App Block Update (%d)", enable);
+ }
+
+ if (watch_surface_ != nullptr && watch_surface_.get() != nullptr) {
+ watch_surface_->BlockUpdate(enable);
+ LOGW("Watch Block Update (%d)", enable);
+ }
+}
+
void AmbientViewer::OnReceived(AmbientViewer::EventType ev, std::string sender,
Bundle extra) {
}
int NotifyAmbientEvent(bool enter, Direction dir, tizen_base::Bundle extra);
const ISurface& GetWatchSurface() const;
const ISurface& GetTopAppSurface() const;
+ void BlockUpdate(bool enable);
private:
std::string GetUUID(std::string rid) const;
virtual std::string GetAppId() const = 0;
virtual std::string GetInstId() const = 0;
virtual float GetOpr() const = 0;
+ virtual void BlockUpdate(bool enable) = 0;
};
} //namespace ambient_viewer
return AMBIENT_VIEWER_ERROR_NONE;
}
+extern "C" EXPORT_API int ambient_viewer_block_update(ambient_viewer_h handle,
+ bool enable)
+{
+ if (handle == nullptr) {
+ LOGE("Invalid parameter");
+ return AMBIENT_VIEWER_ERROR_INVALID_PARAMETER;
+ }
+
+ AmbientViewerStub* stub = static_cast<AmbientViewerStub*>(handle);
+ stub->BlockUpdate(enable);
+
+ return AMBIENT_VIEWER_ERROR_NONE;
+}
+
extern "C" EXPORT_API int ambient_viewer_monitor(ambient_viewer_h handle,
ambient_viewer_lifecycle_s lifecycle, void *user_data)
{
*opr = surface->GetOpr();
return AMBIENT_VIEWER_ERROR_NONE;
-}
+}
\ No newline at end of file
return opr;
}
+void TopAppSurface::BlockUpdate(bool enable) {
+ RemoteSurfaceWatcher::SetBlock(enable);
+}
+
void TopAppSurface::OnWatcherAdded(const std::string& appId,
const std::string& instId, const int pid) {
LOGD("WatcherAdded (%s:%s:%d)", appId.c_str(), instId.c_str(), pid);
std::string GetAppId() const override;
std::string GetInstId() const override;
float GetOpr() const override;
+ void BlockUpdate(bool enable) override;
TopAppSurface(std::shared_ptr<screen_connector::EvasObject> surface,
IAmbientViewer* listener);
return opr;
}
+void WatchSurface::BlockUpdate(bool enable) {
+ RemoteSurface::SetBlock(enable);
+}
+
void WatchSurface::OnEvasAdded(const std::string& appId,
const std::string& instId, int pid,
const screen_connector::EvasObject& image) {
std::string GetAppId() const override;
std::string GetInstId() const override;
float GetOpr() const override;
+ void BlockUpdate(bool enable) override;
WatchSurface(int rid, std::string id, std::string appid,
Evas_Object* viewer_win, IAmbientViewer* listener);
virtual ~WatchSurface();