diff options
author | Yaroslav Mamykin (GitHub) <33784535+YarikMamykin@users.noreply.github.com> | 2020-01-31 18:50:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-31 11:50:26 -0500 |
commit | 49f5b211ca995193d68301b0b3c08e3df427568f (patch) | |
tree | 7e44e0038d7d3888af4246471937ad0ddc6b4a86 /src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h | |
parent | 09c27c1d793164468f59d7b34bf57997e1cfbffe (diff) | |
download | sdl_core-49f5b211ca995193d68301b0b3c08e3df427568f.tar.gz |
Fix processing of VR only Perform Interaction response (#3122)
* Fix processing of VR only PI response
1. Added sending of UI_ClosePopUp request to HMI after
VR.PerformInteraction response.
2. Added sending response with choice_id to mobile in case of successful
VR.PerformInteraction response
* Fix adapt existing unit tests
* Add new unit tests
* fixup! Fix processing of VR only PI response
* fixup! Fix processing of VR only PI response
* fixup! Add new unit tests
* fixup! Fix processing of VR only PI response
* fixup! Add new unit tests
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h index 0572679c85..52a0ad4dc1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h @@ -93,6 +93,33 @@ class PerformInteractionRequest */ virtual void onTimeOut(); + protected: + /** + * @brief Prepare result code for sending to mobile application + * @param ui_response contains result_code from HMI response and + * interface that returns response + * @param vr_response contains result_code from HMI response and + * interface that returns response. + * @return resulting code for sending to mobile application. + */ + mobile_apis::Result::eType PrepareResultCodeForResponse( + const app_mngr::commands::ResponseInfo& ui_response, + const app_mngr::commands::ResponseInfo& vr_response); + + /** + * @brief Checks result code from HMI for splitted RPC + * and returns parameter for sending to mobile app. + * @param ui_response contains result_code from HMI response and + * interface that returns response + * @param vr_response contains result_code from HMI response and + * interface that returns response + * @return true if result code complies successful result code + * otherwise returns false + */ + bool PrepareResultForMobileResponse( + app_mngr::commands::ResponseInfo& out_first, + app_mngr::commands::ResponseInfo& out_second) const; + private: /** * @brief Function will be called when VR_OnCommand event @@ -194,7 +221,7 @@ class PerformInteractionRequest * otherwise returns FALSE. */ bool CheckChoiceIDFromResponse(app_mngr::ApplicationSharedPtr app, - int32_t choice_id); + const int32_t choice_id); /** * @brief Checks for a match of choice ID, in @@ -232,7 +259,27 @@ class PerformInteractionRequest */ void SendBothModeResponse(const smart_objects::SmartObject& msg_param); + /** + * @brief Sends UiClosePopUp request to HMI + */ + void SendClosePopupRequestToHMI(); + + /** + * @brief Sets the choice according to the current interaction mode and first + * received choice id (UI or VR). + * + * @param msg_param Message parameters which will be included in the response + * to mobile device. + * @return Returns false, if choice_id received from UI and VR are valid and + * not equal. Otherwise returns true. + */ + bool SetChoiceIdToResponseMsgParams( + smart_objects::SmartObject& msg_param) const; + mobile_apis::InteractionMode::eType interaction_mode_; + std::int32_t ui_choice_id_received_; + std::int32_t vr_choice_id_received_; + bool ui_response_received_; bool vr_response_received_; bool app_pi_was_active_before_; @@ -241,6 +288,7 @@ class PerformInteractionRequest hmi_apis::Common_Result::eType ui_result_code_; std::string ui_info_; std::string vr_info_; + smart_objects::SmartObject response_msg_params; DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest); }; |