send showWindow event when app start over
[apps/agl-service-homescreen.git] / src / hs-clientmanager.cpp
index 1128b01..89b0ae2 100644 (file)
@@ -188,7 +188,7 @@ int HS_ClientManager::handleRequest(afb_req_t request, const char *verb, const c
                 appid2ctxt[appid] = createClientCtxt(request, appid);
                 HS_Client* client = addClient(request, appid);
                 ret = client->handleRequest(request, "subscribe");
-                HS_AppRecover::instance()->registerRecoveredApp(std::string(appid));
+                checkRegisterApp(std::string(appid));
             }
             else {
                 AFB_NOTICE("not exist session");
@@ -233,4 +233,27 @@ int HS_ClientManager::pushEvent(const char *event, struct json_object *param, st
     }
 
     return 0;
+}
+
+/**
+ * check register application
+ *
+ * #### Parameters
+ *  - appid : register application's id
+ *
+ * #### Return
+ * None
+ *
+ */
+void HS_ClientManager::checkRegisterApp(const std::string &appid)
+{
+    if(HS_AppRecover::instance()->registerRecoveredApp(appid)) {
+        AFB_NOTICE("register recover application.");
+        return;
+    }
+
+    if(startup_appid == appid) {
+        startup_appid.clear();
+        pushEvent("showWindow", nullptr, appid);
+    }
 }
\ No newline at end of file