summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2018-07-27 19:14:46 +0300
committerAKalinich-Luxoft <AKalinich@luxoft.com>2018-07-30 11:10:47 +0300
commit8e8305da3c0f0cc72855416f2f846a5f932c38ca (patch)
treeec04162d2753d48a80dd104a0d71b768b8da71e2
parent5f0bb3cd3d606adf9659e38e3348c8ed8afd3735 (diff)
downloadsdl_core-8e8305da3c0f0cc72855416f2f846a5f932c38ca.tar.gz
Fix defects found after ATF testing
Apply feature for AddSubMenu RPC Fixed PI request does not resend choiceId Fixed wrong RPC creation in mobile factory
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc48
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc6
3 files changed, 31 insertions, 30 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
index 3dcc414f9e..183b445326 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc
@@ -76,7 +76,7 @@ void AddSubMenuRequest::Run() {
verification_result = MessageHelper::VerifyImage(
received_msg_params[strings::menu_icon], app, application_manager_);
- if (mobile_apis::Result::SUCCESS != verification_result) {
+ if (mobile_apis::Result::INVALID_DATA == verification_result) {
LOG4CXX_ERROR(
logger_, "MessageHelper::VerifyImage return " << verification_result);
SendResponse(false, verification_result);
@@ -117,10 +117,7 @@ void AddSubMenuRequest::Run() {
msg_params[strings::menu_params][strings::menu_name] =
received_msg_params[strings::menu_name];
msg_params[strings::app_id] = app->app_id();
-
- if (mobile_apis::Result::SUCCESS == verification_result) {
- msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
- }
+ msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon];
StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
index 76dd30525a..ec06f0bb31 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc
@@ -343,27 +343,31 @@ bool PerformInteractionRequest::ProcessVRResponse(
return false;
}
- if (Common_Result::SUCCESS == vr_result_code_ &&
- InteractionMode::MANUAL_ONLY == interaction_mode_) {
- LOG4CXX_DEBUG(logger_,
- "VR response SUCCESS in MANUAL_ONLY mode "
- << "Wait for UI response");
- // in case MANUAL_ONLY mode VR.PI SUCCESS just return
- return false;
- }
-
const SmartObject& hmi_msg_params = message[strings::msg_params];
if (hmi_msg_params.keyExists(strings::choice_id)) {
- const int choise_id = hmi_msg_params[strings::choice_id].asInt();
- if (!CheckChoiceIDFromResponse(app, choise_id)) {
+ const int choice_id = hmi_msg_params[strings::choice_id].asInt();
+ if (!CheckChoiceIDFromResponse(app, choice_id)) {
LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI");
TerminatePerformInteraction();
SendResponse(
false, Result::GENERIC_ERROR, "Wrong choiceID was received from HMI");
return true;
}
- msg_params[strings::choice_id] = choise_id;
+ msg_params[strings::choice_id] = choice_id;
+ }
+
+ const bool is_vr_result_success = Compare<Common_Result::eType, EQ, ONE>(
+ vr_result_code_, Common_Result::SUCCESS, Common_Result::WARNINGS);
+
+ if (is_vr_result_success &&
+ InteractionMode::MANUAL_ONLY == interaction_mode_) {
+ LOG4CXX_DEBUG(logger_,
+ "VR response is successfull in MANUAL_ONLY mode "
+ << "Wait for UI response");
+ // in case MANUAL_ONLY mode VR.PI SUCCESS just return
+ return false;
}
+
return false;
}
@@ -401,19 +405,19 @@ void PerformInteractionRequest::ProcessUIResponse(
ui_result_code_, hmi_apis::Common_Result::UNSUPPORTED_RESOURCE);
if (result) {
- if (is_pi_warning) {
- ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
- ui_info_ = message[strings::msg_params][strings::info].asString();
- if (message.keyExists(strings::params) &&
- message[strings::params].keyExists(strings::data)) {
- msg_params = message[strings::params][strings::data];
- }
- } else if (is_pi_unsupported) {
+ if (is_pi_unsupported) {
ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
ui_info_ = message[strings::msg_params][strings::info].asString();
- } else if (message.keyExists(strings::msg_params)) {
- msg_params = message[strings::msg_params];
+ } else {
+ if (message.keyExists(strings::msg_params)) {
+ msg_params = message[strings::msg_params];
+ }
+ if (is_pi_warning) {
+ ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
+ ui_info_ = message[strings::msg_params][strings::info].asString();
+ }
}
+
// result code must be GENERIC_ERROR in case wrong choice_id
if (msg_params.keyExists(strings::choice_id)) {
if (!CheckChoiceIDFromResponse(app,
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
index 3d7e2f6437..4251eeadc9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc
@@ -263,7 +263,7 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
}
case mobile_apis::FunctionID::GetWayPointsID: {
return mobile_api::messageType::request == message_type
- ? factory.GetCreator<commands::ShowConstantTBTRequest>()
+ ? factory.GetCreator<commands::GetWayPointsRequest>()
: factory.GetCreator<commands::GetWayPointsResponse>();
}
case mobile_apis::FunctionID::SubscribeWayPointsID: {
@@ -273,8 +273,8 @@ CommandCreator& MobileCommandFactory::get_creator_factory(
}
case mobile_apis::FunctionID::UnsubscribeWayPointsID: {
return mobile_api::messageType::request == message_type
- ? factory.GetCreator<commands::ShowConstantTBTRequest>()
- : factory.GetCreator<commands::ShowConstantTBTResponse>();
+ ? factory.GetCreator<commands::UnSubscribeWayPointsRequest>()
+ : factory.GetCreator<commands::UnsubscribeWayPointsResponse>();
}
case mobile_apis::FunctionID::GetSystemCapabilityID: {
return mobile_api::messageType::request == message_type