summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2019-06-26 11:25:37 -0400
committerjacobkeeler <jacob.keeler@livioradio.com>2019-06-26 11:25:37 -0400
commite5b068dbcb2a5c51b9d2b36037bb4db702179dca (patch)
tree652e1cec1c281b1ada956ca8a80e9ff40fb121df
parentbd5b5d75e7e80838e8a0102f0c42493d3772e848 (diff)
downloadsdl_core-e5b068dbcb2a5c51b9d2b36037bb4db702179dca.tar.gz
Replace ActivateApp(NONE) logic with CloseApplication logic
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h7
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h13
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h4
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h4
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc23
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc35
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc80
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h6
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc14
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc8
-rw-r--r--src/components/include/application_manager/state_controller.h11
-rw-r--r--src/components/include/test/application_manager/mock_state_controller.h10
14 files changed, 106 insertions, 117 deletions
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index 0642dd3cd1..2671278442 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -348,15 +348,16 @@ class MessageHelper {
bool is_unexpected_disconnect,
ApplicationManager& app_mngr);
- static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
- GetBCActivateAppRequestToHMI(
+ static smart_objects::SmartObjectSPtr GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr);
+ static smart_objects::SmartObjectSPtr GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr);
+
static void SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr);
diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h
index f3b2966fca..590a3663db 100644
--- a/src/components/application_manager/include/application_manager/state_controller_impl.h
+++ b/src/components/application_manager/include/application_manager/state_controller_impl.h
@@ -186,9 +186,9 @@ class StateControllerImpl : public event_engine::EventObserver,
virtual bool IsStateActive(HmiState::StateID state_id) const;
private:
- int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority);
+ int64_t SendStateToHMI(ApplicationConstSharedPtr app,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority);
/**
* @brief The HmiLevelConflictResolver struct
* Move other application to HmiStates if applied moved to FULL or LIMITED
@@ -378,10 +378,11 @@ class StateControllerImpl : public event_engine::EventObserver,
const mobile_apis::VideoStreamingState::eType video_state);
/**
- * @brief OnActivateAppResponse calback for activate app response
+ * @brief OnHMIResponse callback for activate app or close application
+ * response
* @param message Smart Object
*/
- void OnActivateAppResponse(const smart_objects::SmartObject& message);
+ void OnHMIResponse(const smart_objects::SmartObject& message);
/**
* @brief OnAppDeactivated callback for OnAppDeactivated notification
@@ -449,7 +450,7 @@ class StateControllerImpl : public event_engine::EventObserver,
typedef std::list<HmiState::StateID> StateIDList;
StateIDList active_states_;
mutable sync_primitives::Lock active_states_lock_;
- std::map<uint32_t, HmiStatePtr> waiting_for_activate_;
+ std::map<uint32_t, HmiStatePtr> waiting_for_response_;
ApplicationManager& app_mngr_;
};
} // namespace application_manager
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
index 0d0522161d..9847f567e0 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h
@@ -62,12 +62,12 @@ class BasicCommunicationCloseApplicationRequest
/**
* @brief BasicCommunicationCloseApplicationRequest class destructor
**/
- virtual ~BasicCommunicationCloseApplicationRequest();
+ ~BasicCommunicationCloseApplicationRequest() OVERRIDE;
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
index d7318349d9..9576684b77 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h
@@ -62,12 +62,12 @@ class BasicCommunicationCloseApplicationResponse
/**
* @brief BasicCommunicationCloseApplicationResponse class destructor
**/
- virtual ~BasicCommunicationCloseApplicationResponse();
+ ~BasicCommunicationCloseApplicationResponse() OVERRIDE;
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationResponse);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
index 7c87548a82..b965e880b4 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h
@@ -60,12 +60,12 @@ class CloseApplicationRequest : public app_mngr::commands::CommandRequestImpl {
/**
* @brief CloseApplicationRequest class destructor
**/
- virtual ~CloseApplicationRequest();
+ ~CloseApplicationRequest() OVERRIDE;
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
/**
* @brief Interface method that is called whenever new event received
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
index 2e4e24bc3e..c7b649f4e9 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h
@@ -61,12 +61,12 @@ class CloseApplicationResponse
/**
* @brief CloseApplicationResponse class destructor
**/
- virtual ~CloseApplicationResponse();
+ ~CloseApplicationResponse() OVERRIDE;
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(CloseApplicationResponse);
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 6530004499..8dc57b96b0 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -1789,12 +1789,16 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr) {
DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr());
+ if (hmi_apis::Common_HMILevel::NONE == level) {
+ LOG4CXX_WARN(logger_,
+ "BC.ActivateApp cannot be used to deactivate an application");
+ return NULL;
+ }
const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
smart_objects::SmartObjectSPtr message =
@@ -1831,6 +1835,23 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
return message;
}
+smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr());
+
+ const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID();
+ smart_objects::SmartObjectSPtr message =
+ std::make_shared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_CloseApplication;
+ (*message)[strings::params][strings::message_type] = MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] = correlation_id;
+ (*message)[strings::msg_params][strings::app_id] = app->app_id();
+
+ return message;
+}
+
void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id);
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index d94a364c8c..bee88633c1 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -177,41 +177,6 @@ struct DeactivateApplication {
StateController& state_ctrl_;
};
-struct SDLAllowedNotification {
- SDLAllowedNotification(const connection_handler::DeviceHandle& device_id,
- PolicyManager* policy_manager,
- StateController& state_controller)
- : device_id_(device_id)
- , policy_manager_(policy_manager)
- , state_controller_(state_controller) {}
-
- void operator()(const ApplicationSharedPtr& app) {
- DCHECK_OR_RETURN_VOID(policy_manager_);
- if (device_id_ == app->device()) {
- std::string hmi_level = "NONE";
- mobile_apis::HMILevel::eType default_mobile_hmi;
- policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level);
- if ("BACKGROUND" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
- } else if ("FULL" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL;
- } else if ("LIMITED" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED;
- } else if ("NONE" == hmi_level) {
- default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE;
- } else {
- return;
- }
- state_controller_.SetRegularState(app, default_mobile_hmi, true);
- }
- }
-
- private:
- connection_handler::DeviceHandle device_id_;
- PolicyManager* policy_manager_;
- StateController& state_controller_;
-};
-
/**
* @brief Gets from system list of currently registered applications and
* create collection of links device-to-application
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index c791f58047..5f2d87c9ee 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -68,7 +68,7 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state,
- const bool send_activate_app) {
+ const bool send_state_to_hmi) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
@@ -101,12 +101,17 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
- if (send_activate_app) {
- const int64_t corr_id = SendBCActivateApp(app, hmi_level, true);
- if (-1 != corr_id) {
- subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
- corr_id);
- waiting_for_activate_[app->app_id()] = resolved_state;
+ if (send_state_to_hmi) {
+ const int64_t result = SendStateToHMI(app, hmi_level, true);
+ if (-1 != result) {
+ const uint32_t corr_id = static_cast<uint32_t>(result);
+ subscribe_on_event(
+ hmi_apis::Common_HMILevel::NONE == hmi_level
+ ? hmi_apis::FunctionID::BasicCommunication_CloseApplication
+ : hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ corr_id);
+ waiting_for_response_[app->app_id()] = resolved_state;
+ app_mngr_.set_application_id(corr_id, app->hmi_app_id());
return;
}
LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateApp");
@@ -120,7 +125,7 @@ void StateControllerImpl::SetRegularState(
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool send_activate_app) {
+ const bool send_state_to_hmi) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
@@ -132,13 +137,13 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(prev_regular->system_context());
- SetRegularState(app, hmi_state, send_activate_app);
+ SetRegularState(app, hmi_state, send_state_to_hmi);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool send_activate_app) {
+ const bool send_state_to_hmi) {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
@@ -150,7 +155,7 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level));
hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN);
- SetRegularState(app, hmi_state, send_activate_app);
+ SetRegularState(app, hmi_state, send_state_to_hmi);
}
void StateControllerImpl::SetRegularState(
@@ -159,7 +164,7 @@ void StateControllerImpl::SetRegularState(
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool send_activate_app) {
+ const bool send_state_to_hmi) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr hmi_state =
@@ -169,7 +174,7 @@ void StateControllerImpl::SetRegularState(
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_video_streaming_state(video_state);
hmi_state->set_system_context(system_context);
- SetRegularState(app, hmi_state, send_activate_app);
+ SetRegularState(app, hmi_state, send_state_to_hmi);
}
void StateControllerImpl::SetRegularState(
@@ -636,8 +641,9 @@ void StateControllerImpl::on_event(const event_engine::Event& event) {
const SmartObject& message = event.smart_object();
const FunctionID::eType id = static_cast<FunctionID::eType>(event.id());
switch (id) {
- case FunctionID::BasicCommunication_ActivateApp: {
- OnActivateAppResponse(message);
+ case FunctionID::BasicCommunication_ActivateApp:
+ case FunctionID::BasicCommunication_CloseApplication: {
+ OnHMIResponse(message);
break;
}
case FunctionID::BasicCommunication_OnAppActivated: {
@@ -791,31 +797,33 @@ void StateControllerImpl::OnApplicationRegistered(
OnStateChanged(app, initial_state, new_state);
}
-int64_t StateControllerImpl::SendBCActivateApp(
+int64_t StateControllerImpl::SendStateToHMI(
ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr bc_activate_app_request =
- MessageHelper::GetBCActivateAppRequestToHMI(
- app,
- app_mngr_.connection_handler().get_session_observer(),
- app_mngr_.GetPolicyHandler(),
- level,
- send_policy_priority,
- app_mngr_);
- if (!bc_activate_app_request) {
- LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest");
+ smart_objects::SmartObjectSPtr request = NULL;
+ if (level == hmi_apis::Common_HMILevel::NONE) {
+ request = MessageHelper::GetBCCloseApplicationRequestToHMI(app, app_mngr_);
+ } else {
+ request = MessageHelper::GetBCActivateAppRequestToHMI(
+ app,
+ app_mngr_.GetPolicyHandler(),
+ level,
+ send_policy_priority,
+ app_mngr_);
+ }
+ if (!request) {
+ LOG4CXX_ERROR(logger_, "Unable to create request");
return -1;
}
- if (!app_mngr_.GetRPCService().ManageHMICommand(bc_activate_app_request)) {
- LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateAppRequest");
+ if (!app_mngr_.GetRPCService().ManageHMICommand(request)) {
+ LOG4CXX_ERROR(logger_, "Unable to send request");
return -1;
}
- const int64_t corr_id =
- (*bc_activate_app_request)[strings::params][strings::correlation_id]
- .asInt();
- return corr_id;
+ const uint32_t corr_id =
+ (*request)[strings::params][strings::correlation_id].asUInt();
+ return static_cast<int64_t>(corr_id);
}
void StateControllerImpl::ApplyPostponedStateForApp(ApplicationSharedPtr app) {
@@ -890,18 +898,18 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) {
SetRegularState(app, new_regular, false);
}
-void StateControllerImpl::OnActivateAppResponse(
+void StateControllerImpl::OnHMIResponse(
const smart_objects::SmartObject& message) {
const hmi_apis::Common_Result::eType code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
- const int32_t correlation_id =
- message[strings::params][strings::correlation_id].asInt();
+ const uint32_t correlation_id =
+ message[strings::params][strings::correlation_id].asUInt();
const uint32_t hmi_app_id = app_mngr_.application_id(correlation_id);
ApplicationSharedPtr application =
app_mngr_.application_by_hmi_app(hmi_app_id);
if (application && hmi_apis::Common_Result::SUCCESS == code) {
- HmiStatePtr pending_state = waiting_for_activate_[application->app_id()];
+ HmiStatePtr pending_state = waiting_for_response_[application->app_id()];
DCHECK_OR_RETURN_VOID(pending_state);
ApplyRegularState(application, pending_state);
}
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index ec13137abe..819ead8d8b 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -201,14 +201,16 @@ class MockMessageHelper {
MessageHelper::ChoiceSetVRCommandsStatus(
const smart_objects::SmartObject&));
- MOCK_METHOD6(GetBCActivateAppRequestToHMI,
+ MOCK_METHOD5(GetBCActivateAppRequestToHMI,
smart_objects::SmartObjectSPtr(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr));
+ MOCK_METHOD2(GetBCCloseApplicationRequestToHMI,
+ smart_objects::SmartObjectSPtr(ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr));
MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile,
ns_smart_device_link::ns_smart_objects::SmartObjectSPtr(
int32_t connection_key,
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 0629619397..522ef3dbd5 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -368,18 +368,18 @@ std::string MessageHelper::CommonLanguageToString(
smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
ApplicationConstSharedPtr app,
- const protocol_handler::SessionObserver& session_observer,
const policy::PolicyHandlerInterface& policy_handler,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority,
ApplicationManager& app_mngr) {
return MockMessageHelper::message_helper_mock()->GetBCActivateAppRequestToHMI(
- app,
- session_observer,
- policy_handler,
- level,
- send_policy_priority,
- app_mngr);
+ app, policy_handler, level, send_policy_priority, app_mngr);
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI(
+ ApplicationConstSharedPtr app, ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()
+ ->GetBCCloseApplicationRequestToHMI(app, app_mngr);
}
ns_smart_device_link::ns_smart_objects::SmartObjectSPtr
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index fbada47fec..9621e20629 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -1036,7 +1036,7 @@ class StateControllerImplTest : public ::testing::Test {
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
ON_CALL(message_helper_mock_,
- GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
+ GetBCActivateAppRequestToHMI(_, _, hmi_lvl, _, _))
.WillByDefault(Return(bc_activate_app_request));
ON_CALL(app_manager_mock_, GetRPCService())
.WillByDefault(ReturnRef(mock_rpc_service_));
@@ -1969,12 +1969,6 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
StateLevelPair(LimitedState(), Common_HMILevel::LIMITED));
hmi_states.push_back(
StateLevelPair(BackgroundState(), Common_HMILevel::BACKGROUND));
- hmi_states.push_back(
- StateLevelPair(createHmiState(HMILevel::HMI_NONE,
- AudioStreamingState::NOT_AUDIBLE,
- VideoStreamingState::NOT_STREAMABLE,
- SystemContext::SYSCTXT_MAIN),
- Common_HMILevel::NONE));
std::vector<StateLevelPair> initial_hmi_states = hmi_states;
std::vector<StateLevelPair>::iterator it = hmi_states.begin();
std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin();
diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h
index 753581db0e..12d3cce124 100644
--- a/src/components/include/application_manager/state_controller.h
+++ b/src/components/include/application_manager/state_controller.h
@@ -43,25 +43,25 @@ class StateController {
public:
virtual void SetRegularState(ApplicationSharedPtr app,
HmiStatePtr state,
- const bool SendActivateApp) = 0;
+ const bool send_state_to_hmi) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp) = 0;
+ const bool send_state_to_hmi) = 0;
virtual void SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp) = 0;
+ const bool send_state_to_hmi) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp) = 0;
+ const bool send_state_to_hmi) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
@@ -82,9 +82,6 @@ class StateController {
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level) = 0;
- virtual int64_t SendBCActivateApp(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority) = 0;
/**
* @brief OnVideoStreamingStarted process video streaming started
* @param app projection or navigation application starting streaming
diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h
index 5518e01383..e935d6c431 100644
--- a/src/components/include/test/application_manager/mock_state_controller.h
+++ b/src/components/include/test/application_manager/mock_state_controller.h
@@ -49,24 +49,24 @@ class MockStateController : public am::StateController {
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
am::HmiStatePtr state,
- const bool SendActivateApp));
+ const bool send_state_to_hmi));
MOCK_METHOD5(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
- const bool SendActivateApp));
+ const bool send_state_to_hmi));
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp));
+ const bool send_state_to_hmi));
MOCK_METHOD6(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::VideoStreamingState::eType video_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp));
+ const bool send_state_to_hmi));
MOCK_METHOD2(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level));
@@ -82,7 +82,7 @@ class MockStateController : public am::StateController {
MOCK_METHOD2(OnApplicationRegistered,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType default_level));
- MOCK_METHOD3(SendBCActivateApp,
+ MOCK_METHOD3(SendStateToHMI,
int64_t(am::ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority));