X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fhs-helper.cpp;h=50a3ae1bbb08a042d54bed8c946e8212720f6d15;hb=refs%2Fheads%2Fsandbox%2Fwangzhiqiang%2Fjira2292;hp=a599fdd4f6625da757f94143d40e2f68e1d8ca62;hpb=2aa2fc0f925fb529b0a4db038d91398bb627fd1a;p=apps%2Fagl-service-homescreen.git diff --git a/src/hs-helper.cpp b/src/hs-helper.cpp index a599fdd..50a3ae1 100644 --- a/src/hs-helper.cpp +++ b/src/hs-helper.cpp @@ -23,6 +23,12 @@ const char* evlist[] = { "tap_shortcut", "on_screen_message", "on_screen_reply", + "showWindow", + "hideWindow", + "replyShowWindow", + "showNotification", + "showInformation", + "application-list-changed", "reserved" }; @@ -38,7 +44,7 @@ const char* evlist[] = { * error code * */ -REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id) +REQ_ERROR get_value_uint16(const afb_req_t request, const char *source, uint16_t *out_id) { char* endptr; const char* tmp = afb_req_value (request, source); @@ -74,7 +80,7 @@ REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uin * error code * */ -REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id) +REQ_ERROR get_value_int16(const afb_req_t request, const char *source, int16_t *out_id) { char* endptr; const char* tmp = afb_req_value (request, source); @@ -110,7 +116,7 @@ REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int1 * error code * */ -REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id) +REQ_ERROR get_value_int32(const afb_req_t request, const char *source, int32_t *out_id) { char* endptr; const char* tmp = afb_req_value (request, source); @@ -241,3 +247,28 @@ int hs_search_event_name_index(const char* value) } return ret; } + +/** + * get application id from request + * + * #### Parameters + * - request : the request + * + * #### Return + * got application id + * + */ +std::string get_application_id(const afb_req_t request) +{ + std::string appid; + char *app_id = afb_req_get_application_id(request); + if(app_id == nullptr) { + appid = std::string(""); + } + else { + appid = std::string(app_id); + free(app_id); + } + + return appid; +}