summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc')
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
index 7c09800d21..682093cef9 100644
--- a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc
@@ -36,20 +36,19 @@
#include <unistd.h>
#include <signal.h>
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/resumption/resume_ctrl.h"
#include "interfaces/HMI_API.h"
-
namespace application_manager {
namespace commands {
OnExitAllApplicationsNotification::OnExitAllApplicationsNotification(
- const MessageSharedPtr& message) : NotificationFromHMI(message) {
-}
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : NotificationFromHMI(message, application_manager) {}
-OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {
-}
+OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {}
void OnExitAllApplicationsNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -62,8 +61,6 @@ void OnExitAllApplicationsNotification::Run() {
mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM;
- ApplicationManagerImpl* app_manager = ApplicationManagerImpl::instance();
-
switch (reason) {
case hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF: {
mob_reason = mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF;
@@ -81,17 +78,18 @@ void OnExitAllApplicationsNotification::Run() {
SendOnSDLPersistenceComplete();
return;
}
- default : {
+ default: {
LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason);
return;
}
}
- app_manager->SetUnregisterAllApplicationsReason(mob_reason);
+ application_manager_.SetUnregisterAllApplicationsReason(mob_reason);
if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason ||
- mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS == mob_reason) {
- app_manager->HeadUnitReset(mob_reason);
+ mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS ==
+ mob_reason) {
+ application_manager_.HeadUnitReset(mob_reason);
}
kill(getpid(), SIGINT);
}
@@ -103,14 +101,14 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
new smart_objects::SmartObject(smart_objects::SmartType_Map);
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
- (*message)[strings::params][strings::message_type] = MessageType::kNotification;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kNotification;
(*message)[strings::params][strings::correlation_id] =
- ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ application_manager_.GetNextHMICorrelationID();
- ApplicationManagerImpl::instance()->ManageHMICommand(message);
+ application_manager_.ManageHMICommand(message);
}
} // namespace commands
} // namespace application_manager
-