merge vui
[apps/agl-service-homescreen.git] / src / hs-apprecover.h
index b702bd9..48138b5 100644 (file)
@@ -20,6 +20,7 @@
 #include <set>
 #include "hs-helper.h"
 #include "hs-config.h"
+#include "hs-clientmanager.h"
 
 struct app_recover_info {
     std::string recover_type;
@@ -27,9 +28,9 @@ struct app_recover_info {
     std::string after;
 };
 
-class HS_AppRecover {
+class HS_AppRecover : public listener_interface {
 public:
-    HS_AppRecover() = default;
+    HS_AppRecover() : listener_interface(std::string("hs_apprecover")) {}
     ~HS_AppRecover() = default;
     HS_AppRecover(HS_AppRecover const &) = delete;
     HS_AppRecover &operator=(HS_AppRecover const &) = delete;
@@ -38,9 +39,10 @@ public:
 
     static HS_AppRecover* instance(void);
     int init(afb_api_t api);
-    void startRecovery(afb_api_t api, recover_map &map);
-    bool registerRecoveredApp(afb_api_t api, const std::string &appid);
+    void setRecoverMap(recover_map &map) {recover_app_map.swap(map);}
+    void startRecovery(afb_api_t api);
     void screenUpdated(struct json_object *obj);
+    void notify(afb_api_t api, std::string appid = "");
 
 private:
     void startApplication(afb_api_t api, const std::string &appid);
@@ -53,6 +55,7 @@ private:
     std::set<std::string> m_recovering_set;
     std::map<std::string, std::set<std::string>> m_wait_recover_set;
     std::set<std::string> m_lastmode_list;
+    recover_map recover_app_map;
 };
 
 #endif // HOMESCREEN_APPRECOVER_H
\ No newline at end of file