summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2019-07-11 15:57:36 -0400
committerjacobkeeler <jacob.keeler@livioradio.com>2019-07-11 15:57:36 -0400
commit8080f10bd7b7f5bbe074cbdafdc19fba7ebe8118 (patch)
treebf2cb540cc7fc5390c59a81623d3f8545bbd4328
parentca57f92444a0784ade3e2d0c872887467f0aeb6f (diff)
downloadsdl_core-feature/close_application_rpc.tar.gz
Address review commentsfeature/close_application_rpc
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc2
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc22
-rw-r--r--src/components/include/application_manager/state_controller.h8
-rw-r--r--src/components/include/test/application_manager/mock_state_controller.h10
5 files changed, 24 insertions, 24 deletions
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 590a3663db..77da28cc91 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 SendStateToHMI(ApplicationConstSharedPtr app,
- hmi_apis::Common_HMILevel::eType level,
- bool send_policy_priority);
+ int64_t RequestHMIStateChange(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
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
index 0c66381be7..736f0355dc 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc
@@ -83,7 +83,7 @@ void CloseApplicationRequest::on_event(const event_engine::Event& event) {
mobile_apis::Result::eType result =
MessageHelper::HMIToMobileResult(hmi_result);
bool success = PrepareResultForMobileResponse(
- hmi_result, HmiInterfaces::HMI_INTERFACE_AppService);
+ hmi_result, HmiInterfaces::HMI_INTERFACE_BasicCommunication);
if (success) {
ApplicationSharedPtr app =
application_manager_.application(connection_key());
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 5f2d87c9ee..994c7b8b7f 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_state_to_hmi) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
DCHECK_OR_RETURN_VOID(state);
@@ -101,8 +101,8 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
- if (send_state_to_hmi) {
- const int64_t result = SendStateToHMI(app, hmi_level, true);
+ if (request_hmi_state_change) {
+ const int64_t result = RequestHMIStateChange(app, hmi_level, true);
if (-1 != result) {
const uint32_t corr_id = static_cast<uint32_t>(result);
subscribe_on_event(
@@ -125,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_state_to_hmi) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr prev_regular = app->RegularHmiState();
@@ -137,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_state_to_hmi);
+ SetRegularState(app, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool send_state_to_hmi) {
+ const bool request_hmi_state_change) {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
@@ -155,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_state_to_hmi);
+ SetRegularState(app, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
@@ -164,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_state_to_hmi) {
+ const bool request_hmi_state_change) {
LOG4CXX_AUTO_TRACE(logger_);
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr hmi_state =
@@ -174,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_state_to_hmi);
+ SetRegularState(app, hmi_state, request_hmi_state_change);
}
void StateControllerImpl::SetRegularState(
@@ -797,13 +797,13 @@ void StateControllerImpl::OnApplicationRegistered(
OnStateChanged(app, initial_state, new_state);
}
-int64_t StateControllerImpl::SendStateToHMI(
+int64_t StateControllerImpl::RequestHMIStateChange(
ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr request = NULL;
- if (level == hmi_apis::Common_HMILevel::NONE) {
+ if (hmi_apis::Common_HMILevel::NONE == level) {
request = MessageHelper::GetBCCloseApplicationRequestToHMI(app, app_mngr_);
} else {
request = MessageHelper::GetBCActivateAppRequestToHMI(
diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h
index 12d3cce124..fa0d65eb0c 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 send_state_to_hmi) = 0;
+ const bool request_hmi_state_change) = 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 send_state_to_hmi) = 0;
+ const bool request_hmi_state_change) = 0;
virtual void SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool send_state_to_hmi) = 0;
+ const bool request_hmi_state_change) = 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 send_state_to_hmi) = 0;
+ const bool request_hmi_state_change) = 0;
virtual void SetRegularState(
ApplicationSharedPtr app,
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 e935d6c431..20a84e7f00 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 send_state_to_hmi));
+ const bool request_hmi_state_change));
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 send_state_to_hmi));
+ const bool request_hmi_state_change));
MOCK_METHOD3(SetRegularState,
void(am::ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool send_state_to_hmi));
+ const bool request_hmi_state_change));
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 send_state_to_hmi));
+ const bool request_hmi_state_change));
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(SendStateToHMI,
+ MOCK_METHOD3(RequestHMIStateChange,
int64_t(am::ApplicationConstSharedPtr app,
hmi_apis::Common_HMILevel::eType level,
bool send_policy_priority));