diff options
author | AKalinich-Luxoft <AKalinich@luxoft.com> | 2018-07-06 19:55:38 +0300 |
---|---|---|
committer | AKalinich-Luxoft <AKalinich@luxoft.com> | 2018-07-11 20:50:08 +0300 |
commit | 1c57695b83f1d680a8ea23513378e6c6248210da (patch) | |
tree | 94f9326fef177b03c6752781b45e50fe21ddf0af /src/components/application_manager/rpc_plugins | |
parent | 6371b7b64145971fbf31c5f0e20de83f2d5d73bb (diff) | |
download | sdl_core-1c57695b83f1d680a8ea23513378e6c6248210da.tar.gz |
Fix failed ATF tests after timer removing
Fixed triggering SetGlobalProperties after resumption and during resumption
Fixed commands limit after resumption
Fixed requests counter
Removed redundant logic
Diffstat (limited to 'src/components/application_manager/rpc_plugins')
3 files changed, 20 insertions, 15 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc index d1cb9763d9..1da9fc497f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc @@ -320,9 +320,10 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { return; } + const uint32_t cmd_id = + (*message_)[strings::msg_params][strings::cmd_id].asUInt(); smart_objects::SmartObject msg_param(smart_objects::SmartType_Map); - msg_param[strings::cmd_id] = - (*message_)[strings::msg_params][strings::cmd_id]; + msg_param[strings::cmd_id] = cmd_id; msg_param[strings::app_id] = application->app_id(); switch (event.id()) { @@ -458,8 +459,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command; SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params); - application->RemoveCommand( - (*message_)[strings::msg_params][strings::cmd_id].asUInt()); + application->RemoveCommand(cmd_id); result = false; LOG4CXX_DEBUG(logger_, "Result " << result); } @@ -474,8 +474,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params); - application->RemoveCommand( - (*message_)[strings::msg_params][strings::cmd_id].asUInt()); + application->RemoveCommand(cmd_id); result = false; LOG4CXX_DEBUG(logger_, "Result " << result); } @@ -501,7 +500,10 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { result = false; } - if (!result) { + if (result) { + application->help_prompt_manager().OnVrCommandAdded( + cmd_id, (*message_)[strings::msg_params], false); + } else { RemoveCommand(); } @@ -595,13 +597,13 @@ void AddCommandRequest::RemoveCommand() { return; } + const uint32_t cmd_id = + (*message_)[strings::msg_params][strings::cmd_id].asUInt(); smart_objects::SmartObject msg_params(smart_objects::SmartType_Map); - msg_params[strings::cmd_id] = - (*message_)[strings::msg_params][strings::cmd_id]; + msg_params[strings::cmd_id] = cmd_id; msg_params[strings::app_id] = app->app_id(); - app->RemoveCommand( - (*message_)[strings::msg_params][strings::cmd_id].asUInt()); + app->RemoveCommand(cmd_id); if (BothSend() && !(is_vr_received_ || is_ui_received_)) { // in case we have send bth UI and VR and no one respond diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc index bbe787a123..38069c341e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc @@ -198,7 +198,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { } smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; - const int32_t cmd_id = msg_params[strings::cmd_id].asInt(); + const uint32_t cmd_id = msg_params[strings::cmd_id].asUInt(); smart_objects::SmartObject* command = application->FindCommand(cmd_id); @@ -213,7 +213,8 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { std::string info; const bool result = PrepareResponseParameters(result_code, info); if (result) { - application->RemoveCommand(msg_params[strings::cmd_id].asInt()); + application->RemoveCommand(cmd_id); + application->help_prompt_manager().OnVrCommandDeleted(cmd_id, false); } SendResponse( result, result_code, info.empty() ? NULL : info.c_str(), &msg_params); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc index 38113afcc2..9a01163702 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc @@ -134,9 +134,11 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands( (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); + const uint32_t cmd_id = (*it->second)[strings::cmd_id].asUInt(); msg_params[strings::app_id] = app->app_id(); - msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt(); - app->RemoveCommand((*it->second)[strings::cmd_id].asInt()); + msg_params[strings::cmd_id] = cmd_id; + app->RemoveCommand(cmd_id); + app->help_prompt_manager().OnVrCommandDeleted(cmd_id, false); it = commands.begin(); // Can not relay on // iterators after erase was called |