summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/command_holder_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/command_holder_impl.cc')
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
index 87ac50ebd7..1c336ac64f 100644
--- a/src/components/application_manager/src/command_holder_impl.cc
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -43,20 +43,23 @@ CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager)
void CommandHolderImpl::Suspend(
ApplicationSharedPtr application,
CommandType type,
+ commands::Command::CommandSource source,
std::shared_ptr<smart_objects::SmartObject> command) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(application);
LOG4CXX_DEBUG(logger_,
"Suspending command(s) for application: "
<< application->policy_app_id());
- sync_primitives::AutoLock lock(commands_lock_);
+ AppCommandInfo info = {command, source};
+
+ sync_primitives::AutoLock lock(commands_lock_);
if (CommandType::kHmiCommand == type) {
- app_hmi_commands_[application].push_back(command);
+ app_hmi_commands_[application].push_back(info);
LOG4CXX_DEBUG(logger_,
"Suspended HMI command(s): " << app_hmi_commands_.size());
} else {
- app_mobile_commands_[application].push_back(command);
+ app_mobile_commands_[application].push_back(info);
LOG4CXX_DEBUG(
logger_,
"Suspended mobile command(s): " << app_mobile_commands_.size());
@@ -113,8 +116,10 @@ void CommandHolderImpl::ResumeHmiCommand(ApplicationSharedPtr application) {
"Resuming HMI command(s): " << app_hmi_commands_.size());
for (auto cmd : app_commands->second) {
- (*cmd)[strings::msg_params][strings::app_id] = application->hmi_app_id();
- app_manager_.GetRPCService().ManageHMICommand(cmd);
+ (*cmd.command_ptr_)[strings::msg_params][strings::app_id] =
+ application->hmi_app_id();
+ app_manager_.GetRPCService().ManageHMICommand(cmd.command_ptr_,
+ cmd.command_source_);
}
app_hmi_commands_.erase(app_commands);
@@ -132,9 +137,10 @@ void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) {
"Resuming mobile command(s): " << app_mobile_commands_.size());
for (auto cmd : app_commands->second) {
- (*cmd)[strings::params][strings::connection_key] = application->app_id();
- app_manager_.GetRPCService().ManageMobileCommand(
- cmd, commands::Command::CommandSource::SOURCE_MOBILE);
+ (*cmd.command_ptr_)[strings::params][strings::connection_key] =
+ application->app_id();
+ app_manager_.GetRPCService().ManageMobileCommand(cmd.command_ptr_,
+ cmd.command_source_);
}
app_mobile_commands_.erase(app_commands);