diff options
author | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2018-11-06 10:28:59 +0800 |
---|---|---|
committer | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2018-11-06 11:18:47 +0800 |
commit | c6035c02992d874c1422cb279423017ca4c05eec (patch) | |
tree | 7b4f59f93a760739ae18c1988a51a0d1552d9727 /src | |
parent | d58138e0ceb19b3f201ec5e6e7126015db2cfead (diff) |
use appid instead of appname in "tap_shortcut"
Now In homescreen-service used application_id to identify
different application, so use appid instead of appname
in "tap_shortcut" parameter.
Bug-AGL: SPEC-1764
Change-Id: I8493331f37977a30d6d88c0d222da4c2db32e727
Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/homescreen.cpp | 4 | ||||
-rw-r--r-- | src/hs-client.cpp | 8 | ||||
-rw-r--r-- | src/hs-client.h | 2 | ||||
-rw-r--r-- | src/hs-clientmanager.cpp | 11 | ||||
-rw-r--r-- | src/hs-helper.h | 2 |
5 files changed, 11 insertions, 16 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp index b518139..c6b4cdf 100644 --- a/src/homescreen.cpp +++ b/src/homescreen.cpp @@ -25,7 +25,7 @@ const char _error[] = "error"; -const char _application_name[] = "application_name"; +const char _application_id[] = "application_id"; const char _display_message[] = "display_message"; const char _reply_message[] = "reply_message"; @@ -49,7 +49,7 @@ static void pingSample(afb_req_t request) * * #### Parameters * Request key - * - application_name : application name + * - application_id : application id * * #### Return * None diff --git a/src/hs-client.cpp b/src/hs-client.cpp index c683c66..7da2cda 100644 --- a/src/hs-client.cpp +++ b/src/hs-client.cpp @@ -56,20 +56,20 @@ HS_Client::~HS_Client() * push tap_shortcut event * * #### Parameters - * - appname: app's name. + * - appid: app's id. * * #### Return * result * */ -int HS_Client::tap_shortcut(const char* appname) +int HS_Client::tap_shortcut(const char* appid) { if(!checkEvent(__FUNCTION__)) return 0; - HMI_NOTICE("homescreen-service","%s application_name = %s.", __FUNCTION__, appname); + HMI_NOTICE("homescreen-service","%s application_id = %s.", __FUNCTION__, appid); struct json_object* push_obj = json_object_new_object(); - hs_add_object_to_json_object_str( push_obj, 4, _application_name, appname, + hs_add_object_to_json_object_str( push_obj, 4, _application_id, appid, _type, __FUNCTION__); afb_event_push(my_event, push_obj); return 0; diff --git a/src/hs-client.h b/src/hs-client.h index 1b2eb8f..2564587 100644 --- a/src/hs-client.h +++ b/src/hs-client.h @@ -30,7 +30,7 @@ public: HS_Client &operator=(HS_Client&) = delete; ~HS_Client(); - int tap_shortcut(const char* appname); + int tap_shortcut(const char* appid); int on_screen_message (afb_req_t request, const char* message); int on_screen_reply (afb_req_t request, const char* message); int subscribe(afb_req_t request, const char* event); diff --git a/src/hs-clientmanager.cpp b/src/hs-clientmanager.cpp index aae8c42..15897b7 100644 --- a/src/hs-clientmanager.cpp +++ b/src/hs-clientmanager.cpp @@ -164,20 +164,17 @@ void HS_ClientManager::removeClientCtxt(void *data) int HS_ClientManager::tap_shortcut(afb_req_t request) { int ret = 0; - const char* value = afb_req_value(request, _application_name); + const char* value = afb_req_value(request, _application_id); if (value) { HMI_NOTICE("homescreen-service","request params = %s.", value); - // first step get appid from appname, next step change appname to appid - std::string appid(value); - std::transform(appid.begin(), appid.end(), appid.begin(), ::tolower); std::lock_guard<std::mutex> lock(this->mtx); - auto ip = client_list.find(appid); + auto ip = client_list.find(std::string(value)); if(ip != client_list.end()) { ip->second->tap_shortcut(value); } } else { - HMI_NOTICE("homescreen-service","Please input application_name"); + HMI_NOTICE("homescreen-service","Please input application_id"); ret = AFB_EVENT_BAD_REQUEST; } return ret; @@ -256,7 +253,6 @@ int HS_ClientManager::subscribe(afb_req_t request) HMI_NOTICE("homescreen-service","value is %s", value); if(value) { std::string appid(afb_req_get_application_id(request)); - std::transform(appid.begin(), appid.end(), appid.begin(), ::tolower); std::lock_guard<std::mutex> lock(this->mtx); HS_Client* client = nullptr; @@ -298,7 +294,6 @@ int HS_ClientManager::unsubscribe(afb_req_t request) int ret = 0; if(value) { std::string appid(afb_req_get_application_id(request)); - std::transform(appid.begin(), appid.end(), appid.begin(), ::tolower); std::lock_guard<std::mutex> lock(this->mtx); auto ip = client_list.find(appid); diff --git a/src/hs-helper.h b/src/hs-helper.h index a2fc0a9..ff8579a 100644 --- a/src/hs-helper.h +++ b/src/hs-helper.h @@ -34,7 +34,7 @@ typedef enum REQ_ERROR extern const char* evlist[]; extern const char _error[]; -extern const char _application_name[]; +extern const char _application_id[]; extern const char _display_message[]; extern const char _reply_message[]; |