diff options
author | 2019-04-15 13:44:55 +0800 | |
---|---|---|
committer | 2019-04-15 13:44:55 +0800 | |
commit | 8aa5a1aaa51568aee2526587c29aeea4ad6f9adf (patch) | |
tree | 8915e81cb4e197ac1245165a0d1269bf085ea168 | |
parent | 2456f3235d580f0f03874ecb34716793a78e3e1a (diff) |
modify json contentssandbox/wangzhiqiang/regitstrShortcut
Change-Id: If317ab1aab29a8cfe19f0d61bdd4ca50ce447659
-rw-r--r-- | src/homescreen.cpp | 10 | ||||
-rw-r--r-- | src/hs-client.cpp | 19 |
2 files changed, 6 insertions, 23 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp index 7bada37..44dc825 100644 --- a/src/homescreen.cpp +++ b/src/homescreen.cpp @@ -363,15 +363,7 @@ static void showInformation(afb_req_t request) */ static void registerShortcut(afb_req_t request) { - int ret = 0; - const char* value = afb_req_value(request, _application_id); - if (value) { - ret = g_client_manager->handleRequest(request, __FUNCTION__, value); - } - else { - ret = AFB_EVENT_BAD_REQUEST; - } - + int ret = g_client_manager->handleRequest(request, __FUNCTION__, "homescreen"); if (ret) { afb_req_fail_f(request, "failed", "called %s, Unknown parameter", __FUNCTION__); } diff --git a/src/hs-client.cpp b/src/hs-client.cpp index 607d016..67ec24a 100644 --- a/src/hs-client.cpp +++ b/src/hs-client.cpp @@ -418,20 +418,11 @@ int HS_Client::showInformation(afb_req_t request) */ int HS_Client::registerShortcut(afb_req_t request) { - int ret = 0; - const char *value = afb_req_value(request, _parameter); - if(value) { - struct json_object* push_obj = json_object_new_object(); - hs_add_object_to_json_object_str( push_obj, 4, _application_id, my_id.c_str(), _type, __FUNCTION__); - json_object_object_add(push_obj, _parameter, json_tokener_parse(value)); - afb_event_push(my_event, push_obj); - } - else { - HMI_WARNING("homescreen-service","please input parameters."); - ret = AFB_EVENT_BAD_REQUEST; - } - - return ret; + struct json_object* push_obj = json_object_new_object(); + hs_add_object_to_json_object_str( push_obj, 4, _application_id, my_id.c_str(), _type, __FUNCTION__); + json_object_object_add(push_obj, _parameter, afb_req_json(request)); + afb_event_push(my_event, push_obj); + return 0; } /** |