diff options
author | Alexandr Galiuzov <agaliuzov@luxoft.com> | 2015-07-17 16:25:14 +0300 |
---|---|---|
committer | Alexandr Galiuzov <agaliuzov@luxoft.com> | 2015-07-17 16:25:14 +0300 |
commit | 8e7170dcd4a8e6c2368136c721ba6176bd2bf01d (patch) | |
tree | e1fb8aff8a2916c49c7d5cedbfb642bc1d2f7b63 /src | |
parent | 562b680a504c278da2fa23f8111655303ddcb80c (diff) | |
parent | f261a06bbfb133d1662943e3b269906fa1fc0a5a (diff) | |
download | sdl_core-8e7170dcd4a8e6c2368136c721ba6176bd2bf01d.tar.gz |
Merge branch 'release/4.0.0' into develop
Diffstat (limited to 'src')
9 files changed, 50 insertions, 38 deletions
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index ae53c06317..d523354a32 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -430,6 +430,10 @@ class ApplicationManagerImpl : public ApplicationManager, void SetState(uint32_t app_id, mobile_apis::AudioStreamingState::eType audio_state) { ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "Application with appID="<<app_id<<" does not exist"); + return; + } state_ctrl_.SetRegularState(app, audio_state); } @@ -443,6 +447,10 @@ class ApplicationManagerImpl : public ApplicationManager, void SetState(uint32_t app_id, HmiStatePtr new_state) { ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "Application with appID="<<app_id<<" does not exist"); + return; + } state_ctrl_.SetRegularState<SendActivateApp>(app, new_state); } @@ -455,6 +463,10 @@ class ApplicationManagerImpl : public ApplicationManager, void SetState(uint32_t app_id, mobile_apis::HMILevel::eType hmi_level){ ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "Application with appID="<<app_id<<" does not exist"); + return; + } state_ctrl_.SetRegularState<SendActivateApp>(app, hmi_level); } @@ -470,6 +482,10 @@ class ApplicationManagerImpl : public ApplicationManager, mobile_apis::HMILevel::eType hmi_level, mobile_apis::AudioStreamingState::eType audio_state){ ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "Application with appID="<<app_id<<" does not exist"); + return; + } state_ctrl_.SetRegularState<SendActivateApp>(app, hmi_level, audio_state); } @@ -485,6 +501,10 @@ class ApplicationManagerImpl : public ApplicationManager, mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::SystemContext::eType system_context) { ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "Application with appID="<<app_id<<" does not exist"); + return; + } state_ctrl_.SetRegularState<SendActivateApp>(app, hmi_level, audio_state, system_context); } @@ -497,6 +517,10 @@ class ApplicationManagerImpl : public ApplicationManager, void SetState(uint32_t app_id, mobile_apis::SystemContext::eType system_context) { ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "Application with appID="<<app_id<<" does not exist"); + return; + } state_ctrl_.SetRegularState(app, system_context); } diff --git a/src/components/application_manager/include/application_manager/state_controller.h b/src/components/application_manager/include/application_manager/state_controller.h index b57070c35e..fc10597a6a 100644 --- a/src/components/application_manager/include/application_manager/state_controller.h +++ b/src/components/application_manager/include/application_manager/state_controller.h @@ -58,7 +58,9 @@ class StateController : public event_engine::EventObserver { template <bool SendActivateApp> void SetRegularState(ApplicationSharedPtr app, HmiStatePtr state) { - DCHECK_OR_RETURN_VOID(app); + if (!app) { + return; + } DCHECK_OR_RETURN_VOID(state); DCHECK_OR_RETURN_VOID(state->state_id() == HmiState::STATE_ID_REGULAR); @@ -90,7 +92,9 @@ class StateController : public event_engine::EventObserver { void SetRegularState(ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state) { - DCHECK_OR_RETURN_VOID(app); + if (!app) { + return; + } HmiStatePtr prev_regular = app->RegularHmiState(); DCHECK_OR_RETURN_VOID(prev_regular); HmiStatePtr hmi_state = CreateHmiState(app->app_id(), @@ -111,7 +115,9 @@ class StateController : public event_engine::EventObserver { template <bool SendActivateApp> void SetRegularState(ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level) { - DCHECK_OR_RETURN_VOID(app); + if (!app) { + return; + } HmiStatePtr prev_regular = app->RegularHmiState(); DCHECK_OR_RETURN_VOID(prev_regular); HmiStatePtr hmi_state = CreateHmiState(app->app_id(), @@ -135,7 +141,10 @@ class StateController : public event_engine::EventObserver { const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state, const mobile_apis::SystemContext::eType system_context) { - DCHECK_OR_RETURN_VOID(app); + if (!app) { + return; + } + HmiStatePtr hmi_state = CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR); DCHECK_OR_RETURN_VOID(hmi_state); @@ -152,7 +161,9 @@ class StateController : public event_engine::EventObserver { */ void SetRegularState(ApplicationSharedPtr app, const mobile_apis::SystemContext::eType system_context) { - DCHECK_OR_RETURN_VOID(app); + if (!app) { + return; + } HmiStatePtr prev_regular = app->RegularHmiState(); DCHECK_OR_RETURN_VOID(prev_regular); HmiStatePtr hmi_state = CreateHmiState(app->app_id(), diff --git a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc index fc9dcc6f8e..ceb6e1b586 100644 --- a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc @@ -81,11 +81,9 @@ void OnDriverDistractionNotification::Run() { for (; applications.end() != it; ++it) { const ApplicationSharedPtr app = *it; if (app) { - if (mobile_apis::HMILevel::eType::HMI_NONE != app->hmi_level()) { - (*on_driver_distraction)[strings::params] - [strings::connection_key] = app->app_id(); - SendNotificationToMobile(on_driver_distraction); - } + (*on_driver_distraction)[strings::params] + [strings::connection_key] = app->app_id(); + SendNotificationToMobile(on_driver_distraction); } } } diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc index 5beefce944..af55040ad1 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc @@ -89,8 +89,8 @@ void SDLActivateAppRequest::Run() { app->SchemaUrl(), app->PackageName()); } - subscribe_on_event(BasicCommunication_OnAppRegistered); } + subscribe_on_event(BasicCommunication_OnAppRegistered); } else { policy::PolicyHandler::instance()->OnActivateApp(application_id, correlation_id()); diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc index 8e2a0222f7..f6791759a4 100644 --- a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc @@ -59,12 +59,6 @@ void GetDTCsRequest::Run() { return; } - if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) { - LOG4CXX_ERROR(logger_, "App has not been activated"); - SendResponse(false, mobile_apis::Result::REJECTED); - return; - } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( smart_objects::SmartType_Map); diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index 546b14853c..ed75e62c0c 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -65,12 +65,6 @@ void GetVehicleDataRequest::Run() { return; } - if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) { - LOG4CXX_ERROR(logger_, "app in HMI level HMI_NONE"); - SendResponse(false, mobile_apis::Result::REJECTED); - return; - } - const VehicleData& vehicle_data = MessageHelper::vehicle_data(); VehicleData::const_iterator it = vehicle_data.begin(); @@ -181,7 +175,7 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { } LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status << ", so response status become " << status); } else { - any_arg_success = true; + any_arg_success = true; } } @@ -224,16 +218,11 @@ void GetVehicleDataRequest::Run() { return; } - if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) { - LOG4CXX_ERROR(logger_, "app in HMI level HMI_NONE."); - SendResponse(false, mobile_apis::Result::REJECTED); - return; - } if (app->IsCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::CONFIG_FILE)) { LOG4CXX_ERROR(logger_, "GetVehicleData frequency is too high."); - SendResponse(false, mobile_apis::Result::REJECTED); + SendResponse(false, mobile_apis::Result::REJECTED); return; } const VehicleData& vehicle_data = MessageHelper::vehicle_data(); diff --git a/src/components/application_manager/src/commands/mobile/read_did_request.cc b/src/components/application_manager/src/commands/mobile/read_did_request.cc index 5a066aab4d..18f43f12ca 100644 --- a/src/components/application_manager/src/commands/mobile/read_did_request.cc +++ b/src/components/application_manager/src/commands/mobile/read_did_request.cc @@ -64,12 +64,6 @@ void ReadDIDRequest::Run() { return; } - if (mobile_api::HMILevel::HMI_NONE == app->hmi_level()) { - SendResponse(false, mobile_apis::Result::REJECTED); - LOG4CXX_ERROR(logger_, "Rejected"); - return; - } - if (app->IsCommandLimitsExceeded( static_cast<mobile_apis::FunctionID::eType>(function_id()), application_manager::TLimitSource::CONFIG_FILE)) { diff --git a/src/components/application_manager/src/state_controller.cc b/src/components/application_manager/src/state_controller.cc index 0d8f4d3a56..8730cd2c43 100644 --- a/src/components/application_manager/src/state_controller.cc +++ b/src/components/application_manager/src/state_controller.cc @@ -60,7 +60,9 @@ StateController::StateController():EventObserver() { void StateController::SetRegularState(ApplicationSharedPtr app, const mobile_apis::AudioStreamingState::eType audio_state) { - DCHECK_OR_RETURN_VOID(app); + if (!app) { + return; + } HmiStatePtr prev_state = app->RegularHmiState(); DCHECK_OR_RETURN_VOID(prev_state); HmiStatePtr hmi_state = CreateHmiState(app->app_id(), diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc index 21a3506da4..3998c02ab9 100644 --- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc +++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc @@ -64,7 +64,7 @@ TcpTransportAdapter::TcpTransportAdapter(const uint16_t port) NULL, #endif new TcpConnectionFactory(this), - new TcpClientListener(this, port, false)) { + new TcpClientListener(this, port, true)) { } TcpTransportAdapter::~TcpTransportAdapter() { |