diff options
author | Alexander <akutsan@luxoft.com> | 2018-09-09 17:29:45 +0300 |
---|---|---|
committer | Andriy Byzhynar <abyzhynar@luxoft.com> | 2018-09-17 17:05:35 +0300 |
commit | 3a42a251f3c62094fc2a71756d16febefa0dcbe9 (patch) | |
tree | 24e7fc4d35d57d0ea6fad1e88836bae9901f5082 | |
parent | f7f3cbd2795303c3fb204a2a4016f844b8902729 (diff) | |
download | sdl_core-3a42a251f3c62094fc2a71756d16febefa0dcbe9.tar.gz |
Fix style
8 files changed, 47 insertions, 35 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index 2a34ee880c..9b0dfd8a96 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -572,15 +572,15 @@ void RegisterAppInterfaceRequest::Run() { const auto& msg_params = (*message_)[strings::msg_params]; const auto& hash_id = msg_params[strings::hash_id].asString(); LOG4CXX_WARN(logger_, "Start Data Resumption"); - auto send_response = [this, application]( - mobile_apis::Result::eType result_code, const std::string& info) { + auto send_response = [this](mobile_apis::Result::eType result_code, + const std::string& info) { result_code_ = result_code; SendRegisterAppInterfaceResponseToMobile( ApplicationType::kNewApplication, info, true); - application->UpdateHash(); + application_->UpdateHash(); }; - resume_ctrl.StartResumption(application, hash_id, send_response); + resume_ctrl.StartResumption(application_, hash_id, send_response); return; } @@ -796,8 +796,8 @@ void FinishSendingRegisterAppInterfaceToMobile( auto application = app_manager.application(connection_key); if (msg_params.keyExists(strings::app_hmi_type)) { - policy_handler_.SetDefaultHmiTypes(application->policy_app_id(), - &(msg_params[strings::app_hmi_type])); + policy_handler.SetDefaultHmiTypes(application->policy_app_id(), + &(msg_params[strings::app_hmi_type])); } // Default HMI level should be set before any permissions validation, since diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc index e2d19def7f..b60ade4c62 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc @@ -101,7 +101,7 @@ class RegisterAppInterfaceRequestTest application_manager_test::MockApplicationHelper:: application_helper_mock()) , mock_rpc_plugin_manager_( - std::make_shared<NiceMock<MockRPCPluginManager> >()) { + std::make_shared<NiceMock<MockRPCPluginManager> >()) { InitGetters(); InitLanguage(); } @@ -110,10 +110,10 @@ class RegisterAppInterfaceRequestTest testing::Mock::VerifyAndClearExpectations(&mock_application_helper_); ON_CALL(app_mngr_, GetPluginManager()) - .WillByDefault(ReturnRef(*mock_rpc_plugin_manager_)); + .WillByDefault(ReturnRef(*mock_rpc_plugin_manager_)); ON_CALL(app_mngr_, GetPolicyHandler()) - .WillByDefault(ReturnRef(mock_policy_handler_)); + .WillByDefault(ReturnRef(mock_policy_handler_)); } void TearDown() OVERRIDE { @@ -271,7 +271,8 @@ class RegisterAppInterfaceRequestTest MockConnectionHandler mock_connection_handler_; MockSessionObserver mock_session_observer_; application_manager_test::MockApplicationHelper& mock_application_helper_; - std::shared_ptr<am::plugin_manager::MockRPCPluginManager> mock_rpc_plugin_manager_; + std::shared_ptr<am::plugin_manager::MockRPCPluginManager> + mock_rpc_plugin_manager_; }; TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) { @@ -304,7 +305,7 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) { std::make_shared<utils::CallNothing>(); ON_CALL(mock_policy_handler_, AddApplication(_, _)) .WillByDefault(Return(notify_upd_manager)); - + EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app)); EXPECT_CALL(mock_rpc_service_, diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc index 84bdb92eb9..922861a24d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc @@ -124,14 +124,14 @@ smart_objects::SmartObjectSPtr VehicleInfoPlugin::CreateSubscriptionRequest( msg_params[key_name] = true; } } - const auto function_id = (subscribe_status == SUBSCRIBE) ? - hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData; + const auto function_id = + (subscribe_status == SUBSCRIBE) + ? hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData + : hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData; smart_objects::SmartObjectSPtr request = application_manager::MessageHelper::CreateModuleInfoSO( - function_id, - *application_manager_); + function_id, *application_manager_); (*request)[strings::msg_params] = msg_params; (*request)[strings::params][strings::app_id] = app_id; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index b162feee81..6ae14279e7 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -433,18 +433,22 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( } if (voice_state && active_app->is_voice_communication_supported()) { + LOG4CXX_DEBUG(logger_, "AKutsan 1"); return true; } if (media_state && active_app->is_media_application()) { + LOG4CXX_DEBUG(logger_, "AKutsan 2"); return true; } if (navi_state && active_app->is_navi()) { + LOG4CXX_DEBUG(logger_, "AKutsan 3"); return true; } if (mobile_projection_state && active_app->mobile_projection_enabled()) { + LOG4CXX_DEBUG(logger_, "AKutsan 4"); return true; } } @@ -453,6 +457,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( if (voice_state) { if ((get_limited_voice_application().use_count() != 0) && (get_limited_voice_application()->app_id() != app->app_id())) { + LOG4CXX_DEBUG(logger_, "AKutsan 5"); return true; } } @@ -460,6 +465,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( if (media_state) { if ((get_limited_media_application().use_count() != 0) && (get_limited_media_application()->app_id() != app->app_id())) { + LOG4CXX_DEBUG(logger_, "AKutsan 6"); return true; } } @@ -467,6 +473,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( if (navi_state) { if ((get_limited_navi_application().use_count() != 0) && (get_limited_navi_application()->app_id() != app->app_id())) { + LOG4CXX_DEBUG(logger_, "AKutsan 7"); return true; } } @@ -475,6 +482,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( if ((get_limited_mobile_projection_application().use_count() != 0) && (get_limited_mobile_projection_application()->app_id() != app->app_id())) { + LOG4CXX_DEBUG(logger_, "AKutsan 8"); return true; } } diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc index d5c78d8a0d..edc0e77aa8 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -409,8 +409,8 @@ bool ResumeCtrlImpl::StartResumption(ApplicationSharedPtr application, } void ResumeCtrlImpl::HandleOnTimeOut(const int32_t app_id) { - LOG4CXX_AUTO_TRACE(logger_); - resumption_data_processor_.HandleOnTimeOut(app_id); + LOG4CXX_AUTO_TRACE(logger_); + resumption_data_processor_.HandleOnTimeOut(app_id); } bool ResumeCtrlImpl::StartResumptionOnlyHMILevel( diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 3d44709657..118be874d2 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -454,30 +454,33 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app, } mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel( - ApplicationSharedPtr app, mobile_apis::HMILevel::eType hmi_level) const { + ApplicationSharedPtr app, + mobile_apis::HMILevel::eType desired_hmi_level) const { LOG4CXX_AUTO_TRACE(logger_); - mobile_apis::HMILevel::eType result = hmi_level; - LOG4CXX_DEBUG(logger_, "HMI Level: " << hmi_level); - - if (!IsStreamableHMILevel(hmi_level)) { + mobile_apis::HMILevel::eType result = desired_hmi_level; + if (!IsStreamableHMILevel(desired_hmi_level)) { return result; } const bool is_audio_app = app->IsAudioApplication(); const bool does_audio_app_with_same_type_exist = app_mngr_.IsAppTypeExistsInFullOrLimited(app); - - if (mobile_apis::HMILevel::HMI_LIMITED == hmi_level) { + if (mobile_apis::HMILevel::HMI_LIMITED == desired_hmi_level) { if (!is_audio_app || does_audio_app_with_same_type_exist) { + LOG4CXX_DEBUG(logger_, + "Not audio application trying to resume in limmited or " + "audio application with the same type active"); result = app_mngr_.GetDefaultHmiLevel(app); } return result; } const bool is_active_app_exist = (bool)app_mngr_.active_application(); + if (is_audio_app) { if (does_audio_app_with_same_type_exist) { + LOG4CXX_DEBUG(logger_, "Audio application with the same type active"); result = app_mngr_.GetDefaultHmiLevel(app); } else if (is_active_app_exist) { result = mobile_apis::HMILevel::HMI_LIMITED; diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc index d0e065310c..f9ca70197d 100644 --- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc +++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc @@ -535,18 +535,18 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) { GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _)) .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true))); - std::shared_ptr<sync_primitives::Lock> button_lock_ptr = - std::make_shared<sync_primitives::Lock>(); + std::shared_ptr<sync_primitives::Lock> button_lock_ptr = + std::make_shared<sync_primitives::Lock>(); ButtonSubscriptions button_subscriptions; - DataAccessor<ButtonSubscriptions> button_subscription_accessor(button_subscriptions, button_lock_ptr); - ON_CALL(*mock_app_, - SubscribedButtons()).WillByDefault(Return(button_subscription_accessor)); + DataAccessor<ButtonSubscriptions> button_subscription_accessor( + button_subscriptions, button_lock_ptr); + ON_CALL(*mock_app_, SubscribedButtons()) + .WillByDefault(Return(button_subscription_accessor)); smart_objects::SmartObjectList button_subscription_notifications; ON_CALL(*application_manager::MockMessageHelper::message_helper_mock(), - CreateOnButtonSubscriptionNotificationsForApp(_, _, _)) - .WillByDefault(Return(button_subscription_notifications)); - + CreateOnButtonSubscriptionNotificationsForApp(_, _, _)) + .WillByDefault(Return(button_subscription_notifications)); EXPECT_CALL(*mock_app_, set_grammar_id(kTestGrammarId_)); @@ -564,7 +564,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) { EXPECT_CALL(*mock_app_extension_, ProcessResumption(saved_app, _)); EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(), - CreateOnButtonSubscriptionNotificationsForApp(_, _, _)); + CreateOnButtonSubscriptionNotificationsForApp(_, _, _)); const bool res = res_ctrl_->StartResumption(mock_app_, kHash_, callback_); EXPECT_TRUE(res); diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc index fbff4c47c7..3519ec981a 100644 --- a/src/components/hmi_message_handler/src/mb_controller.cc +++ b/src/components/hmi_message_handler/src/mb_controller.cc @@ -220,7 +220,7 @@ void CMessageBrokerController::exitReceivingThread() { mConnectionListLock.Acquire(); std::vector<std::shared_ptr<hmi_message_handler::WebsocketSession> >::iterator it; - while(!mConnectionList.empty()){ + while (!mConnectionList.empty()) { mConnectionList.back()->Shutdown(); mConnectionList.pop_back(); } |