summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
diff options
context:
space:
mode:
authorKozoriz <kozorizandriy@gmail.com>2016-04-11 16:22:10 +0300
committerKozoriz <kozorizandriy@gmail.com>2016-04-25 12:05:00 +0300
commit65350ac57da63f3c267d3a27dce05a3752ddbba7 (patch)
tree197f249f8bd3108c7fbb154d4c67a14bcb38318e /src/components/application_manager/src/commands/hmi/response_from_hmi.cc
parent2c7dc612ce41461bebc3416917d2607f24002285 (diff)
downloadsdl_core-65350ac57da63f3c267d3a27dce05a3752ddbba7.tar.gz
Hmi commands update after removing all singletones
Diffstat (limited to 'src/components/application_manager/src/commands/hmi/response_from_hmi.cc')
-rw-r--r--src/components/application_manager/src/commands/hmi/response_from_hmi.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
index 9f6ced5974..9dd4862aac 100644
--- a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc
@@ -31,23 +31,24 @@
*/
#include "application_manager/commands/hmi/response_from_hmi.h"
-#include "application_manager/application_manager_impl.h"
+
#include "smart_objects/smart_object.h"
namespace application_manager {
namespace commands {
-ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message)
- : CommandImpl(message) {
- //If it is error response, shift info
+ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : CommandImpl(message, application_manager) {
+ // If it is error response, shift info
if ((*message)[strings::params].keyExists(hmi_response::message)) {
(*message)[strings::msg_params][strings::info] =
(*message)[strings::params][hmi_response::message];
}
// Replace HMI app id with Mobile connection id
- ApplicationManagerImpl::instance()->ReplaceHMIByMobileAppId(*(message.get()));
+ ReplaceHMIByMobileAppId(*(message.get()));
}
ResponseFromHMI::~ResponseFromHMI() {
@@ -64,10 +65,10 @@ bool ResponseFromHMI::CleanUp() {
void ResponseFromHMI::Run() {
}
-void ResponseFromHMI::SendResponseToMobile(const MessageSharedPtr& message) {
+void ResponseFromHMI::SendResponseToMobile(const MessageSharedPtr& message, ApplicationManager& application_manager) {
(*message)[strings::params][strings::message_type] = MessageType::kResponse;
- ApplicationManagerImpl::instance()->ManageMobileCommand(message);
+ application_manager_.ManageMobileCommand(message, ORIGIN_SDL);
}
void ResponseFromHMI::CreateHMIRequest(
@@ -82,8 +83,7 @@ void ResponseFromHMI::CreateHMIRequest(
}
// get hmi correlation id for chaining further request from this object
- const uint32_t hmi_correlation_id_ = ApplicationManagerImpl::instance()
- ->GetNextHMICorrelationID();
+ const uint32_t hmi_correlation_id_ = application_manager_.GetNextHMICorrelationID();
NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result;
request[strings::params][strings::message_type] = MessageType::kRequest;
@@ -96,7 +96,7 @@ void ResponseFromHMI::CreateHMIRequest(
request[strings::msg_params] = msg_params;
- if (!ApplicationManagerImpl::instance()->ManageHMICommand(result)) {
+ if (!application_manager_.ManageHMICommand(result)) {
LOG4CXX_ERROR(logger_, "Unable to send request");
return;
}