aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-apprecover.cpp
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-22 13:53:07 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-22 13:53:07 +0800
commit46ac770dd55f51bc5d611ba3e5dd883e5f51edfa (patch)
tree6d13c6d635176d6ce411fabbe10cfcb2f6a4895a /src/hs-apprecover.cpp
parentf11aba0409610b3f6873006752579690225ca4be (diff)
change hs_recoer
Change-Id: Iadfa3cafbde7df1faa06234c4633832819280bdd
Diffstat (limited to 'src/hs-apprecover.cpp')
-rw-r--r--src/hs-apprecover.cpp58
1 files changed, 57 insertions, 1 deletions
diff --git a/src/hs-apprecover.cpp b/src/hs-apprecover.cpp
index 9bd0cf2..ded070e 100644
--- a/src/hs-apprecover.cpp
+++ b/src/hs-apprecover.cpp
@@ -19,7 +19,63 @@
#include "hs-proxy.h"
#include "hs-clientmanager.h"
-const char _keyArea[] = "area";
+
+HS_AppRecover* HS_AppRecover::me = nullptr;
+
+/**
+ * screen_update event handler
+ *
+ * #### Parameters
+ * - api : the api
+ * - event : received event name
+ * - object : received json object
+ *
+ * #### Return
+ * 0 : event can transfer to others
+ * 1 : event not transfer to others
+ */
+int on_screen_update_event(afb_api_t api, const char *event, struct json_object *object)
+{
+
+ return 0;
+}
+
+/**
+ * get instance
+ *
+ * #### Parameters
+ * - Nothing
+ *
+ * #### Return
+ * HS_AppRecover instance pointer
+ *
+ */
+HS_AppRecover* HS_AppRecover::instance(void)
+{
+ if(me == nullptr)
+ me = new HS_AppRecover();
+
+ return me;
+}
+
+/**
+ * HS_AppRecover initialize function
+ *
+ * #### Parameters
+ * - api : the api serving the request
+ *
+ * #### Return
+ * 0 : init success
+ * 1 : init fail
+ *
+ */
+int HS_AppRecover::init(afb_api_t api)
+{
+ HS_WmProxy wm_proxy;
+ wm_proxy.subscribe(api, HS_WmProxy::Event_ScreenUpdated);
+ setEventHook("windowmanager/screenUpdated", on_screen_update_event);
+ return 0;
+}
/**
* starting recover applications