diff options
author | Ira Lytvynenko <ILytvynenko@luxoft.com> | 2018-02-06 16:40:17 +0200 |
---|---|---|
committer | Ira Lytvynenko (GitHub) <ILytvynenko@luxoft.com> | 2018-06-26 12:01:42 +0300 |
commit | adcca686d6374d5fdd2e24414516a61847ea8b9f (patch) | |
tree | 7b912497e6b4550f9caf00fd13c3937af050758c | |
parent | d7c0131acbf1af7b8d1d13029c8dadbd4ebe4f63 (diff) | |
download | sdl_core-adcca686d6374d5fdd2e24414516a61847ea8b9f.tar.gz |
Refactor CommandFactory
Fix SendAudioPassThroughNotification
Rename Command Origin to Command Source
62 files changed, 967 insertions, 782 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 eb2ac30f17..4fb81e7769 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 @@ -54,6 +54,7 @@ #include "application_manager/event_engine/event_dispatcher_impl.h" #include "application_manager/hmi_interfaces_impl.h" #include "application_manager/command_holder.h" +#include "application_manager/command_factory.h" #include "application_manager/rpc_service.h" #include "application_manager/rpc_handler.h" @@ -117,28 +118,17 @@ struct CommandParametersPermissions; typedef std::map<std::string, hmi_apis::Common_TransportType::eType> DeviceTypes; -namespace impl { -using namespace threads; - -// AudioPassThru -typedef struct { - std::vector<uint8_t> binary_data; - int32_t session_key; -} AudioData; -typedef std::queue<AudioData> RawAudioDataQueue; -typedef threads::MessageLoopThread<RawAudioDataQueue> AudioPassThruQueue; -} CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") typedef utils::SharedPtr<timer::Timer> TimerSPtr; class ApplicationManagerImpl : public ApplicationManager, public connection_handler::ConnectionHandlerObserver, - public policy::PolicyHandlerObserver, + public policy::PolicyHandlerObserver #ifdef ENABLE_SECURITY - public security_manager::SecurityManagerListener, + , + public security_manager::SecurityManagerListener #endif // ENABLE_SECURITY - public impl::AudioPassThruQueue::Handler #ifdef TELEMETRY_MONITOR , public telemetry_monitor::TelemetryObservable<AMTelemetryObserver> @@ -619,18 +609,6 @@ class ApplicationManagerImpl */ void StopAudioPassThru(int32_t application_key) OVERRIDE; - /* - * @brief Creates AudioPassThru data chunk and inserts it - * to audio_pass_thru_messages_ - * - * @param session_key Id of application for which - * audio pass thru should be sent - * - * @param binary_data AudioPassThru data chunk - */ - void SendAudioPassThroughNotification( - uint32_t session_key, std::vector<uint8_t>& binary_data) OVERRIDE; - std::string GetDeviceName(connection_handler::DeviceHandle handle); /* @@ -959,24 +937,29 @@ class ApplicationManagerImpl connection_handler::ConnectionHandler& connection_handler() const OVERRIDE; protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE; - virtual policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE { + policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE { return *policy_handler_; } - virtual const policy::PolicyHandlerInterface& GetPolicyHandler() - const OVERRIDE { + const policy::PolicyHandlerInterface& GetPolicyHandler() const OVERRIDE { return *policy_handler_; } - virtual rpc_service::RPCService& GetRPCService() const OVERRIDE { + CommandFactory& GetCommandFactory() const OVERRIDE { + return *command_factory_; + } + + rpc_service::RPCService& GetRPCService() const OVERRIDE { return *rpc_service_; } - virtual rpc_handler::RPCHandler& GetRPCHandler() const OVERRIDE { + rpc_handler::RPCHandler& GetRPCHandler() const OVERRIDE { return *rpc_handler_; } bool is_stopping() const OVERRIDE; + + bool is_audio_pass_thru_active() const OVERRIDE; /* * @brief Function Should be called when Low Voltage is occured */ @@ -1183,9 +1166,6 @@ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id, MessageValidationResult ValidateMessageBySchema( const Message& message) OVERRIDE; - // CALLED ON audio_pass_thru_messages_ thread! - void Handle(const impl::AudioData message) OVERRIDE; - template <typename ApplicationList> void PrepareApplicationListSO(ApplicationList app_list, smart_objects::SmartObject& applications, @@ -1521,10 +1501,6 @@ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id, static uint32_t corelation_id_; static const uint32_t max_corelation_id_; - // Construct message threads when everything is already created - // Thread that pumps messages audio pass thru to mobile. - impl::AudioPassThruQueue audio_pass_thru_messages_; - std::auto_ptr<HMICapabilities> hmi_capabilities_; // The reason of HU shutdown mobile_api::AppInterfaceUnregisteredReason::eType unregister_reason_; @@ -1576,6 +1552,7 @@ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id, volatile bool is_stopping_; std::unique_ptr<CommandHolder> commands_holder_; + std::unique_ptr<CommandFactory> command_factory_; std::unique_ptr<rpc_service::RPCService> rpc_service_; std::unique_ptr<rpc_handler::RPCHandler> rpc_handler_; diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h new file mode 100644 index 0000000000..596ff11b2a --- /dev/null +++ b/src/components/application_manager/include/application_manager/command_factory.h @@ -0,0 +1,60 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H + +#include "application_manager/commands/command.h" +#include "utils/macro.h" + +namespace application_manager { + +typedef utils::SharedPtr<commands::Command> CommandSharedPtr; + +/** + * @brief Factory class for command creation + **/ +class CommandFactory { + public: + /** + * @brief Create command object and return pointer to it + * + * @param smartObject SmartObject shared pointer. + * @return Pointer to created command object. + **/ + virtual CommandSharedPtr CreateCommand( + const commands::MessageSharedPtr& message, + commands::Command::CommandSource source) = 0; +}; + +} // namespace application_manager +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h index cc090defa0..6524799f45 100644 --- a/src/components/application_manager/include/application_manager/commands/command.h +++ b/src/components/application_manager/include/application_manager/commands/command.h @@ -113,7 +113,7 @@ class Command { */ virtual void SetAllowedToTerminate(const bool allowed) = 0; - enum CommandOrigin { ORIGIN_SDL, ORIGIN_MOBILE }; + enum CommandSource { SOURCE_SDL, SOURCE_MOBILE, SOURCE_HMI }; }; typedef smart_objects::SmartObjectSPtr MessageSharedPtr; diff --git a/src/components/application_manager/include/application_manager/hmi_command_factory.h b/src/components/application_manager/include/application_manager/hmi_command_factory.h index 6603563c6d..35aca28132 100644 --- a/src/components/application_manager/include/application_manager/hmi_command_factory.h +++ b/src/components/application_manager/include/application_manager/hmi_command_factory.h @@ -33,29 +33,23 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_COMMAND_FACTORY_H_ -#include "application_manager/commands/command.h" -#include "utils/macro.h" +#include "application_manager/command_factory.h" +#include "application_manager/application_manager.h" namespace application_manager { -typedef utils::SharedPtr<commands::Command> CommandSharedPtr; -class ApplicationManager; /** - * @brief Factory class for command creation + * @brief Factory class for HMI command creation **/ -class HMICommandFactory { +class HMICommandFactory : public CommandFactory { public: - /** - * @brief Create command object and return pointer to it - * - * @param smartObject SmartObject shared pointer. - * @return Pointer to created command object. - **/ - static CommandSharedPtr CreateCommand( + HMICommandFactory(ApplicationManager& application_manager); + + CommandSharedPtr CreateCommand( const commands::MessageSharedPtr& message, - ApplicationManager& application_manager); + commands::Command::CommandSource source) OVERRIDE; private: - HMICommandFactory(); + ApplicationManager& application_manager_; DISALLOW_COPY_AND_ASSIGN(HMICommandFactory); }; diff --git a/src/components/application_manager/include/application_manager/mobile_command_factory.h b/src/components/application_manager/include/application_manager/mobile_command_factory.h index 1f270b28db..0eddca0f14 100644 --- a/src/components/application_manager/include/application_manager/mobile_command_factory.h +++ b/src/components/application_manager/include/application_manager/mobile_command_factory.h @@ -33,32 +33,23 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_COMMAND_FACTORY_H_ -#include "application_manager/commands/command.h" -#include "utils/macro.h" +#include "application_manager/command_factory.h" +#include "application_manager/application_manager.h" namespace application_manager { - -typedef utils::SharedPtr<commands::Command> CommandSharedPtr; -class ApplicationManager; - /** - * @brief Factory class for command creation + * @brief Factory class for mobile command creation **/ -class MobileCommandFactory { +class MobileCommandFactory : public CommandFactory { public: - /** - * @brief Create command object and return pointer to it - * - * @param smartObject SmartObject shared pointer. - * @return Pointer to created command object. - **/ - static CommandSharedPtr CreateCommand( + MobileCommandFactory(ApplicationManager& application_manager); + + CommandSharedPtr CreateCommand( const commands::MessageSharedPtr& message, - commands::Command::CommandOrigin origin, - ApplicationManager& application_manager); + commands::Command::CommandSource source) OVERRIDE; private: - MobileCommandFactory(); + ApplicationManager& application_manager_; DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory); }; diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h index 1fa3612daf..4f6c327bcf 100644 --- a/src/components/application_manager/include/application_manager/rpc_service_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h @@ -102,7 +102,7 @@ class RPCServiceImpl : public RPCService, ~RPCServiceImpl(); bool ManageMobileCommand(const commands::MessageSharedPtr message, - commands::Command::CommandOrigin origin) OVERRIDE; + commands::Command::CommandSource source) OVERRIDE; bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE; // CALLED ON messages_to_hmi_ thread! diff --git a/src/components/application_manager/include/application_manager/sdl_command_factory.h b/src/components/application_manager/include/application_manager/sdl_command_factory.h new file mode 100644 index 0000000000..c2e82b9596 --- /dev/null +++ b/src/components/application_manager/include/application_manager/sdl_command_factory.h @@ -0,0 +1,67 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SDL_COMMAND_FACTORY_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SDL_COMMAND_FACTORY_H + +#include <memory> +#include "application_manager/application_manager.h" +#include "application_manager/command_factory.h" +#include "application_manager/hmi_command_factory.h" +#include "application_manager/mobile_command_factory.h" +#include "application_manager/rpc_service.h" +#include "application_manager/hmi_capabilities.h" +#include "application_manager/policies/policy_handler_interface.h" + +namespace application_manager { + +class SDLCommandFactory : public CommandFactory { + public: + SDLCommandFactory(ApplicationManager& app_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + + CommandSharedPtr CreateCommand( + const commands::MessageSharedPtr& message, + commands::Command::CommandSource source) OVERRIDE; + + private: + ApplicationManager& app_manager_; + rpc_service::RPCService& rpc_service_; + HMICapabilities& hmi_capabilities_; + policy::PolicyHandlerInterface& policy_handler_; + std::unique_ptr<HMICommandFactory> hmi_command_factory_; + std::unique_ptr<MobileCommandFactory> mobile_command_factory_; +}; +} +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SDL_COMMAND_FACTORY_H diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index f23600f46b..0b10da9e35 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -45,6 +45,7 @@ #include "application_manager/message_helper.h" #include "application_manager/rpc_service_impl.h" #include "application_manager/rpc_handler_impl.h" +#include "application_manager/sdl_command_factory.h" #include "application_manager/mobile_message_handler.h" #include "application_manager/policies/policy_handler.h" #include "application_manager/hmi_capabilities_impl.h" @@ -159,7 +160,6 @@ ApplicationManagerImpl::ApplicationManagerImpl( , request_ctrl_(am_settings) , hmi_so_factory_(NULL) , mobile_so_factory_(NULL) - , audio_pass_thru_messages_("AudioPassThru", this) , hmi_capabilities_(new HMICapabilitiesImpl(*this)) , unregister_reason_( mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM) @@ -489,7 +489,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( mobile_apis::FunctionID::RegisterAppInterfaceID, message[strings::params][strings::correlation_id].asUInt(), mobile_apis::Result::GENERIC_ERROR)); - rpc_service_->ManageMobileCommand(response, commands::Command::ORIGIN_SDL); + rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL); return ApplicationSharedPtr(); } @@ -521,7 +521,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( mobile_apis::FunctionID::RegisterAppInterfaceID, message[strings::params][strings::correlation_id].asUInt(), mobile_apis::Result::DISALLOWED)); - rpc_service_->ManageMobileCommand(response, commands::Command::ORIGIN_SDL); + rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL); return ApplicationSharedPtr(); } @@ -540,7 +540,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( mobile_apis::FunctionID::RegisterAppInterfaceID, message[strings::params][strings::correlation_id].asUInt(), mobile_apis::Result::OUT_OF_MEMORY)); - rpc_service_->ManageMobileCommand(response, commands::Command::ORIGIN_SDL); + rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL); return ApplicationSharedPtr(); } @@ -887,23 +887,6 @@ void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key, session_key, get_settings().recording_file_name(), max_duration); } -void ApplicationManagerImpl::SendAudioPassThroughNotification( - uint32_t session_key, std::vector<uint8_t>& binary_data) { - LOG4CXX_AUTO_TRACE(logger_); - - if (!audio_pass_thru_active_) { - LOG4CXX_ERROR(logger_, - "Trying to send PassThroughNotification" - " when PassThrough is not active"); - return; - } - - impl::AudioData data; - data.session_key = session_key; - data.binary_data = binary_data; - audio_pass_thru_messages_.PostMessage(data); -} - void ApplicationManagerImpl::StopAudioPassThru(int32_t application_key) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(audio_pass_thru_lock_); @@ -1597,7 +1580,7 @@ void ApplicationManagerImpl::OnServiceEndedCallback( rpc_service_->ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( session_key, AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); break; } case CloseSessionReason::kMalformed: { @@ -1719,6 +1702,8 @@ void ApplicationManagerImpl::set_protocol_handler( protocol_handler_, hmi_handler_, *commands_holder_)); + command_factory_.reset(new SDLCommandFactory( + *this, *rpc_service_, *hmi_capabilities_, *policy_handler_)); } void ApplicationManagerImpl::StartDevicesDiscovery() { @@ -2432,7 +2417,7 @@ void ApplicationManagerImpl::UnregisterAllApplications() { rpc_service_->ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app_to_remove->app_id(), unregister_reason_), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); UnregisterApplication(app_to_remove->app_id(), mobile_apis::Result::INVALID_ENUM, is_ignition_off, @@ -2598,46 +2583,6 @@ void ApplicationManagerImpl::OnAppUnauthorized(const uint32_t& app_id) { connection_handler::kUnauthorizedApp); } -void ApplicationManagerImpl::Handle(const impl::AudioData message) { - LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr on_audio_pass = - new smart_objects::SmartObject(); - - if (!on_audio_pass) { - LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer"); - return; - } - - LOG4CXX_DEBUG(logger_, "Fill smart object"); - - (*on_audio_pass)[strings::params][strings::message_type] = - application_manager::MessageType::kNotification; - - (*on_audio_pass)[strings::params][strings::connection_key] = - static_cast<int32_t>(message.session_key); - (*on_audio_pass)[strings::params][strings::function_id] = - mobile_apis::FunctionID::OnAudioPassThruID; - - LOG4CXX_DEBUG(logger_, "Fill binary data"); - // binary data - (*on_audio_pass)[strings::params][strings::binary_data] = - smart_objects::SmartObject(message.binary_data); - - LOG4CXX_DEBUG(logger_, "After fill binary data"); - LOG4CXX_DEBUG(logger_, "Send data"); - CommandSharedPtr command(MobileCommandFactory::CreateCommand( - on_audio_pass, commands::Command::ORIGIN_SDL, *this)); - if (!command) { - LOG4CXX_WARN(logger_, "Failed to create mobile command from smart object"); - return; - } - - if (command->Init()) { - command->Run(); - command->CleanUp(); - } -} - mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions( const ApplicationSharedPtr app, const std::string& function_id, @@ -2696,6 +2641,10 @@ bool ApplicationManagerImpl::is_stopping() const { return is_stopping_; } +bool ApplicationManagerImpl::is_audio_pass_thru_active() const { + return audio_pass_thru_active_; +} + void ApplicationManagerImpl::OnLowVoltage() { LOG4CXX_AUTO_TRACE(logger_); is_low_voltage_ = true; @@ -2794,7 +2743,7 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { rpc_service_->ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app_id, PROTOCOL_VIOLATION), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); UnregisterApplication(app_id, ABORTED); return; } @@ -2987,7 +2936,7 @@ void ApplicationManagerImpl::SendHMIStatusNotification( static_cast<int32_t>(app->system_context()); rpc_service_->ManageMobileCommand(notification, - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); } void ApplicationManagerImpl::ClearTimerPool() { @@ -3033,7 +2982,7 @@ void ApplicationManagerImpl::CloseNaviApp() { rpc_service_->ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app_id, PROTOCOL_VIOLATION), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); UnregisterApplication(app_id, ABORTED); } } diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc index 525940c783..9799b170dc 100644 --- a/src/components/application_manager/src/command_holder_impl.cc +++ b/src/components/application_manager/src/command_holder_impl.cc @@ -134,7 +134,7 @@ void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) { for (auto cmd : app_commands->second) { (*cmd)[strings::params][strings::connection_key] = application->app_id(); app_manager_.GetRPCService().ManageMobileCommand( - cmd, commands::Command::CommandOrigin::ORIGIN_MOBILE); + cmd, commands::Command::CommandSource::SOURCE_MOBILE); } app_mobile_commands_.erase(app_commands); diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 69266b1b65..36217e9bc3 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -244,7 +244,7 @@ void CommandRequestImpl::onTimeOut() { mobile_api::Result::GENERIC_ERROR); AddTimeOutComponentInfoToMessage(*response); application_manager_.GetRPCService().ManageMobileCommand(response, - ORIGIN_SDL); + SOURCE_SDL); } void CommandRequestImpl::on_event(const event_engine::Event& event) {} @@ -307,7 +307,7 @@ void CommandRequestImpl::SendResponse( is_success_result_ = success; - application_manager_.GetRPCService().ManageMobileCommand(result, ORIGIN_SDL); + application_manager_.GetRPCService().ManageMobileCommand(result, SOURCE_SDL); } bool CommandRequestImpl::CheckSyntax(const std::string& str, diff --git a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc index 55ecfd6643..2135431f10 100644 --- a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc @@ -62,7 +62,7 @@ void NotificationFromHMI::SendNotificationToMobile( const MessageSharedPtr& message) { (*message)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); - application_manager_.GetRPCService().ManageMobileCommand(message, ORIGIN_SDL); + application_manager_.GetRPCService().ManageMobileCommand(message, SOURCE_SDL); } void NotificationFromHMI::CreateHMIRequest( diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc index 8e43fdfd01..4b48650265 100644 --- a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc @@ -86,7 +86,7 @@ void OnExitApplicationNotification::Run() { application_manager_.GetRPCService().ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); // HMI rejects registration for navi application application_manager_.UnregisterApplication(app_id, Result::SUCCESS); return; @@ -95,7 +95,7 @@ void OnExitApplicationNotification::Run() { application_manager_.GetRPCService().ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.UnregisterApplication(app_id, Result::SUCCESS); return; } diff --git a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc index f7fe10f332..4571cfeb5b 100644 --- a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc @@ -82,7 +82,7 @@ void OnTTSLanguageChangeNotification::Run() { MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app->app_id(), mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.UnregisterApplication( app->app_id(), mobile_apis::Result::SUCCESS, false); } diff --git a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc index caea874371..8eac4a1c80 100644 --- a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc @@ -81,7 +81,7 @@ void OnUILanguageChangeNotification::Run() { MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app->app_id(), mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.UnregisterApplication( app->app_id(), mobile_apis::Result::SUCCESS, false); } diff --git a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc index c94a341fcb..740c51a211 100644 --- a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc @@ -80,7 +80,7 @@ void OnVRLanguageChangeNotification::Run() { MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app->app_id(), mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.UnregisterApplication( app->app_id(), mobile_apis::Result::SUCCESS, false); } diff --git a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc index 6ec83debb0..123789730c 100644 --- a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc @@ -67,7 +67,7 @@ void ResponseFromHMI::SendResponseToMobile( const MessageSharedPtr& message, ApplicationManager& application_manager) { (*message)[strings::params][strings::message_type] = MessageType::kResponse; - application_manager_.GetRPCService().ManageMobileCommand(message, ORIGIN_SDL); + application_manager_.GetRPCService().ManageMobileCommand(message, SOURCE_SDL); } void ResponseFromHMI::CreateHMIRequest( diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 41edfad205..c0e46ea4e0 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -398,7 +398,7 @@ void RegisterAppInterfaceRequest::Run() { smart_objects::SmartObjectSPtr so = GetLockScreenIconUrlNotification(connection_key(), application); application_manager_.GetRPCService().ManageMobileCommand( - so, commands::Command::ORIGIN_SDL); + so, commands::Command::SOURCE_SDL); } smart_objects::SmartObjectSPtr diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc index 10cb54a8a1..08c3e228cb 100644 --- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc @@ -52,7 +52,7 @@ void UnregisterAppInterfaceRequest::Run() { MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( connection_key(), mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.EndNaviServices(connection_key()); application_manager_.UnregisterApplication(connection_key(), mobile_apis::Result::SUCCESS); diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index 5ef8605999..0b470002c2 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -296,16 +296,19 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace application_manager { +HMICommandFactory::HMICommandFactory(ApplicationManager& application_manager) + : application_manager_(application_manager) {} + CommandSharedPtr HMICommandFactory::CreateCommand( const commands::MessageSharedPtr& message, - ApplicationManager& application_manager) { + commands::Command::CommandSource source) { const int function_id = (*message)[strings::params][strings::function_id].asInt(); LOG4CXX_DEBUG( logger_, "HMICommandFactory::CreateCommand function_id: " << function_id); CommandSharedPtr command(new application_manager::commands::CommandImpl( - message, application_manager)); + message, application_manager_)); bool is_response = false; const int msg_type = @@ -326,26 +329,26 @@ CommandSharedPtr HMICommandFactory::CreateCommand( switch (function_id) { case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: { command.reset( - new commands::OnStartDeviceDiscovery(message, application_manager)); + new commands::OnStartDeviceDiscovery(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: { if (is_response) { command.reset(new commands::UpdateDeviceListResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UpdateDeviceListRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::BasicCommunication_ActivateApp: { if (is_response) { command.reset( - new commands::ActivateAppResponse(message, application_manager)); + new commands::ActivateAppResponse(message, application_manager_)); } else { command.reset( - new commands::ActivateAppRequest(message, application_manager)); + new commands::ActivateAppRequest(message, application_manager_)); } break; } @@ -353,10 +356,10 @@ CommandSharedPtr HMICommandFactory::CreateCommand( case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: { if (is_response) { command.reset(new commands::DecryptCertificateResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::DecryptCertificateRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -364,494 +367,494 @@ CommandSharedPtr HMICommandFactory::CreateCommand( case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: { if (is_response) { command.reset( - new commands::GetSystemInfoResponse(message, application_manager)); + new commands::GetSystemInfoResponse(message, application_manager_)); } else { command.reset( - new commands::GetSystemInfoRequest(message, application_manager)); + new commands::GetSystemInfoRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_ActivateApp: { if (is_response) { - command.reset( - new commands::SDLActivateAppResponse(message, application_manager)); + command.reset(new commands::SDLActivateAppResponse( + message, application_manager_)); } else { command.reset( - new commands::SDLActivateAppRequest(message, application_manager)); + new commands::SDLActivateAppRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: { if (is_response) { command.reset(new commands::SDLPolicyUpdateResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset( - new commands::SDLPolicyUpdate(message, application_manager)); + new commands::SDLPolicyUpdate(message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_GetURLS: { if (is_response) { command.reset( - new commands::GetUrlsResponse(message, application_manager)); + new commands::GetUrlsResponse(message, application_manager_)); } else { - command.reset(new commands::GetUrls(message, application_manager)); + command.reset(new commands::GetUrls(message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: { command.reset(new commands::OnAppPermissionChangedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_GetListOfPermissions: { if (is_response) { command.reset(new commands::SDLGetListOfPermissionsResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::SDLGetListOfPermissionsRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: { if (is_response) { command.reset(new commands::SDLGetUserFriendlyMessageResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::SDLGetUserFriendlyMessageRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_GetStatusUpdate: { if (is_response) { command.reset(new commands::SDLGetStatusUpdateResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::SDLGetStatusUpdateRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_OnStatusUpdate: { command.reset(new commands::OnStatusUpdateNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: { command.reset(new commands::OnAppPermissionConsentNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: { if (is_response) { command.reset(new commands::MixingAudioSupportedResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::MixingAudioSupportedRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: { command.reset(new commands::OnExitAllApplicationsNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_AddCommand: { if (is_response) { command.reset( - new commands::UIAddCommandResponse(message, application_manager)); + new commands::UIAddCommandResponse(message, application_manager_)); } else { command.reset( - new commands::UIAddCommandRequest(message, application_manager)); + new commands::UIAddCommandRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_DeleteCommand: { if (is_response) { command.reset(new commands::UIDeleteCommandResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::UIDeleteCommandRequest(message, application_manager)); + command.reset(new commands::UIDeleteCommandRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_AddSubMenu: { if (is_response) { command.reset( - new commands::UIAddSubmenuResponse(message, application_manager)); + new commands::UIAddSubmenuResponse(message, application_manager_)); } else { command.reset( - new commands::UIAddSubmenuRequest(message, application_manager)); + new commands::UIAddSubmenuRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_DeleteSubMenu: { if (is_response) { command.reset(new commands::UIDeleteSubmenuResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::UIDeleteSubmenuRequest(message, application_manager)); + command.reset(new commands::UIDeleteSubmenuRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_SetMediaClockTimer: { if (is_response) { command.reset(new commands::UISetMediaClockTimerResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UISetMediaClockTimerRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_PerformInteraction: { if (is_response) { command.reset(new commands::UIPerformInteractionResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIPerformInteractionRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_SetGlobalProperties: { if (is_response) { command.reset(new commands::UISetGlobalPropertiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UISetGlobalPropertiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_ScrollableMessage: { if (is_response) { command.reset(new commands::UIScrollableMessageResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIScrollableMessageRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_SetAppIcon: { if (is_response) { command.reset( - new commands::UISetAppIconResponse(message, application_manager)); + new commands::UISetAppIconResponse(message, application_manager_)); } else { command.reset( - new commands::UISetAppIconRequest(message, application_manager)); + new commands::UISetAppIconRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_GetSupportedLanguages: { if (is_response) { command.reset(new commands::UIGetSupportedLanguagesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIGetSupportedLanguagesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_GetLanguage: { if (is_response) { command.reset( - new commands::UIGetLanguageResponse(message, application_manager)); + new commands::UIGetLanguageResponse(message, application_manager_)); } else { command.reset( - new commands::UIGetLanguageRequest(message, application_manager)); + new commands::UIGetLanguageRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_GetCapabilities: { if (is_response) { command.reset(new commands::UIGetCapabilitiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIGetCapabilitiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_ChangeRegistration: { if (is_response) { command.reset(new commands::UIChangeRegistratioResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIChangeRegistrationRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_PerformAudioPassThru: { if (is_response) { command.reset(new commands::UIPerformAudioPassThruResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIPerformAudioPassThruRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_EndAudioPassThru: { if (is_response) { command.reset(new commands::UIEndAudioPassThruResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UIEndAudioPassThruRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_Alert: { if (is_response) { command.reset( - new commands::UIAlertResponse(message, application_manager)); + new commands::UIAlertResponse(message, application_manager_)); } else { command.reset( - new commands::UIAlertRequest(message, application_manager)); + new commands::UIAlertRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_IsReady: { if (is_response) { command.reset( - new commands::VRIsReadyResponse(message, application_manager)); + new commands::VRIsReadyResponse(message, application_manager_)); } else { command.reset( - new commands::VRIsReadyRequest(message, application_manager)); + new commands::VRIsReadyRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_AddCommand: { if (is_response) { command.reset( - new commands::VRAddCommandResponse(message, application_manager)); + new commands::VRAddCommandResponse(message, application_manager_)); } else { command.reset( - new commands::VRAddCommandRequest(message, application_manager)); + new commands::VRAddCommandRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_DeleteCommand: { if (is_response) { command.reset(new commands::VRDeleteCommandResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::VRDeleteCommandRequest(message, application_manager)); + command.reset(new commands::VRDeleteCommandRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_ChangeRegistration: { if (is_response) { command.reset(new commands::VRChangeRegistrationResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VRChangeRegistrationRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_GetSupportedLanguages: { if (is_response) { command.reset(new commands::VRGetSupportedLanguagesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VRGetSupportedLanguagesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_GetLanguage: { if (is_response) { command.reset( - new commands::VRGetLanguageResponse(message, application_manager)); + new commands::VRGetLanguageResponse(message, application_manager_)); } else { command.reset( - new commands::VRGetLanguageRequest(message, application_manager)); + new commands::VRGetLanguageRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_GetCapabilities: { if (is_response) { command.reset(new commands::VRGetCapabilitiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VRGetCapabilitiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_IsReady: { if (is_response) { command.reset( - new commands::TTSIsReadyResponse(message, application_manager)); + new commands::TTSIsReadyResponse(message, application_manager_)); } else { command.reset( - new commands::TTSIsReadyRequest(message, application_manager)); + new commands::TTSIsReadyRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_ChangeRegistration: { if (is_response) { command.reset(new commands::TTSChangeRegistratioResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::TTSChangeRegistrationRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_GetSupportedLanguages: { if (is_response) { command.reset(new commands::TTSGetSupportedLanguagesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::TTSGetSupportedLanguagesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_StopSpeaking: { if (is_response) { command.reset(new commands::TTSStopSpeakingResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::TTSStopSpeakingRequest(message, application_manager)); + command.reset(new commands::TTSStopSpeakingRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_GetLanguage: { if (is_response) { - command.reset( - new commands::TTSGetLanguageResponse(message, application_manager)); + command.reset(new commands::TTSGetLanguageResponse( + message, application_manager_)); } else { command.reset( - new commands::TTSGetLanguageRequest(message, application_manager)); + new commands::TTSGetLanguageRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_Speak: { if (is_response) { command.reset( - new commands::TTSSpeakResponse(message, application_manager)); + new commands::TTSSpeakResponse(message, application_manager_)); } else { command.reset( - new commands::TTSSpeakRequest(message, application_manager)); + new commands::TTSSpeakRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_SetGlobalProperties: { if (is_response) { command.reset(new commands::TTSSetGlobalPropertiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::TTSSetGlobalPropertiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_GetCapabilities: { if (is_response) { command.reset(new commands::TTSGetCapabilitiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::TTSGetCapabilitiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::TTS_Started: { - command.reset( - new commands::OnTTSStartedNotification(message, application_manager)); + command.reset(new commands::OnTTSStartedNotification( + message, application_manager_)); break; } case hmi_apis::FunctionID::TTS_Stopped: { - command.reset( - new commands::OnTTSStoppedNotification(message, application_manager)); + command.reset(new commands::OnTTSStoppedNotification( + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: { command.reset(new commands::OnAppActivatedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL: { command.reset( - new commands::OnAwakeSDLNotification(message, application_manager)); + new commands::OnAwakeSDLNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: { command.reset(new commands::OnExitApplicationNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_Show: { if (is_response) { command.reset( - new commands::UIShowResponse(message, application_manager)); + new commands::UIShowResponse(message, application_manager_)); } else { command.reset( - new commands::UIShowRequest(message, application_manager)); + new commands::UIShowRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_Slider: { if (is_response) { command.reset( - new commands::UISliderResponse(message, application_manager)); + new commands::UISliderResponse(message, application_manager_)); } else { command.reset( - new commands::UISliderRequest(message, application_manager)); + new commands::UISliderRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_ClosePopUp: { if (is_response) { command.reset( - new commands::ClosePopupResponse(message, application_manager)); + new commands::ClosePopupResponse(message, application_manager_)); } else { command.reset( - new commands::ClosePopupRequest(message, application_manager)); + new commands::ClosePopupRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_IsReady: { if (is_response) { command.reset( - new commands::UIIsReadyResponse(message, application_manager)); + new commands::UIIsReadyResponse(message, application_manager_)); } else { command.reset( - new commands::UIIsReadyRequest(message, application_manager)); + new commands::UIIsReadyRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VehicleInfo_IsReady: { if (is_response) { command.reset( - new commands::VIIsReadyResponse(message, application_manager)); + new commands::VIIsReadyResponse(message, application_manager_)); } else { command.reset( - new commands::VIIsReadyRequest(message, application_manager)); + new commands::VIIsReadyRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VehicleInfo_ReadDID: { if (is_response) { command.reset( - new commands::VIReadDIDResponse(message, application_manager)); + new commands::VIReadDIDResponse(message, application_manager_)); } else { command.reset( - new commands::VIReadDIDRequest(message, application_manager)); + new commands::VIReadDIDRequest(message, application_manager_)); } break; } @@ -859,286 +862,286 @@ CommandSharedPtr HMICommandFactory::CreateCommand( case hmi_apis::FunctionID::VehicleInfo_GetGpsData: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< - hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message, - application_manager)); + hmi_apis::FunctionID::VehicleInfo_GetGpsData>( + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< - hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message, - application_manager)); + hmi_apis::FunctionID::VehicleInfo_GetGpsData>( + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetSpeed: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message, - application_manager)); + application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message, - application_manager)); + application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetRpm: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetRpm>(message, - application_manager)); + application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetRpm>(message, - application_manager)); + application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetPrndl: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message, - application_manager)); + application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message, - application_manager)); + application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetVin: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetVin>(message, - application_manager)); + application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetVin>(message, - application_manager)); + application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetTirePressure>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetTirePressure>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetOdometer: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetOdometer>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetOdometer>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetECallInfo>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetECallInfo>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_GetMyKey: { if (is_response) command.reset(new commands::VIGetVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message, - application_manager)); + application_manager_)); else command.reset(new commands::VIGetVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message, - application_manager)); + application_manager_)); break; } #else case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: { if (is_response) { command.reset(new commands::VIGetVehicleDataResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VIGetVehicleDataRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -1146,146 +1149,146 @@ CommandSharedPtr HMICommandFactory::CreateCommand( case hmi_apis::FunctionID::VehicleInfo_GetDTCs: { if (is_response) { command.reset( - new commands::VIGetDTCsResponse(message, application_manager)); + new commands::VIGetDTCsResponse(message, application_manager_)); } else { command.reset( - new commands::VIGetDTCsRequest(message, application_manager)); + new commands::VIGetDTCsRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: { if (is_response) { command.reset(new commands::VIDiagnosticMessageResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VIDiagnosticMessageRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::VehicleInfo_GetVehicleType: { if (is_response) { command.reset(new commands::VIGetVehicleTypeResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VIGetVehicleTypeRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_IsReady: { if (is_response) { command.reset( - new commands::NaviIsReadyResponse(message, application_manager)); + new commands::NaviIsReadyResponse(message, application_manager_)); } else { command.reset( - new commands::NaviIsReadyRequest(message, application_manager)); + new commands::NaviIsReadyRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_AlertManeuver: { if (is_response) { command.reset(new commands::NaviAlertManeuverResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviAlertManeuverRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_GetWayPoints: { if (is_response) { command.reset(new commands::NaviGetWayPointsResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviGetWayPointsRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_UpdateTurnList: { if (is_response) { command.reset(new commands::NaviUpdateTurnListResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviUpdateTurnListRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_ShowConstantTBT: { if (is_response) { command.reset(new commands::NaviShowConstantTBTResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviShowConstantTBTRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: { if (is_response) { command.reset(new commands::NaviSubscribeWayPointsResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviSubscribeWayPointsRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: { if (is_response) { command.reset(new commands::NaviUnsubscribeWayPointsResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviUnSubscribeWayPointsRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Buttons_GetCapabilities: { if (is_response) { command.reset(new commands::ButtonGetCapabilitiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::ButtonGetCapabilitiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: { command.reset(new commands::OnAllowSDLFunctionalityNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: { command.reset(new commands::OnSDLConsentNeededNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_UpdateSDL: { if (is_response) { command.reset( - new commands::UpdateSDLResponse(message, application_manager)); + new commands::UpdateSDLResponse(message, application_manager_)); } else { command.reset( - new commands::UpdateSDLRequest(message, application_manager)); + new commands::UpdateSDLRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: { command.reset(new commands::OnIgnitionCycleOverNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: { command.reset(new commands::OnSystemInfoChangedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnReady: { command.reset( - new commands::OnReadyNotification(message, application_manager)); + new commands::OnReadyNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnSystemTimeReady: { @@ -1295,102 +1298,102 @@ CommandSharedPtr HMICommandFactory::CreateCommand( } case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: { command.reset(new commands::OnDeviceChosenNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnSystemContext: { command.reset(new commands::OnSystemContextNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnDriverDistraction: { command.reset(new commands::hmi::OnDriverDistractionNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: { command.reset( - new commands::OnUpdateDeviceList(message, application_manager)); + new commands::OnUpdateDeviceList(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: { command.reset(new commands::OnAppRegisteredNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: { command.reset(new commands::OnAppUnregisteredNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: { command.reset( - new commands::OnFindApplications(message, application_manager)); + new commands::OnFindApplications(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: { if (is_response) { command.reset( - new commands::UpdateAppListResponse(message, application_manager)); + new commands::UpdateAppListResponse(message, application_manager_)); } else { command.reset( - new commands::UpdateAppListRequest(message, application_manager)); + new commands::UpdateAppListRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::VR_Started: { command.reset( - new commands::OnVRStartedNotification(message, application_manager)); + new commands::OnVRStartedNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VR_Stopped: { command.reset( - new commands::OnVRStoppedNotification(message, application_manager)); + new commands::OnVRStoppedNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VR_OnCommand: { command.reset( - new commands::OnVRCommandNotification(message, application_manager)); + new commands::OnVRCommandNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnCommand: { command.reset( - new commands::OnUICommandNotification(message, application_manager)); + new commands::OnUICommandNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: { command.reset(new commands::OnAppDeactivatedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnLanguageChange: { command.reset(new commands::OnUILanguageChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VR_OnLanguageChange: { command.reset(new commands::OnVRLanguageChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::TTS_OnLanguageChange: { command.reset(new commands::OnTTSLanguageChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::Buttons_OnButtonEvent: { command.reset(new commands::hmi::OnButtonEventNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::Buttons_OnButtonPress: { command.reset(new commands::hmi::OnButtonPressNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::Buttons_OnButtonSubscription: { command.reset(new commands::hmi::OnButtonSubscriptionNotification( - message, application_manager)); + message, application_manager_)); break; } #ifdef HMI_DBUS_API @@ -1398,285 +1401,285 @@ CommandSharedPtr HMICommandFactory::CreateCommand( if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeGps>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeGps>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeVin>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeVin>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: { if (is_response) command.reset(new commands::VISubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VISubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>( - message, application_manager)); + message, application_manager_)); break; } #else case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: { if (is_response) { command.reset(new commands::VISubscribeVehicleDataResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VISubscribeVehicleDataRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -1686,55 +1689,55 @@ CommandSharedPtr HMICommandFactory::CreateCommand( if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: { @@ -1742,231 +1745,231 @@ CommandSharedPtr HMICommandFactory::CreateCommand( command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID:: VehicleInfo_UnsubscribeInstantFuelConsumption>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID:: VehicleInfo_UnsubscribeInstantFuelConsumption>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: { if (is_response) command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>( - message, application_manager)); + message, application_manager_)); else command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>( - message, application_manager)); + message, application_manager_)); break; } #else case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData: { if (is_response) { command.reset(new commands::VIUnsubscribeVehicleDataResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VIUnsubscribeVehicleDataRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -1974,258 +1977,258 @@ CommandSharedPtr HMICommandFactory::CreateCommand( #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_OnGpsData: { command.reset( - new commands::OnVIGpsDataNotification(message, application_manager)); + new commands::OnVIGpsDataNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnSpeed: { command.reset( - new commands::OnVISpeedNotification(message, application_manager)); + new commands::OnVISpeedNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnRpm: { command.reset( - new commands::OnVIRpmNotification(message, application_manager)); + new commands::OnVIRpmNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: { command.reset(new commands::OnVIFuelLevelNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: { command.reset(new commands::OnVIFuelLevelStateNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: { command.reset(new commands::OnVIInstantFuelConsumptionNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: { command.reset(new commands::OnVIExternalTemperatureNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnVin: { command.reset( - new commands::OnVIVinNotification(message, application_manager)); + new commands::OnVIVinNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnPrndl: { command.reset( - new commands::OnVIPrndlNotification(message, application_manager)); + new commands::OnVIPrndlNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: { command.reset(new commands::OnVITirePressureNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnOdometer: { - command.reset( - new commands::OnVIOdometerNotification(message, application_manager)); + command.reset(new commands::OnVIOdometerNotification( + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: { command.reset(new commands::OnVIBeltStatusNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: { command.reset(new commands::OnVIBodyInformationNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: { command.reset(new commands::OnVIDeviceStatusNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: { command.reset(new commands::OnVIDriverBrakingNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: { command.reset(new commands::OnVIWiperStatusNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: { command.reset(new commands::OnVIHeadLampStatusNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: { command.reset(new commands::OnVIEngineTorqueNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: { command.reset(new commands::OnVIAccPedalPositionNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: { command.reset(new commands::OnVISteeringWheelAngleNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VehicleInfo_OnMyKey: { command.reset( - new commands::OnVIMyKeyNotification(message, application_manager)); + new commands::OnVIMyKeyNotification(message, application_manager_)); break; } #else case hmi_apis::FunctionID::VehicleInfo_OnVehicleData: { command.reset(new commands::OnVIVehicleDataNotification( - message, application_manager)); + message, application_manager_)); break; } #endif // #ifdef HMI_DBUS_API case hmi_apis::FunctionID::Navigation_OnTBTClientState: { command.reset(new commands::OnNaviTBTClientStateNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnKeyboardInput: { command.reset(new commands::hmi::OnUIKeyBoardInputNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnTouchEvent: { command.reset(new commands::hmi::OnUITouchEventNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnResetTimeout: { command.reset(new commands::hmi::OnUIResetTimeoutNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::Navigation_SetVideoConfig: { if (is_response) { command.reset(new commands::NaviSetVideoConfigResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviSetVideoConfigRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_StartStream: { if (is_response) { command.reset(new commands::NaviStartStreamResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::NaviStartStreamRequest(message, application_manager)); + command.reset(new commands::NaviStartStreamRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_StopStream: { if (is_response) { - command.reset( - new commands::NaviStopStreamResponse(message, application_manager)); + command.reset(new commands::NaviStopStreamResponse( + message, application_manager_)); } else { command.reset( - new commands::NaviStopStreamRequest(message, application_manager)); + new commands::NaviStopStreamRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_StartAudioStream: { if (is_response) { command.reset(new commands::AudioStartStreamResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::AudioStartStreamRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_StopAudioStream: { if (is_response) { command.reset(new commands::AudioStopStreamResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::AudioStopStreamRequest(message, application_manager)); + command.reset(new commands::AudioStopStreamRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: { command.reset(new commands::OnAudioDataStreamingNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: { command.reset(new commands::OnVideoDataStreamingNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::VR_PerformInteraction: { if (is_response) { command.reset(new commands::VRPerformInteractionResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::VRPerformInteractionRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: { command.reset(new commands::OnSystemRequestNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnPutFile: { command.reset( - new commands::OnPutFileNotification(message, application_manager)); + new commands::OnPutFileNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: { command.reset(new commands::OnResumeAudioSourceNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_SetDisplayLayout: { if (is_response) { command.reset(new commands::UiSetDisplayLayoutResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UiSetDisplayLayoutRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: { command.reset( - new commands::OnSDLCloseNotification(message, application_manager)); + new commands::OnSDLCloseNotification(message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: { command.reset(new commands::OnSDLPersistenceCompleteNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: { command.reset(new commands::OnFileRemovedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::UI_OnRecordStart: { command.reset(new commands::OnRecordStartdNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_SystemRequest: { if (is_response) { command.reset(new commands::BasicCommunicationSystemResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::BasicCommunicationSystemRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -2242,89 +2245,90 @@ CommandSharedPtr HMICommandFactory::CreateCommand( case hmi_apis::FunctionID::Navigation_SendLocation: { if (is_response) { command.reset(new commands::NaviSendLocationResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::NaviSendLocationRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::SDL_AddStatisticsInfo: { command.reset(new commands::AddStatisticsInfoNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_OnSystemError: { command.reset(new commands::OnSystemErrorNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: { command.reset( - new commands::OnReceivedPolicyUpdate(message, application_manager)); + new commands::OnReceivedPolicyUpdate(message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_OnPolicyUpdate: { - command.reset(new commands::OnPolicyUpdate(message, application_manager)); + command.reset( + new commands::OnPolicyUpdate(message, application_manager_)); break; } case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: { command.reset(new commands::OnDeviceStateChangedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::TTS_OnResetTimeout: { command.reset(new commands::hmi::OnTTSResetTimeoutNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: { command.reset(new commands::OnEventChangedNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::BasicCommunication_DialNumber: { if (is_response) { command.reset(new commands::hmi::DialNumberResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::hmi::DialNumberRequest(message, application_manager)); + command.reset(new commands::hmi::DialNumberRequest( + message, application_manager_)); } break; } case hmi_apis::FunctionID::Navigation_OnWayPointChange: { command.reset(new commands::OnNaviWayPointChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case hmi_apis::FunctionID::RC_IsReady: { if (is_response) { command.reset( - new commands::RCIsReadyResponse(message, application_manager)); + new commands::RCIsReadyResponse(message, application_manager_)); } else { command.reset( - new commands::RCIsReadyRequest(message, application_manager)); + new commands::RCIsReadyRequest(message, application_manager_)); } break; } case hmi_apis::FunctionID::RC_GetCapabilities: { if (is_response) { command.reset(new commands::RCGetCapabilitiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::RCGetCapabilitiesRequest( - message, application_manager)); + message, application_manager_)); } break; } case hmi_apis::FunctionID::UI_SendHapticData: { if (is_response) { command.reset(new commands::UISendHapticDataResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UISendHapticDataRequest( - message, application_manager)); + message, application_manager_)); } break; } diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc index 08ce26360e..ce8514010f 100644 --- a/src/components/application_manager/src/hmi_language_handler.cc +++ b/src/components/application_manager/src/hmi_language_handler.cc @@ -238,7 +238,7 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile( message[strings::msg_params][strings::language] = hmi_capabilities.active_vr_language(); if (application_manager_.GetRPCService().ManageMobileCommand( - notification, commands::Command::ORIGIN_SDL)) { + notification, commands::Command::SOURCE_SDL)) { LOG4CXX_INFO(logger_, "Mobile command sent"); } else { LOG4CXX_WARN(logger_, "Cannot send mobile command"); @@ -311,7 +311,7 @@ void HMILanguageHandler::HandleWrongLanguageApp(const Apps::value_type& app) { MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app.first, mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.UnregisterApplication( app.first, mobile_apis::Result::SUCCESS, false); LOG4CXX_INFO(logger_, 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 5eaa5a10fa..ceb8aaaa92 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -394,7 +394,7 @@ void MessageHelper::SendHashUpdateNotification(const uint32_t app_id, smart_objects::SmartObjectSPtr so = CreateHashUpdateNotification(app_id); PrintSmartObject(*so); if (!app_mngr.GetRPCService().ManageMobileCommand( - so, commands::Command::ORIGIN_SDL)) { + so, commands::Command::SOURCE_SDL)) { LOG4CXX_ERROR(logger_, "Failed to send HashUpdate notification."); return; } @@ -768,7 +768,7 @@ void MessageHelper::SendHMIStatusNotification( static_cast<int32_t>(application_impl.system_context()); application_manager.GetRPCService().ManageMobileCommand( - notification, commands::Command::ORIGIN_SDL); + notification, commands::Command::SOURCE_SDL); } void MessageHelper::SendActivateAppToHMI( @@ -2386,7 +2386,7 @@ void MessageHelper::SendSystemRequestNotification( DCHECK(app_mngr.GetRPCService().ManageMobileCommand( utils::MakeShared<smart_objects::SmartObject>(content), - commands::Command::ORIGIN_SDL)); + commands::Command::SOURCE_SDL)); } void MessageHelper::SendLaunchApp(const uint32_t connection_key, @@ -2554,7 +2554,7 @@ void MessageHelper::SendOnPermissionsChangeNotification( app_mngr.GetRPCService().ManageMobileCommand( utils::MakeShared<smart_objects::SmartObject>(content), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); } void MessageHelper::FillAppRevokedPermissions( diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index f6f9cab7f5..18e130b78e 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -143,24 +143,33 @@ #include "interfaces/MOBILE_API.h" #include "utils/make_shared.h" +CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace application_manager { +MobileCommandFactory::MobileCommandFactory( + ApplicationManager& application_manager) + : application_manager_(application_manager) {} + CommandSharedPtr MobileCommandFactory::CreateCommand( const commands::MessageSharedPtr& message, - commands::Command::CommandOrigin origin, - ApplicationManager& application_manager) { + commands::Command::CommandSource source) { CommandSharedPtr command; + const int function_id = + (*message)[strings::params][strings::function_id].asInt(); + LOG4CXX_DEBUG( + logger_, + "MobileCommandFactory::CreateCommand function_id: " << function_id); - switch ((*message)[strings::params][strings::function_id].asInt()) { + switch (function_id) { case mobile_apis::FunctionID::RegisterAppInterfaceID: { if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kRequest)) { command.reset(new commands::RegisterAppInterfaceRequest( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::RegisterAppInterfaceResponse( - message, application_manager)); + message, application_manager_)); } break; } @@ -168,10 +177,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kRequest)) { command.reset(new commands::UnregisterAppInterfaceRequest( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UnregisterAppInterfaceResponse( - message, application_manager)); + message, application_manager_)); } break; } @@ -179,10 +188,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::SetGlobalPropertiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::SetGlobalPropertiesRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -190,10 +199,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::ResetGlobalPropertiesResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::ResetGlobalPropertiesRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -201,10 +210,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::AddCommandResponse(message, application_manager)); + new commands::AddCommandResponse(message, application_manager_)); } else { command.reset( - new commands::AddCommandRequest(message, application_manager)); + new commands::AddCommandRequest(message, application_manager_)); } break; } @@ -212,10 +221,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::DeleteCommandResponse(message, application_manager)); + new commands::DeleteCommandResponse(message, application_manager_)); } else { command.reset( - new commands::DeleteCommandRequest(message, application_manager)); + new commands::DeleteCommandRequest(message, application_manager_)); } break; } @@ -223,10 +232,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::AddSubMenuResponse(message, application_manager)); + new commands::AddSubMenuResponse(message, application_manager_)); } else { command.reset( - new commands::AddSubMenuRequest(message, application_manager)); + new commands::AddSubMenuRequest(message, application_manager_)); } break; } @@ -234,10 +243,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::DeleteSubMenuResponse(message, application_manager)); + new commands::DeleteSubMenuResponse(message, application_manager_)); } else { command.reset( - new commands::DeleteSubMenuRequest(message, application_manager)); + new commands::DeleteSubMenuRequest(message, application_manager_)); } break; } @@ -245,10 +254,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::DeleteInteractionChoiceSetResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::DeleteInteractionChoiceSetRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -256,9 +265,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::AlertResponse(message, application_manager)); + new commands::AlertResponse(message, application_manager_)); } else { - command.reset(new commands::AlertRequest(message, application_manager)); + command.reset( + new commands::AlertRequest(message, application_manager_)); } break; } @@ -266,9 +276,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::SpeakResponse(message, application_manager)); + new commands::SpeakResponse(message, application_manager_)); } else { - command.reset(new commands::SpeakRequest(message, application_manager)); + command.reset( + new commands::SpeakRequest(message, application_manager_)); } break; } @@ -276,10 +287,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::SliderResponse(message, application_manager)); + new commands::SliderResponse(message, application_manager_)); } else { command.reset( - new commands::SliderRequest(message, application_manager)); + new commands::SliderRequest(message, application_manager_)); } break; } @@ -287,10 +298,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::PerformAudioPassThruResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::PerformAudioPassThruRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -298,10 +309,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::CreateInteractionChoiceSetResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::CreateInteractionChoiceSetRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -309,10 +320,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::PerformInteractionResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::PerformInteractionRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -320,10 +331,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::EndAudioPassThruResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::EndAudioPassThruRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -331,10 +342,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::PutFileResponse(message, application_manager)); + new commands::PutFileResponse(message, application_manager_)); } else { command.reset( - new commands::PutFileRequest(message, application_manager)); + new commands::PutFileRequest(message, application_manager_)); } break; } @@ -342,10 +353,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::DeleteFileResponse(message, application_manager)); + new commands::DeleteFileResponse(message, application_manager_)); } else { command.reset( - new commands::DeleteFileRequest(message, application_manager)); + new commands::DeleteFileRequest(message, application_manager_)); } break; } @@ -353,10 +364,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::ListFilesResponse(message, application_manager)); + new commands::ListFilesResponse(message, application_manager_)); } else { command.reset( - new commands::ListFilesRequest(message, application_manager)); + new commands::ListFilesRequest(message, application_manager_)); } break; } @@ -364,10 +375,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::SubscribeButtonResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::SubscribeButtonRequest(message, application_manager)); + command.reset(new commands::SubscribeButtonRequest( + message, application_manager_)); } break; } @@ -375,10 +386,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::UnsubscribeButtonResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UnsubscribeButtonRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -386,19 +397,20 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::ShowConstantTBTResponse( - message, application_manager)); + message, application_manager_)); } else { - command.reset( - new commands::ShowConstantTBTRequest(message, application_manager)); + command.reset(new commands::ShowConstantTBTRequest( + message, application_manager_)); } break; } case mobile_apis::FunctionID::ShowID: { if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ShowResponse(message, application_manager)); + command.reset( + new commands::ShowResponse(message, application_manager_)); } else { - command.reset(new commands::ShowRequest(message, application_manager)); + command.reset(new commands::ShowRequest(message, application_manager_)); } break; } @@ -406,10 +418,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command = utils::MakeShared<commands::GetWayPointsResponse>( - message, application_manager); + message, application_manager_); } else { command = utils::MakeShared<commands::GetWayPointsRequest>( - message, application_manager); + message, application_manager_); } break; } @@ -417,10 +429,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::SubscribeVehicleDataResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::SubscribeVehicleDataRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -428,10 +440,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::UnsubscribeVehicleDataResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::UnsubscribeVehicleDataRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -439,10 +451,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command = utils::MakeShared<commands::SubscribeWayPointsResponse>( - message, application_manager); + message, application_manager_); } else { command = utils::MakeShared<commands::SubscribeWayPointsRequest>( - message, application_manager); + message, application_manager_); } break; } @@ -450,10 +462,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command = utils::MakeShared<commands::UnsubscribeWayPointsResponse>( - message, application_manager); + message, application_manager_); } else { command = utils::MakeShared<commands::UnSubscribeWayPointsRequest>( - message, application_manager); + message, application_manager_); } break; } @@ -461,10 +473,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::GetSystemCapabilityResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::GetSystemCapabilityRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -472,21 +484,21 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::ReadDIDResponse(message, application_manager)); + new commands::ReadDIDResponse(message, application_manager_)); } else { command.reset( - new commands::ReadDIDRequest(message, application_manager)); + new commands::ReadDIDRequest(message, application_manager_)); } break; } case mobile_apis::FunctionID::GetVehicleDataID: { if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset( - new commands::GetVehicleDataResponse(message, application_manager)); + command.reset(new commands::GetVehicleDataResponse( + message, application_manager_)); } else { command.reset( - new commands::GetVehicleDataRequest(message, application_manager)); + new commands::GetVehicleDataRequest(message, application_manager_)); } break; } @@ -494,10 +506,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::ScrollableMessageResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::ScrollableMessageRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -505,10 +517,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::AlertManeuverResponse(message, application_manager)); + new commands::AlertManeuverResponse(message, application_manager_)); } else { command.reset( - new commands::AlertManeuverRequest(message, application_manager)); + new commands::AlertManeuverRequest(message, application_manager_)); } break; } @@ -516,10 +528,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::SetAppIconResponse(message, application_manager)); + new commands::SetAppIconResponse(message, application_manager_)); } else { command.reset( - new commands::SetAppIconRequest(message, application_manager)); + new commands::SetAppIconRequest(message, application_manager_)); } break; } @@ -527,21 +539,21 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::SetDisplayLayoutResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::SetDisplayLayoutRequest( - message, application_manager)); + message, application_manager_)); } break; } case mobile_apis::FunctionID::UpdateTurnListID: { if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset( - new commands::UpdateTurnListResponse(message, application_manager)); + command.reset(new commands::UpdateTurnListResponse( + message, application_manager_)); } else { command.reset( - new commands::UpdateTurnListRequest(message, application_manager)); + new commands::UpdateTurnListRequest(message, application_manager_)); } break; } @@ -549,10 +561,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::ChangeRegistrationResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::ChangeRegistrationRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -560,10 +572,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::GetDTCsResponse(message, application_manager)); + new commands::GetDTCsResponse(message, application_manager_)); } else { command.reset( - new commands::GetDTCsRequest(message, application_manager)); + new commands::GetDTCsRequest(message, application_manager_)); } break; } @@ -571,10 +583,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::DiagnosticMessageResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::DiagnosticMessageRequest( - message, application_manager)); + message, application_manager_)); } break; } @@ -582,10 +594,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::SetMediaClockTimerResponse( - message, application_manager)); + message, application_manager_)); } else { command.reset( - new commands::SetMediaClockRequest(message, application_manager)); + new commands::SetMediaClockRequest(message, application_manager_)); } break; } @@ -593,10 +605,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::SystemResponse(message, application_manager)); + new commands::SystemResponse(message, application_manager_)); } else { command.reset( - new commands::SystemRequest(message, application_manager)); + new commands::SystemRequest(message, application_manager_)); } break; } @@ -604,10 +616,10 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::SendLocationResponse(message, application_manager)); + new commands::SendLocationResponse(message, application_manager_)); } else { command.reset( - new commands::SendLocationRequest(message, application_manager)); + new commands::SendLocationRequest(message, application_manager_)); } break; } @@ -615,114 +627,114 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { command.reset( - new commands::DialNumberResponse(message, application_manager)); + new commands::DialNumberResponse(message, application_manager_)); } else { command.reset( - new commands::DialNumberRequest(message, application_manager)); + new commands::DialNumberRequest(message, application_manager_)); } break; } case mobile_apis::FunctionID::SendHapticDataID: { if ((*message)[strings::params][strings::message_type] == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset( - new commands::SendHapticDataResponse(message, application_manager)); + command.reset(new commands::SendHapticDataResponse( + message, application_manager_)); } else { command.reset( - new commands::SendHapticDataRequest(message, application_manager)); + new commands::SendHapticDataRequest(message, application_manager_)); } break; } case mobile_apis::FunctionID::OnButtonEventID: { command.reset(new commands::mobile::OnButtonEventNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnButtonPressID: { command.reset(new commands::mobile::OnButtonPressNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnAudioPassThruID: { command.reset(new commands::OnAudioPassThruNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnVehicleDataID: { command.reset(new commands::OnVehicleDataNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: { command.reset(new commands::OnAppInterfaceUnregisteredNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnCommandID: { command.reset( - new commands::OnCommandNotification(message, application_manager)); + new commands::OnCommandNotification(message, application_manager_)); break; } case mobile_apis::FunctionID::OnTBTClientStateID: { command.reset(new commands::OnTBTClientStateNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnDriverDistractionID: { command.reset(new commands::mobile::OnDriverDistractionNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnLanguageChangeID: { command.reset(new commands::OnLanguageChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnPermissionsChangeID: { command.reset(new commands::OnPermissionsChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnHMIStatusID: { - if (commands::Command::ORIGIN_SDL == origin) { + if (commands::Command::SOURCE_SDL == source) { command.reset(new commands::OnHMIStatusNotification( - message, application_manager)); + message, application_manager_)); } else { command.reset(new commands::OnHMIStatusNotificationFromMobile( - message, application_manager)); + message, application_manager_)); } break; } case mobile_apis::FunctionID::OnKeyboardInputID: { command.reset(new commands::mobile::OnKeyBoardInputNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnTouchEventID: { command.reset(new commands::mobile::OnTouchEventNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnSystemRequestID: { command.reset(new commands::mobile::OnSystemRequestNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnHashChangeID: { command.reset(new commands::mobile::OnHashChangeNotification( - message, application_manager)); + message, application_manager_)); break; } case mobile_apis::FunctionID::OnWayPointChangeID: { command = utils::MakeShared<commands::OnWayPointChangeNotification>( - message, application_manager); + message, application_manager_); break; } default: { (*message)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::GenericResponseID); command.reset( - new commands::GenericResponse(message, application_manager)); + new commands::GenericResponse(message, application_manager_)); } } return command; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 964e17d8a5..d13dcec7a7 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1023,7 +1023,7 @@ void PolicyHandler::OnPendingPermissionChange( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app->app_id(), mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); application_manager_.OnAppUnauthorized(app->app_id()); diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc index af03e704eb..138e0e3ac3 100644 --- a/src/components/application_manager/src/rpc_handler_impl.cc +++ b/src/components/application_manager/src/rpc_handler_impl.cc @@ -79,7 +79,7 @@ void RPCHandlerImpl::ProcessMessageFromMobile( #endif // TELEMETRY_MONITOR if (!app_manager_.GetRPCService().ManageMobileCommand( - so_from_mobile, commands::Command::ORIGIN_MOBILE)) { + so_from_mobile, commands::Command::SOURCE_MOBILE)) { LOG4CXX_ERROR(logger_, "Received command didn't run successfully"); } #ifdef TELEMETRY_MONITOR @@ -215,6 +215,7 @@ void RPCHandlerImpl::OnErrorSending( void RPCHandlerImpl::SetTelemetryObserver(AMTelemetryObserver* observer) { metric_observer_ = observer; } + #endif // TELEMETRY_MONITOR bool RPCHandlerImpl::ConvertMessageToSO( @@ -251,7 +252,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( message.correlation_id(), mobile_apis::Result::INVALID_DATA)); app_manager_.GetRPCService().ManageMobileCommand( - response, commands::Command::ORIGIN_SDL); + response, commands::Command::SOURCE_SDL); return false; } LOG4CXX_DEBUG(logger_, @@ -276,7 +277,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( message.correlation_id(), mobile_apis::Result::INVALID_DATA)); app_manager_.GetRPCService().ManageMobileCommand( - response, commands::Command::ORIGIN_SDL); + response, commands::Command::SOURCE_SDL); return false; } output[strings::params][strings::binary_data] = diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index 3be10a75f8..169bab97df 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -59,7 +59,7 @@ RPCServiceImpl::~RPCServiceImpl() {} bool RPCServiceImpl::ManageMobileCommand( const commands::MessageSharedPtr message, - commands::Command::CommandOrigin origin) { + commands::Command::CommandSource source) { LOG4CXX_AUTO_TRACE(logger_); if (!message) { @@ -77,7 +77,7 @@ bool RPCServiceImpl::ManageMobileCommand( LOG4CXX_DEBUG(logger_, "Trying to create message in mobile factory."); utils::SharedPtr<commands::Command> command( - MobileCommandFactory::CreateCommand(message, origin, app_manager_)); + app_manager_.GetCommandFactory().CreateCommand(message, source)); if (!command) { LOG4CXX_WARN(logger_, @@ -196,7 +196,7 @@ bool RPCServiceImpl::ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( connection_key, mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); app_manager_.UnregisterApplication( connection_key, @@ -218,7 +218,7 @@ bool RPCServiceImpl::ManageMobileCommand( connection_key, mobile_api::AppInterfaceUnregisteredReason:: REQUEST_WHILE_IN_NONE_HMI_LEVEL), - commands::Command::ORIGIN_SDL); + commands::Command::SOURCE_SDL); ApplicationSharedPtr app_ptr = app_manager_.application(connection_key); if (app_ptr) { @@ -254,8 +254,8 @@ bool RPCServiceImpl::ManageHMICommand( MessageHelper::PrintSmartObject(*message); - CommandSharedPtr command = - HMICommandFactory::CreateCommand(message, app_manager_); + CommandSharedPtr command = app_manager_.GetCommandFactory().CreateCommand( + message, commands::Command::SOURCE_HMI); if (!command) { LOG4CXX_WARN(logger_, "Failed to create command from smart object"); return false; diff --git a/src/components/application_manager/src/sdl_command_factory.cc b/src/components/application_manager/src/sdl_command_factory.cc new file mode 100644 index 0000000000..392d14c320 --- /dev/null +++ b/src/components/application_manager/src/sdl_command_factory.cc @@ -0,0 +1,65 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Copyright (c) 2017 Xevo Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the copyright holders nor the names of their contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/sdl_command_factory.h" +#include "application_manager/hmi_command_factory.h" +#include "application_manager/mobile_command_factory.h" + +namespace application_manager { + +SDLCommandFactory::SDLCommandFactory( + ApplicationManager& app_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : app_manager_(app_manager) + , rpc_service_(rpc_service) + , hmi_capabilities_(hmi_capabilities) + , policy_handler_(policy_handler) { + hmi_command_factory_.reset(new HMICommandFactory(app_manager)); + mobile_command_factory_.reset(new MobileCommandFactory(app_manager)); +} + +CommandSharedPtr SDLCommandFactory::CreateCommand( + const commands::MessageSharedPtr& message, + commands::Command::CommandSource source) { + if (commands::Command::SOURCE_HMI == source) { + return hmi_command_factory_->CreateCommand(message, source); + } else { + return mobile_command_factory_->CreateCommand(message, source); + } +} + +} // namespace application_manager diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc index 64d65111c7..484af75798 100644 --- a/src/components/application_manager/test/command_holder_test.cc +++ b/src/components/application_manager/test/command_holder_test.cc @@ -168,7 +168,7 @@ TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) { EXPECT_CALL( rpc_service_, ManageMobileCommand(cmd_ptr_, - am::commands::Command::CommandOrigin::ORIGIN_MOBILE)); + am::commands::Command::CommandSource::SOURCE_MOBILE)); cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kMobileCommand); } diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc index 448a752304..58861f109e 100644 --- a/src/components/application_manager/test/commands/command_request_impl_test.cc +++ b/src/components/application_manager/test/commands/command_request_impl_test.cc @@ -175,7 +175,7 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(dummy_msg, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(dummy_msg, Command::CommandOrigin::SOURCE_SDL)); command->onTimeOut(); diff --git a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc index 590b38325c..654c5af610 100644 --- a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc +++ b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc @@ -410,7 +410,7 @@ TYPED_TEST(HMIOnViNotifications, CommandsSendNotificationToMobile) { EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_, GetRPCService()) .WillOnce(ReturnRef(commands_test::CommandsTest<kIsNice>::rpc_service_)); EXPECT_CALL(commands_test::CommandsTest<kIsNice>::rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ( static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID), @@ -461,7 +461,7 @@ TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) { CreateCommand<hmi::OnButtonEventNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -475,7 +475,7 @@ TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) { CreateCommand<OnNaviTBTClientStateNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -490,7 +490,7 @@ TEST_F(HMICommandsNotificationsTest, CreateCommand<OnNaviWayPointChangeNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -504,7 +504,7 @@ TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) { CreateCommand<OnUICommandNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -522,7 +522,7 @@ TEST_F(HMICommandsNotificationsTest, CreateCommand<hmi::OnUIKeyBoardInputNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnKeyboardInputID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -536,7 +536,7 @@ TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) { CreateCommand<hmi::OnUITouchEventNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTouchEventID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -597,7 +597,7 @@ TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) { CreateCommand<hmi::OnButtonPressNotification>(message); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(app_mngr_, event_dispatcher()); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); @@ -1132,7 +1132,7 @@ TEST_F(HMICommandsNotificationsTest, kAppId_, *it_mobile_reason)).WillOnce(Return(notification)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(notification, Command::ORIGIN_SDL)); + ManageMobileCommand(notification, Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, UnregisterApplication( kAppId_, mobile_apis::Result::SUCCESS, false, false)); @@ -1362,7 +1362,7 @@ TEST_F(HMICommandsNotificationsTest, EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID), (*message)[am::strings::params][am::strings::function_id].asInt()); @@ -1410,7 +1410,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(ReturnRef(mock_hmi_capabilities_)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_)); EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang)); @@ -1457,7 +1457,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(ReturnRef(mock_hmi_capabilities_)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_)); EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang)); EXPECT_CALL(app_mngr_, state_controller()) @@ -1471,7 +1471,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(Return(notification)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(notification, Command::ORIGIN_SDL)); + ManageMobileCommand(notification, Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, UnregisterApplication( kAppId_, mobile_apis::Result::SUCCESS, false, false)); @@ -1629,7 +1629,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(Return(policy::kDeviceAllowed)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification), (*message)[am::strings::params][am::strings::message_type].asInt()); @@ -1683,7 +1683,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(Return(policy::kDeviceAllowed)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); command->Run(); EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification), (*message)[am::strings::params][am::strings::message_type].asInt()); @@ -1749,7 +1749,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(ReturnRef(mock_hmi_capabilities_)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_)); EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang)); @@ -1797,7 +1797,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(ReturnRef(mock_hmi_capabilities_)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_)); EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang)); EXPECT_CALL(mock_message_helper_, @@ -1807,7 +1807,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(Return(notification)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(notification, Command::ORIGIN_SDL)); + ManageMobileCommand(notification, Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, UnregisterApplication( kAppId_, mobile_apis::Result::SUCCESS, false, false)); @@ -1862,7 +1862,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(ReturnRef(mock_hmi_capabilities_)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_)); EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang)); @@ -1909,7 +1909,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(ReturnRef(mock_hmi_capabilities_)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_)); EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang)); EXPECT_CALL(mock_message_helper_, @@ -1919,7 +1919,7 @@ TEST_F(HMICommandsNotificationsTest, .WillOnce(Return(notification)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(notification, Command::ORIGIN_SDL)); + ManageMobileCommand(notification, Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, UnregisterApplication( kAppId_, mobile_apis::Result::SUCCESS, false, false)); @@ -1989,7 +1989,7 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) { .WillOnce(GetArg3(&result)); ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, Command::CommandOrigin::SOURCE_SDL)) .WillOnce(GetMessage(message)); EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_)); diff --git a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc index 9e6ac96d4a..372f213013 100644 --- a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc +++ b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc @@ -150,7 +150,7 @@ TEST_F(HMIOnDriverDistractionNotificationTest, ManageMobileCommand( CheckNotificationParams( am::mobile_api::FunctionID::OnDriverDistractionID, state), - Command::CommandOrigin::ORIGIN_SDL)); + Command::CommandOrigin::SOURCE_SDL)); command->Run(); } diff --git a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc index 1644893e0b..667636a94f 100644 --- a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc +++ b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc @@ -344,7 +344,7 @@ TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(CheckMsgType(am::MessageType::kNotification), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); command->SendNotificationToMobile(command_msg); } diff --git a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc index 6319464e81..800df613e0 100644 --- a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc @@ -214,7 +214,7 @@ class AddCommandRequestTest EXPECT_CALL( rpc_service_, ManageMobileCommand(response, - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); utils::SharedPtr<CommandRequestImpl> base_class_request = static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr); base_class_request->onTimeOut(); @@ -1060,7 +1060,7 @@ TEST_F(AddCommandRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, ManageMobileCommand( - response, am::commands::Command::CommandOrigin::ORIGIN_SDL)); + response, am::commands::Command::CommandOrigin::SOURCE_SDL)); utils::SharedPtr<CommandRequestImpl> base_class_request = static_cast<utils::SharedPtr<CommandRequestImpl> >( CreateCommand<AddCommandRequest>(msg_)); @@ -1112,7 +1112,7 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, ManageMobileCommand( - response, am::commands::Command::CommandOrigin::ORIGIN_SDL)); + response, am::commands::Command::CommandOrigin::SOURCE_SDL)); utils::SharedPtr<CommandRequestImpl> base_class_request = static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr); base_class_request->onTimeOut(); diff --git a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc index 86584d0ea9..9ed5e1dc4c 100644 --- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc @@ -94,7 +94,7 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->Init(); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc index 6ccdf855c1..f018def19c 100644 --- a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc @@ -93,7 +93,7 @@ class AlertManeuverRequestTest ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, ManageMobileCommand( - _, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + _, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc index 58fef38fbc..753f9906a2 100644 --- a/src/components/application_manager/test/commands/mobile/alert_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/alert_request_test.cc @@ -167,7 +167,7 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(code), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); } void ExpectManageHmiCommandTTSAndUI() { @@ -208,7 +208,7 @@ TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->onTimeOut(); @@ -254,7 +254,7 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) { MessageSharedPtr ui_command_result; EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc index fcc070625f..1058ff6888 100644 --- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc +++ b/src/components/application_manager/test/commands/mobile/change_registration_test.cc @@ -194,7 +194,7 @@ class ChangeRegistrationRequestTest ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, ManageMobileCommand( - _, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + _, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_ui); @@ -356,7 +356,7 @@ TEST_F(ChangeRegistrationRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_ui); @@ -405,7 +405,7 @@ TEST_F(ChangeRegistrationRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->Run(); @@ -549,7 +549,7 @@ TEST_F(ChangeRegistrationRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_vr); diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc index 223070b6af..1cc3d9f055 100644 --- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc @@ -183,7 +183,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true))); req_vr->onTimeOut(); @@ -240,7 +240,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true))); req_vr->on_event(event); @@ -623,7 +623,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, EXPECT_CALL(rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); command_->onTimeOut(); @@ -828,7 +828,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) { EXPECT_CALL(rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); event.set_smart_object(*message_); diff --git a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc index c6daa1c779..80b099e77e 100644 --- a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc @@ -186,7 +186,7 @@ TEST_F(DeleteCommandRequestTest, MessageSharedPtr vr_command_result; EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true))); command->on_event(event_vr); diff --git a/src/components/application_manager/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/test/commands/mobile/delete_file_test.cc index b263bb9718..b25264f191 100644 --- a/src/components/application_manager/test/commands/mobile/delete_file_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_file_test.cc @@ -122,7 +122,7 @@ TEST_F(DeleteFileRequestTest, Run_InvalidApp_UNSUCCESS) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(app_mngr_, get_settings()).Times(0); command_->Run(); @@ -147,7 +147,7 @@ TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::REJECTED), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); command_->Run(); } @@ -181,7 +181,7 @@ TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::SUCCESS), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); command_->Run(); } @@ -203,7 +203,7 @@ TEST_F(DeleteFileRequestTest, Run_InvalidFile_UNSUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); command_->Run(); } diff --git a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc index bb1a5c168b..ee70f32155 100644 --- a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc @@ -126,7 +126,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_, FindChoiceSet(_)).Times(0); command_->Run(); } @@ -145,7 +145,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)); command_->Run(); } @@ -175,7 +175,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_ChoiceSetInUse_SUCCESS) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)); + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)); command_->Run(); } diff --git a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc index 39d54aa442..098d6c980c 100644 --- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc @@ -153,7 +153,7 @@ TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); @@ -182,7 +182,7 @@ TEST_F(DeleteSubMenuRequestTest, Run_InvalidApp_UNSUCCESS) { rpc_service_, ManageMobileCommand(CheckMessageResultCode( mobile_apis::Result::APPLICATION_NOT_REGISTERED), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_, FindSubMenu(_)).Times(0); command_->Run(); } @@ -199,7 +199,7 @@ TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) { EXPECT_CALL(rpc_service_, ManageMobileCommand( CheckMessageResultCode(mobile_apis::Result::INVALID_ID), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); EXPECT_CALL(*app_, app_id()).Times(0); command_->Run(); } @@ -284,7 +284,7 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); EXPECT_CALL(*app_, UpdateHash()); DeleteSubMenuRequestPtr command = CreateCommand<DeleteSubMenuRequest>(message_); @@ -327,7 +327,7 @@ TEST_F(DeleteSubMenuRequestTest, EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command_->on_event(event); } @@ -354,7 +354,7 @@ TEST_F(DeleteSubMenuRequestTest, EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command_->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc index c2fe310d9a..8c8689affd 100644 --- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc @@ -90,7 +90,7 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); MockAppPtr app(CreateMockApp()); diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc index fab59fbed2..ef7a4f8be4 100644 --- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc +++ b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc @@ -182,7 +182,7 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true))); command->onTimeOut(); @@ -246,7 +246,7 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(rpc_service_, ManageHMICommand(_)).WillRepeatedly(Return(true)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); EXPECT_CALL(mock_message_helper_, @@ -823,7 +823,7 @@ TEST_F(PerformAudioPassThruRequestTest, // For setting current_state_ -> kCompleted ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)); + ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)); command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS); EXPECT_CALL( diff --git a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc index cc54b5b509..840649c549 100644 --- a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc +++ b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc @@ -137,7 +137,7 @@ TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true))); command->onTimeOut(); @@ -193,7 +193,7 @@ TEST_F(PerformInteractionRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_vr); @@ -242,7 +242,7 @@ TEST_F(PerformInteractionRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_vr); diff --git a/src/components/application_manager/test/commands/mobile/put_file_test.cc b/src/components/application_manager/test/commands/mobile/put_file_test.cc index 2406d094c0..c1f9df80ba 100644 --- a/src/components/application_manager/test/commands/mobile/put_file_test.cc +++ b/src/components/application_manager/test/commands/mobile/put_file_test.cc @@ -118,7 +118,7 @@ class PutFileRequestTest EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(code), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); } MessageSharedPtr msg_; diff --git a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc index 22c6dd77ab..e31f29202e 100644 --- a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc @@ -300,7 +300,7 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) { hmi_apis::FunctionID::Buttons_OnButtonSubscription))) .WillOnce(Return(true)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) .Times(2); command_->Run(); } @@ -413,7 +413,7 @@ TEST_F(RegisterAppInterfaceRequestTest, HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration))) .WillOnce(Return(true)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) .Times(2); command_->Run(); diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc index d450881af3..78f081464f 100644 --- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc @@ -113,7 +113,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidApp_UNSUCCESS) { MessageSharedPtr command_result; EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); command_->Run(); @@ -288,7 +288,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command_->on_event(event); } @@ -340,7 +340,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command_->on_event(event); } @@ -383,7 +383,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { EXPECT_CALL(rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); event.set_smart_object(*msg_); @@ -451,7 +451,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, rpc_service_, ManageMobileCommand( MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command->onTimeOut(); } @@ -514,7 +514,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, rpc_service_, ManageMobileCommand( MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command_->onTimeOut(); } @@ -567,7 +567,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, rpc_service_, ManageMobileCommand( MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command_->onTimeOut(); } diff --git a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc index 73f251d22f..e15054dbfb 100644 --- a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc +++ b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc @@ -154,7 +154,7 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc index 599952f27d..933cfa18a8 100644 --- a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc +++ b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc @@ -132,7 +132,7 @@ TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); (*msg_)[am::strings::msg_params] = 0; (*msg_)[am::strings::params][am::hmi_response::code] = diff --git a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc index 5ed7834238..5ff01d0b74 100644 --- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc @@ -147,7 +147,7 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); req_vr->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc index 997ffba269..67f35e4d1e 100644 --- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc @@ -159,7 +159,7 @@ TEST_F(SetDisplayLayoutRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); @@ -179,7 +179,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) { EXPECT_CALL(rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); command->Run(); } @@ -245,7 +245,7 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) { EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg)); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc index 90703c8eb0..57d3ec09de 100644 --- a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc @@ -186,7 +186,7 @@ class SetGlobalPropertiesRequestTest EXPECT_CALL(rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); } void ExpectVerifyImageVrHelpSuccess(SmartObject& smart_obj) { @@ -316,7 +316,7 @@ TEST_F(SetGlobalPropertiesRequestTest, MessageSharedPtr ui_command_result; EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); @@ -340,7 +340,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) { ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .Times(0); command->on_event(event); } @@ -369,7 +369,7 @@ TEST_F(SetGlobalPropertiesRequestTest, MessageSharedPtr response_to_mobile; EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->Run(); @@ -632,7 +632,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRCouldNotGenerate_INVALID_DATA) { EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), - am::commands::Command::ORIGIN_SDL)); + am::commands::Command::SOURCE_SDL)); command->Run(); } @@ -1084,7 +1084,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) { EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) .WillOnce(Return(true)); command->on_event(event); @@ -1116,7 +1116,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) { EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) .WillOnce(Return(true)); command->on_event(event); @@ -1187,7 +1187,7 @@ TEST_F(SetGlobalPropertiesRequestTest, EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) .WillOnce(Return(true)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -1223,7 +1223,7 @@ TEST_F(SetGlobalPropertiesRequestTest, MessageSharedPtr ui_command_result; EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); EXPECT_CALL(app_mngr_, application(kConnectionKey)) diff --git a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc index 49060d2624..2c54ce938b 100644 --- a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc @@ -137,7 +137,7 @@ TEST_F(SetMediaClockRequestTest, ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc index 7dcca02c42..29bf33c85d 100644 --- a/src/components/application_manager/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/test/commands/mobile/show_test.cc @@ -233,7 +233,7 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true))); command->on_event(event); @@ -706,7 +706,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc index 8f0dd36436..40cf3fc5f1 100644 --- a/src/components/application_manager/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/test/commands/mobile/slider_test.cc @@ -127,7 +127,7 @@ class SliderRequestTest EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(code), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); } sync_primitives::Lock lock_; @@ -162,7 +162,7 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); command->on_event(event); diff --git a/src/components/application_manager/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/test/commands/mobile/speak_request_test.cc index fc110b6fb3..ef053d0a67 100644 --- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/speak_request_test.cc @@ -110,7 +110,7 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, ManageMobileCommand( - _, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + _, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_tts); @@ -146,7 +146,7 @@ TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { ON_CALL(app_mngr_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL( rpc_service_, - ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + ManageMobileCommand(_, am::commands::Command::CommandOrigin::SOURCE_SDL)) .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true))); command->on_event(event_tts); diff --git a/src/components/application_manager/test/commands/mobile/system_request_test.cc b/src/components/application_manager/test/commands/mobile/system_request_test.cc index 87726526d1..aa332ab37a 100644 --- a/src/components/application_manager/test/commands/mobile/system_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/system_request_test.cc @@ -117,7 +117,7 @@ class SystemRequestTest EXPECT_CALL( rpc_service_, ManageMobileCommand(MobileResultCodeIs(code), - am::commands::Command::CommandOrigin::ORIGIN_SDL)); + am::commands::Command::CommandOrigin::SOURCE_SDL)); } MockAppPtr mock_app_; diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index 22469c4428..3c49892ab2 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -1012,7 +1012,7 @@ TEST_F(PolicyHandlerTest, .WillOnce(Return(message)); ON_CALL(app_manager_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, commands::Command::ORIGIN_SDL)); + ManageMobileCommand(_, commands::Command::SOURCE_SDL)); EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(kPolicyAppId_)); @@ -1065,7 +1065,7 @@ TEST_F(PolicyHandlerTest, .WillOnce(Return(message)); ON_CALL(app_manager_, GetRPCService()).WillByDefault(ReturnRef(rpc_service_)); EXPECT_CALL(rpc_service_, - ManageMobileCommand(_, commands::Command::ORIGIN_SDL)); + ManageMobileCommand(_, commands::Command::SOURCE_SDL)); EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(kPolicyAppId_)); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index ba76aac719..6a5eefed06 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -39,6 +39,7 @@ #include "application_manager/application.h" #include "application_manager/hmi_capabilities.h" #include "application_manager/commands/command.h" +#include "application_manager/command_factory.h" #include "connection_handler/connection_handler.h" #include "utils/data_accessor.h" #include "utils/shared_ptr.h" @@ -377,9 +378,11 @@ class ApplicationManager { virtual protocol_handler::ProtocolHandler& protocol_handler() const = 0; virtual policy::PolicyHandlerInterface& GetPolicyHandler() = 0; virtual const policy::PolicyHandlerInterface& GetPolicyHandler() const = 0; + virtual CommandFactory& GetCommandFactory() const = 0; virtual rpc_service::RPCService& GetRPCService() const = 0; virtual rpc_handler::RPCHandler& GetRPCHandler() const = 0; virtual bool is_stopping() const = 0; + virtual bool is_audio_pass_thru_active() const = 0; virtual uint32_t GetNextHMICorrelationID() = 0; virtual uint32_t GenerateNewHMIAppID() = 0; @@ -696,9 +699,6 @@ class ApplicationManager { mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::SystemContext::eType system_context) const = 0; - virtual void SendAudioPassThroughNotification( - uint32_t session_key, std::vector<uint8_t>& binary_data) = 0; - /** * @brief Checks if application can stream (streaming service is started and * streaming is enabled in application) diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h index 38a5fce6e5..9665cc1cf6 100644 --- a/src/components/include/application_manager/rpc_service.h +++ b/src/components/include/application_manager/rpc_service.h @@ -50,7 +50,7 @@ class RPCService { * @return true if command is executed, otherwise return false */ virtual bool ManageMobileCommand(const commands::MessageSharedPtr message, - commands::Command::CommandOrigin origin) = 0; + commands::Command::CommandSource source) = 0; /** * @brief ManageHMICommand convert message to HMI command and execute it * @param message pointer to received message diff --git a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h index 3645a9cb81..a246e468b7 100644 --- a/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h +++ b/src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h @@ -62,6 +62,12 @@ typedef enum { typedef enum { AT_INVALID = -1, AT_PCM = 0 } AudioType; +// AudioPassThru +typedef struct { + std::vector<uint8_t> binary_data; + int32_t session_key; +} AudioData; + /* * @brief AudioStreamSenderThread class used to read binary data written from * microphone @@ -104,6 +110,18 @@ class AudioStreamSenderThread : public threads::ThreadDelegate { */ bool SendEndAudioPassThru(); + /** + * @brief Creates AudioPassThru data chunk and inserts it + * to audio_pass_thru_messages_ + * + * @param session_key Id of application for which + * audio pass thru should be sent + * + * @param binary_data AudioPassThru data chunk + */ + void SendAudioPassThroughNotification(uint32_t session_key, + std::vector<uint8_t>& binary_data); + void sendAudioChunkToMobile(); bool getShouldBeStopped(); diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc index 9b0057dfe8..681460f6d3 100644 --- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc +++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc @@ -40,6 +40,8 @@ #include "application_manager/application_manager.h" #include "application_manager/mobile_command_factory.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" +#include "application_manager/commands/command.h" #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "utils/file_system.h" @@ -51,6 +53,7 @@ namespace media_manager { using sync_primitives::AutoLock; +namespace strings = application_manager::strings; #ifdef EXTENDED_MEDIA_MODE const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 50; @@ -118,7 +121,7 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() { offset_ = offset_ + to - from; std::vector<uint8_t> data(from, to); - application_manager_.SendAudioPassThroughNotification(session_key_, data); + SendAudioPassThroughNotification(session_key_, data); binaryData.clear(); } #if !defined(EXTENDED_MEDIA_MODE) @@ -127,6 +130,50 @@ void AudioStreamSenderThread::sendAudioChunkToMobile() { #endif } +void AudioStreamSenderThread::SendAudioPassThroughNotification( + uint32_t session_key, std::vector<uint8_t>& binary_data) { + LOG4CXX_AUTO_TRACE(logger_); + + if (!application_manager_.is_audio_pass_thru_active()) { + LOG4CXX_ERROR(logger_, + "Trying to send PassThroughNotification" + " when PassThrough is not active"); + return; + } + + AudioData data; + data.session_key = session_key; + data.binary_data = binary_data; + + smart_objects::SmartObjectSPtr on_audio_pass = + new smart_objects::SmartObject(); + + if (!on_audio_pass) { + LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer"); + return; + } + + LOG4CXX_DEBUG(logger_, "Fill smart object"); + + (*on_audio_pass)[strings::params][strings::message_type] = + application_manager::MessageType::kNotification; + + (*on_audio_pass)[strings::params][strings::connection_key] = + static_cast<int32_t>(data.session_key); + (*on_audio_pass)[strings::params][strings::function_id] = + mobile_apis::FunctionID::OnAudioPassThruID; + + LOG4CXX_DEBUG(logger_, "Fill binary data"); + // binary data + (*on_audio_pass)[strings::params][strings::binary_data] = + smart_objects::SmartObject(data.binary_data); + + LOG4CXX_DEBUG(logger_, "After fill binary data"); + LOG4CXX_DEBUG(logger_, "Send data"); + application_manager_.GetRPCService().ManageMobileCommand( + on_audio_pass, application_manager::commands::Command::SOURCE_SDL); +} + bool AudioStreamSenderThread::getShouldBeStopped() { AutoLock auto_lock(shouldBeStoped_lock_); |