From: Marius Vlad Date: Wed, 19 Aug 2020 09:09:09 +0000 (+0300) Subject: hs-proxy: Hand over the hs_instance to AfmMainProxy X-Git-Tag: 9.99.4~2 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps%2Fagl-service-homescreen.git;a=commitdiff_plain;h=58eebeba6beb38861add052b9f4641f85906c8f1 hs-proxy: Hand over the hs_instance to AfmMainProxy Bug-AGL: SPEC-3524 Signed-off-by: Marius Vlad Change-Id: I80a7bac4244e62f49ab4bf068476ad4e888085f1 --- diff --git a/src/homescreen.cpp b/src/homescreen.cpp index 95cdf4e..65c0064 100644 --- a/src/homescreen.cpp +++ b/src/homescreen.cpp @@ -163,7 +163,7 @@ static void tap_shortcut (afb_req_t request) if(ret == AFB_REQ_NOT_STARTED_APPLICATION) { std::string id = g_hs_instance->app_info->getAppProperty(value, _keyId); HS_AfmMainProxy afm_proxy; - afm_proxy.start(request, id); + afm_proxy.start(g_hs_instance, request, id); ret = 0; } } @@ -315,7 +315,7 @@ static void showWindow(afb_req_t request) if(ret == AFB_REQ_NOT_STARTED_APPLICATION) { std::string id = g_hs_instance->app_info->getAppProperty(value, _keyId); HS_AfmMainProxy afm_proxy; - afm_proxy.start(request, id); + afm_proxy.start(g_hs_instance, request, id); ret = 0; } } diff --git a/src/hs-proxy.cpp b/src/hs-proxy.cpp index f0ee5f0..a7236b4 100644 --- a/src/hs-proxy.cpp +++ b/src/hs-proxy.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "homescreen.h" #include "hs-proxy.h" const char _afm_main[] = "afm-main"; @@ -127,8 +128,8 @@ int HS_AfmMainProxy::detail(afb_api_t api, const std::string &id, struct json_ob * None * */ -void HS_AfmMainProxy::start(afb_req_t request, const std::string &id) +void HS_AfmMainProxy::start(struct hs_instance *instance, afb_req_t request, const std::string &id) { struct json_object *args = json_object_new_string(id.c_str()); api_call(request->api, _afm_main, __FUNCTION__, args); -} \ No newline at end of file +} diff --git a/src/hs-proxy.h b/src/hs-proxy.h index 8741e49..4016032 100644 --- a/src/hs-proxy.h +++ b/src/hs-proxy.h @@ -28,7 +28,7 @@ struct HS_AfmMainProxy { int detail(afb_api_t api, const std::string &id, struct json_object **object); // asynchronous call, reply in callback function - void start(afb_req_t request, const std::string &id); + void start(struct hs_instance *hs_instance, afb_req_t request, const std::string &id); }; -#endif // HOMESCREEN_PROXY_H \ No newline at end of file +#endif // HOMESCREEN_PROXY_H