diff options
-rw-r--r-- | src/components/application_manager/src/help_prompt_manager_impl.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc index cbf2d21d16..696733e9f0 100644 --- a/src/components/application_manager/src/help_prompt_manager_impl.cc +++ b/src/components/application_manager/src/help_prompt_manager_impl.cc @@ -52,7 +52,7 @@ HelpPromptManagerImpl::HelpPromptManagerImpl(Application& app, ApplicationManager& app_manager) : app_(app) , app_manager_(app_manager) - , sending_type_(SendingType::kNoneSend) + , sending_type_(SendingType::kSendBoth) , count_requests_commands_(0) , is_tts_send_(false) , is_ui_send_(false) {} @@ -71,6 +71,12 @@ void HelpPromptManagerImpl::OnVrCommandAdded( << " will not be added"); return; } + AddCommands(cmd_id, command); + SendRequests(); +} + +void HelpPromptManagerImpl::AddCommands( + const uint32_t cmd_id, const smart_objects::SmartObject& command) { auto it = vr_commands_.find(cmd_id); if (vr_commands_.end() != it) { LOG4CXX_DEBUG(logger_, "Commands with id:" << cmd_id << " already exists"); @@ -107,7 +113,6 @@ void HelpPromptManagerImpl::OnVrCommandAdded( "VR commands with id: " << cmd_id << " added for appID: " << app_.app_id()); count_requests_commands_ += count_new_commands; - SendRequests(); } void HelpPromptManagerImpl::OnVrCommandDeleted(const uint32_t cmd_id) { @@ -155,12 +160,24 @@ void HelpPromptManagerImpl::OnAppActivated(const bool is_restore) { LOG4CXX_DEBUG(logger_, "is_tts_send_:" << is_tts_send_); LOG4CXX_DEBUG(logger_, "is_ui_send_:" << is_ui_send_); if (is_tts_send_ && is_ui_send_) { + sending_type_ = SendingType::kNoneSend; LOG4CXX_DEBUG(logger_, "SetGlobalProperties RPC" " with the vrHelp and helpPrompt" " has been sent"); return; } + else { + sending_type_ = is_tts_send_ ? SendingType::kSendVRHelp : sending_type_; + sending_type_ = is_ui_send_ ? SendingType::kSendHelpPrompt : sending_type_; + is_tts_send_ = false; + is_ui_send_ = false; + const DataAccessor<CommandsMap> accessor = app_.commands_map(); + const CommandsMap& commands = accessor.GetData(); + for (auto& command : commands) { + AddCommands(command.first, *command.second); + } + } } SendRequests(); } |