aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-apprecover.cpp
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-06-03 14:47:27 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-06-03 17:41:21 +0800
commit3f110d22406e836a7fa8878b00d4b1784ae31a55 (patch)
tree07cfe8c7abaaca1b16045d98e54c5619ca2ba301 /src/hs-apprecover.cpp
parent6721f3fbd9d3e5de3b41ce1859ae6034da474a8d (diff)
merge vui
Change-Id: I64a1bb68ea3e2b772a40eb78d316c54f8ed25de8
Diffstat (limited to 'src/hs-apprecover.cpp')
-rw-r--r--src/hs-apprecover.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/hs-apprecover.cpp b/src/hs-apprecover.cpp
index fa8d824..adc8a3a 100644
--- a/src/hs-apprecover.cpp
+++ b/src/hs-apprecover.cpp
@@ -90,6 +90,9 @@ int HS_AppRecover::init(afb_api_t api)
*/
void HS_AppRecover::startRecovery(afb_api_t api)
{
+ this->addListenAppId(_listen_all);
+ HS_ClientManager::instance()->addListener(this);
+
for(auto &key : HS_Config::keys_recover_type) {
for(auto &m : recover_app_map[key]){
struct app_recover_info recover_info = {
@@ -124,23 +127,18 @@ void HS_AppRecover::startRecovery(afb_api_t api)
}
/**
- * register started applications
+ * notify
*
* #### Parameters
- * - appid : application id liked "dashboard"
+ * - api : the api
+ * - appid : application id
*
* #### Return
- * false : not recover app
- * true : recover app
- *
+ * None
+ *
*/
-bool HS_AppRecover::registerRecoveredApp(afb_api_t api, const std::string &appid)
+void HS_AppRecover::notify(afb_api_t api, std::string appid)
{
- bool ret = false;
- if(m_recovering_set.empty()) {
- return ret;
- }
-
AFB_INFO("recover appid=[%s].", appid.c_str());
auto it = m_recovering_set.find(appid);
if(it != m_recovering_set.end()) {
@@ -150,7 +148,6 @@ bool HS_AppRecover::registerRecoveredApp(afb_api_t api, const std::string &appid
&& ip->second.visibility) {
HS_ClientManager::instance()->pushEvent("showWindow", nullptr, appid);
}
- ret = true;
}
// check wait recover application
@@ -161,7 +158,10 @@ bool HS_AppRecover::registerRecoveredApp(afb_api_t api, const std::string &appid
}
m_wait_recover_set.erase(appid);
}
- return ret;
+
+ if(m_recovering_set.empty()) {
+ HS_ClientManager::instance()->removeListener(this);
+ }
}
/**