diff options
Diffstat (limited to 'src/components/application_manager/src/application_manager_impl.cc')
-rw-r--r-- | src/components/application_manager/src/application_manager_impl.cc | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 3829005047..6f5c5a82e3 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1917,7 +1917,7 @@ void ApplicationManagerImpl::OnServiceStartedCallback( "ServiceType = " << type << ". Session = " << std::hex << session_key); std::vector<std::string> empty; - if (type == kRpc) { + if (kRpc == type) { LOG4CXX_DEBUG(logger_, "RPC service is about to be started."); connection_handler().NotifyServiceStartedResult(session_key, true, empty); return; @@ -1944,6 +1944,7 @@ void ApplicationManagerImpl::OnServiceStartedCallback( } else { LOG4CXX_WARN(logger_, "Refuse unknown service"); } + connection_handler().NotifyServiceStartedResult(session_key, false, empty); } @@ -2026,6 +2027,36 @@ void ApplicationManagerImpl::OnServiceEndedCallback( } } +void ApplicationManagerImpl::ProcessServiceStatusUpdate( + const uint32_t connection_key, + hmi_apis::Common_ServiceType::eType service_type, + hmi_apis::Common_ServiceEvent::eType service_event, + utils::Optional<hmi_apis::Common_ServiceUpdateReason::eType> + service_update_reason) { + LOG4CXX_AUTO_TRACE(logger_); + + LOG4CXX_DEBUG(logger_, + "Processing status update with connection key: " + << connection_key << " service type: " << service_type + << " service_event " << service_event + << " service_update_reason " << service_update_reason); + + const auto app = application(connection_key); + auto notification_builder = + MessageHelper::ServiceStatusUpdateNotificationBuilder::CreateBuilder( + service_type, service_event); + + if (app) { + notification_builder.AddAppID(app->app_id()); + } + + if (service_update_reason) { + notification_builder.AddServiceUpdateReason(*service_update_reason); + } + + rpc_service_->ManageHMICommand(notification_builder.notification()); +} + void ApplicationManagerImpl::OnSecondaryTransportStartedCallback( const connection_handler::DeviceHandle device_handle, const int32_t session_key) { @@ -2118,7 +2149,12 @@ bool ApplicationManagerImpl::OnHandshakeDone( using namespace helpers; ApplicationSharedPtr app = application(connection_key); - DCHECK_OR_RETURN(app, false); + if (!app) { + LOG4CXX_WARN(logger_, + "Application for connection key: " << connection_key + << " was not found"); + return false; + } if (Compare<SSLContext::HandshakeResult, EQ, ONE>( result, SSLContext::Handshake_Result_CertExpired, @@ -2131,7 +2167,7 @@ bool ApplicationManagerImpl::OnHandshakeDone( return false; } -bool ApplicationManagerImpl::OnHandshakeFailed() { +bool ApplicationManagerImpl::OnGetSystemTimeFailed() { LOG4CXX_AUTO_TRACE(logger_); return false; } @@ -3889,6 +3925,7 @@ void ApplicationManagerImpl::ProcessReconnection( void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) { LOG4CXX_AUTO_TRACE(logger_); if (!ptu_result) { + protocol_handler_->ProcessFailedPTU(); return; } @@ -3907,6 +3944,25 @@ void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) { plugin_manager_->ForEachPlugin(on_app_policy_updated); } +#if defined(EXTERNAL_PROPRIETARY_MODE) && defined(ENABLE_SECURITY) +void ApplicationManagerImpl::OnCertDecryptFinished(const bool decrypt_result) { + LOG4CXX_AUTO_TRACE(logger_); + if (!decrypt_result) { + protocol_handler_->ProcessFailedCertDecrypt(); + } +} + +bool ApplicationManagerImpl::OnCertDecryptFailed() { + LOG4CXX_AUTO_TRACE(logger_); + return false; +} +#endif + +void ApplicationManagerImpl::OnPTUTimeoutExceeded() { + LOG4CXX_AUTO_TRACE(logger_); + protocol_handler_->ProcessFailedPTU(); +} + void ApplicationManagerImpl::SendDriverDistractionState( ApplicationSharedPtr application) { LOG4CXX_AUTO_TRACE(logger_); |