X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fhs-config.h;h=56a2cfe68286a760718bb98e971aa1395df81512;hb=405a974acd1c2c19ae6e549e5c88aac2c1cb3ea5;hp=7cc5dd3d0f8095c42c784d4dc33f4c81b6fff5bb;hpb=54c9e53f5f9cfbc9f8cf1ea4af9b81447c3a9ffc;p=apps%2Fagl-service-homescreen.git diff --git a/src/hs-config.h b/src/hs-config.h index 7cc5dd3..56a2cfe 100644 --- a/src/hs-config.h +++ b/src/hs-config.h @@ -21,6 +21,8 @@ #include #include "hs-helper.h" +#define RECOVER_MAX 3 + struct handshake_info { int times; // sleep times int sleep; // sleep x ms @@ -28,8 +30,8 @@ struct handshake_info { struct recover_app_info { std::string appid; // application id like "dashboard" - std::string area; // application default display area bool visibility; // the visibility when system starting + std::string after; // startup after which application }; using recover_map = std::unordered_map>; @@ -44,27 +46,24 @@ public: HS_Config &operator=(HS_Config &&) = delete; int readConfig(void); - struct handshake_info getHandshakeInfo(void) {return m_handshake_info;} - recover_map getRecoverMap(void) {return m_recover_map;} + const struct handshake_info* getHandshakeInfo(void) const {return &m_handshake_info;} + recover_map& getRecoverMap(void) {return m_recover_map;} + static const std::array keys_recover_type; // based on hs-conf.json + static const std::string lastmode_json; + static const std::string key_appid; + static const std::string key_visibility; + static const std::string key_after; + static std::string root_dir; private: int parseConfig(void); std::vector getRecoverAppInfo(struct json_object *obj); const std::string hs_conf_json = "hs-conf.json"; - const std::string lastmode_json = "lastmode.json"; const std::string key_handshake = "handshake"; const std::string key_times = "times"; const std::string key_sleep = "sleep"; const std::string key_recover = "recover"; - const std::string key_appid = "appid"; - const std::string key_visibility = "visibility"; - const std::string key_area = "area"; - const std::array keys_recover_type = { // based on hs-conf.json - "hs-apps", - "default-lastmode", - "normal-apps" - }; struct json_object *m_hs_conf; struct json_object *m_lastmode;