From 73e756b65d60a606253e8a24a2f1a0c909882158 Mon Sep 17 00:00:00 2001 From: "Ira Lytvynenko (GitHub)" Date: Tue, 29 May 2018 14:05:34 +0300 Subject: Remove remote control flag --- CMakeLists.txt | 14 +------ src/appMain/CMakeLists.txt | 1 - src/components/application_manager/CMakeLists.txt | 5 --- .../include/application_manager/application.h | 7 ---- .../include/application_manager/application_impl.h | 11 ------ .../application_manager/application_manager_impl.h | 12 ------ .../include/application_manager/message.h | 6 --- .../include/application_manager/message_helper.h | 2 - .../application_manager/policies/policy_handler.h | 4 -- .../include/application_manager/rpc_service_impl.h | 5 --- .../mobile/register_app_interface_request.cc | 6 --- .../rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt | 1 + .../test/commands/hmi/get_urls_test.cc | 2 +- .../test/commands/hmi/hmi_notifications_test.cc | 2 - .../application_manager/src/application_impl.cc | 7 ---- .../src/application_manager_impl.cc | 6 --- src/components/application_manager/src/message.cc | 4 -- .../src/message_helper/message_helper.cc | 2 - .../src/policies/policy_handler.cc | 3 -- .../application_manager/src/rpc_service_impl.cc | 8 ---- .../application_manager/test/CMakeLists.txt | 4 -- .../include/application_manager/mock_application.h | 4 -- .../test/message_helper/message_helper_test.cc | 4 ++ .../test/mock_message_helper.cc | 3 -- .../application_manager/application_manager.h | 2 - .../policies/policy_handler_interface.h | 2 - .../include/application_manager/rpc_service.h | 5 --- .../policy_external/policy/policy_listener.h | 3 -- .../policy/policy_external/policy/policy_manager.h | 5 --- .../policy/policy_regular/policy/policy_listener.h | 3 -- .../policy/policy_regular/policy/policy_manager.h | 7 +--- .../application_manager/mock_application_manager.h | 3 -- .../test/application_manager/mock_rpc_service.h | 6 --- .../policies/mock_policy_handler_interface.h | 2 - .../policy_external/policy/mock_policy_listener.h | 2 - .../policy_external/policy/mock_policy_manager.h | 11 +++--- .../policy_regular/policy/mock_policy_listener.h | 2 - .../policy_regular/policy/mock_policy_manager.h | 2 - src/components/media_manager/CMakeLists.txt | 1 - .../policy/policy_external/CMakeLists.txt | 5 +-- .../include/policy/policy_manager_impl.h | 9 ----- .../include/policy/policy_table/types.h | 6 --- .../include/policy/sql_pt_representation.h | 2 - .../policy_external/src/policy_manager_impl.cc | 17 +-------- .../policy_external/src/policy_table/enums.cc | 2 - .../policy_external/src/policy_table/types.cc | 17 +-------- .../policy_external/src/policy_table/validation.cc | 6 --- .../policy_external/src/sql_pt_representation.cc | 8 ---- .../policy/policy_external/test/CMakeLists.txt | 6 --- .../policy/policy_regular/CMakeLists.txt | 5 --- .../include/policy/policy_manager_impl.h | 16 +++----- .../include/policy/policy_table/types.h | 6 --- .../include/policy/sql_pt_representation.h | 2 - .../policy_regular/src/policy_manager_impl.cc | 43 ++++++++++------------ .../policy_regular/src/policy_table/enums.cc | 2 - .../policy_regular/src/policy_table/types.cc | 16 +------- .../policy_regular/src/policy_table/validation.cc | 6 --- .../policy_regular/src/sql_pt_representation.cc | 9 ----- .../policy/policy_regular/test/CMakeLists.txt | 5 --- .../test/policy_manager_impl_test.cc | 8 +--- src/components/telemetry_monitor/CMakeLists.txt | 1 - 61 files changed, 44 insertions(+), 332 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49959597a9..97bda27c53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,6 @@ option(ENABLE_GCOV "gcov code coverage feature" OFF) option(ENABLE_SANITIZE "Sanitize tool" OFF) option(ENABLE_SECURITY "Security Ford protocol protection" ON) option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON) -option(REMOTE_CONTROL "Enable Reverse functionality" ON) option(USE_COTIRE "Use Cotire to speed up build (currently only for commands tests)" ON) option(USE_GOLD_LD "Use gold linker intead of GNU linker" ON) option(USE_CCACHE "Turn on ccache usage" ON) @@ -156,11 +155,6 @@ if (OS_TYPE_OPTION) endif() endif() -if (REMOTE_CONTROL) - add_definitions(-DSDL_REMOTE_CONTROL) - message(STATUS "Remote control support is enabled (aka Reverse SDL or SDL-RC)") -endif() - #Jenkins integration section end #Deliver Build Configuration @@ -174,12 +168,6 @@ get_property(cValue CACHE EXTENDED_POLICY PROPERTY VALUE) file(APPEND "${build_config_path}" "//${cHelpString}\n") file(APPEND "${build_config_path}" "EXTENDED_POLICY:${cType}=${cValue}\n\n") -get_property(cHelpString CACHE REMOTE_CONTROL PROPERTY HELPSTRING) -get_property(cType CACHE REMOTE_CONTROL PROPERTY TYPE) -get_property(cValue CACHE REMOTE_CONTROL PROPERTY VALUE) -file(APPEND "${build_config_path}" "//${cHelpString}\n") -file(APPEND "${build_config_path}" "REMOTE_CONTROL:${cType}=${cValue}\n\n") - get_property(cHelpString CACHE BUILD_BT_SUPPORT PROPERTY HELPSTRING) get_property(cType CACHE BUILD_BT_SUPPORT PROPERTY TYPE) get_property(cValue CACHE BUILD_BT_SUPPORT PROPERTY VALUE) @@ -503,4 +491,4 @@ find_package(Doxygen) message(STATUS "sudo apt-get install doxygen graphviz") message(STATUS "To enable processing of MscGen comments please install mscgen") message(STATUS "sudo apt-get install mscgen") -endif() \ No newline at end of file +endif() diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index 072f326a9b..e82d95f904 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -44,7 +44,6 @@ endif() include_directories( ${COMPONENTS_DIR}/protocol_handler/include ${COMPONENTS_DIR}/application_manager/include - ${COMPONENTS_DIR}/remote_control/include ${COMPONENTS_DIR}/formatters/include ${COMPONENTS_DIR}/transport_manager/include ${COMPONENTS_DIR}/security_manager/include diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index ad1271ba14..b7a6d94503 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -136,11 +136,6 @@ set(PATHS ) collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}") -if (NOT REMOTE_CONTROL) - list(REMOVE_ITEM SOURCES - ${COMPONENTS_DIR}/application_manager/src/core_service.cc) -endif() - set(LIBRARIES HMI_API MOBILE_API diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 14c5bb8640..0a70d81648 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -861,7 +861,6 @@ class Application : public virtual InitialApplicationData, */ virtual void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) = 0; -#ifdef SDL_REMOTE_CONTROL /** * @brief set_system_context Set system context for application * @param system_context Current context @@ -903,17 +902,11 @@ class Application : public virtual InitialApplicationData, */ virtual bool RemoveExtension(AppExtensionUID uid) = 0; - /** - * @brief Removes all extensions - */ - virtual void RemoveExtensions() = 0; - /** * @brief Get list of subscriptions to vehicle info notifications * @return list of subscriptions to vehicle info notifications */ virtual const VehicleInfoSubscriptions& SubscribesIVI() const = 0; -#endif // SDL_REMOTE_CONTROL protected: mutable sync_primitives::Lock hmi_states_lock_; diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 2fa4ba6499..1ea613b1a6 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -362,7 +362,6 @@ class ApplicationImpl : public virtual Application, */ uint32_t GetAvailableDiskSpace() OVERRIDE; -#ifdef SDL_REMOTE_CONTROL /** * @brief Sets current system context * @param system_context new system context @@ -393,7 +392,6 @@ class ApplicationImpl : public virtual Application, * @return Pointer to extension, if extension was initialized, otherwise NULL */ AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE; -#endif void PushMobileMessage( smart_objects::SmartObjectSPtr mobile_message) OVERRIDE; @@ -429,7 +427,6 @@ class ApplicationImpl : public virtual Application, */ void OnAudioStreamSuspend(); -#ifdef SDL_REMOTE_CONTROL /** * @brief Add extension to application * @param extension pointer to extension @@ -444,12 +441,6 @@ class ApplicationImpl : public virtual Application, */ bool RemoveExtension(AppExtensionUID uid) OVERRIDE; - /** - * @brief Removes all extensions - */ - void RemoveExtensions() OVERRIDE; -#endif // SDL_REMOTE_CONTROL - std::string hash_val_; uint32_t grammar_id_; @@ -501,9 +492,7 @@ class ApplicationImpl : public virtual Application, Timer video_stream_suspend_timer_; Timer audio_stream_suspend_timer_; -#ifdef SDL_REMOTE_CONTROL std::list extensions_; -#endif // SDL_REMOTE_CONTROL /** * @brief Defines number per time in seconds limits 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 c7a56ed119..d0c216b323 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 @@ -188,7 +188,6 @@ class ApplicationManagerImpl void SendHMIStatusNotification( const utils::SharedPtr app) OVERRIDE; -#ifdef SDL_REMOTE_CONTROL ApplicationSharedPtr application( const std::string& device_id, const std::string& policy_app_id) const OVERRIDE; @@ -203,12 +202,6 @@ class ApplicationManagerImpl */ void ChangeAppsHMILevel(uint32_t app_id, mobile_apis::HMILevel::eType level); - void Erase(ApplicationSharedPtr app_to_remove) { - DCHECK(app_to_remove); - app_to_remove->RemoveExtensions(); - applications_.erase(app_to_remove); - } - virtual plugin_manager::RPCPluginManager& GetPluginManager() OVERRIDE { DCHECK(plugin_manager_); return *plugin_manager_; @@ -217,8 +210,6 @@ class ApplicationManagerImpl std::vector devices( const std::string& policy_app_id) const OVERRIDE; -#endif // SDL_REMOTE_CONTROL - /** * @brief Checks if application with the same HMI type * (media, voice communication or navi) exists @@ -1471,8 +1462,6 @@ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id, request_controller::RequestController request_ctrl_; std::unique_ptr plugin_manager_; -#ifdef SDL_REMOTE_CONTROL - /** * @brief Map contains apps with HMI state before incoming call * After incoming call ends previous HMI state must restore @@ -1490,7 +1479,6 @@ bool IsSOStructValid(const hmi_apis::StructIdentifiers::eType struct_id, mobile_apis::AudioStreamingState::eType audio_streaming_state; mobile_apis::SystemContext::eType system_context; }; -#endif // SDL_REMOTE_CONTROL hmi_apis::HMI_API* hmi_so_factory_; mobile_apis::MOBILE_API* mobile_so_factory_; diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index f399da6870..7ca3e59f09 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -68,9 +68,7 @@ class Message { //! -------------------------------------------------------------------------- int32_t function_id() const; -#ifdef SDL_REMOTE_CONTROL std::string function_name() const; -#endif // SDL_REMOTE_CONTROL int32_t correlation_id() const; int32_t connection_key() const; @@ -87,9 +85,7 @@ class Message { //! //--------------------------------------------------------------------------. void set_function_id(int32_t id); -#ifdef SDL_REMOTE_CONTROL void set_function_name(const std::string& name); -#endif // SDL_REMOTE_CONTROL void set_correlation_id(int32_t id); void set_connection_key(int32_t key); void set_message_type(MessageType type); @@ -113,9 +109,7 @@ class Message { int32_t function_id_; // @remark protocol V2. int32_t correlation_id_; // @remark protocol V2. MessageType type_; // @remark protocol V2. -#ifdef SDL_REMOTE_CONTROL std::string function_name_; -#endif // SDL_REMOTE_CONTROL // Pre-calculated message priority, higher priority messages are // Processed first diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 4cd18b3c36..a18073cba3 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -813,7 +813,6 @@ class MessageHelper { ApplicationSharedPtr application, ApplicationManager& app_mngr); -#ifdef SDL_REMOTE_CONTROL /** * @brief Sends HMI status notification to mobile * @param application_impl application with changed HMI status @@ -836,7 +835,6 @@ class MessageHelper { ApplicationManager& application_manager, hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL, bool send_policy_priority = true); -#endif // SDL_REMOTE_CONTROL private: /** diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 73a05b370e..8d019784fc 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -113,7 +113,6 @@ class PolicyHandler : public PolicyHandlerInterface, virtual DeviceConsent GetUserConsentForDevice( const std::string& device_id) const OVERRIDE; -#ifdef SDL_REMOTE_CONTROL /** * @brief Sets HMI default type for specified application * @param application_id ID application @@ -177,7 +176,6 @@ class PolicyHandler : public PolicyHandlerInterface, */ bool GetModuleTypes(const std::string& policy_app_id, std::vector* modules) const OVERRIDE; -#endif // SDL_REMOTE_CONTROL bool GetDefaultHmi(const std::string& policy_app_id, std::string* default_hmi) const OVERRIDE; @@ -627,7 +625,6 @@ class PolicyHandler : public PolicyHandlerInterface, PermissionConsent& out_permissions) OVERRIDE; #endif -#ifdef SDL_REMOTE_CONTROL /** * @brief Updates HMI level for specified application and send notification * @param app application where HMI level was changed @@ -637,7 +634,6 @@ class PolicyHandler : public PolicyHandlerInterface, mobile_apis::HMILevel::eType level); std::vector GetDevicesIds( const std::string& policy_app_id) OVERRIDE; -#endif // SDL_REMOTE_CONTROL /** * @brief Sets days after epoch on successful policy update 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 4af765343d..6f39e11592 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 @@ -124,11 +124,6 @@ class RPCServiceImpl : public RPCService, void set_hmi_message_handler( hmi_message_handler::HMIMessageHandler* handler) OVERRIDE; -#ifdef SDL_REMOTE_CONTROL - void SendPostMessageToMobile(const MessagePtr& message) OVERRIDE; - void SendPostMessageToHMI(const MessagePtr& message) OVERRIDE; -#endif // SDL_REMOTE_CONTROL - private: bool ConvertSOtoMessage(const smart_objects::SmartObject& message, Message& output); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index b119bbe99d..ea353c8d90 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -79,10 +79,8 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) { return mobile_apis::AppHMIType::SYSTEM; } else if ("PROJECTION" == str) { return mobile_apis::AppHMIType::PROJECTION; -#ifdef SDL_REMOTE_CONTROL } else if ("REMOTE_CONTROL" == str) { return mobile_apis::AppHMIType::REMOTE_CONTROL; -#endif } else { return mobile_apis::AppHMIType::INVALID_ENUM; } @@ -91,9 +89,7 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) { std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) { const std::map app_hmi_type_map = {{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"}, -#ifdef SDL_REMOTE_CONTROL {mobile_apis::AppHMIType::REMOTE_CONTROL, "REMOTE_CONTROL"}, -#endif // SDL_REMOTE_CONTROL {mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"}, {mobile_apis::AppHMIType::MEDIA, "MEDIA"}, {mobile_apis::AppHMIType::MESSAGING, "MESSAGING"}, @@ -773,12 +769,10 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( SendResponse(true, result_code, add_info.c_str(), &response_params); SendOnAppRegisteredNotificationToHMI( *(application.get()), resumption, need_restore_vr); -#ifdef SDL_REMOTE_CONTROL if (msg_params.keyExists(strings::app_hmi_type)) { GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(), &(msg_params[strings::app_hmi_type])); } -#endif // SDL_REMOTE_CONTROL // Default HMI level should be set before any permissions validation, since it // relies on HMI level. diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt index 8893be4923..da067cfe03 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/CMakeLists.txt @@ -5,6 +5,7 @@ include_directories( ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/ ${COMPONENTS_DIR}/application_manager/test/include/ + ${POLICY_MOCK_INCLUDE_PATH}/ ) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc index cc1f3345e5..7788cb2ebe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc @@ -47,7 +47,7 @@ #include "application_manager/policies/mock_policy_handler_interface.h" #include "application_manager/commands/command_request_test.h" #include "application_manager/commands/request_from_hmi.h" -#include "policy/policy_external/policy/mock_policy_manager.h" +#include "policy/mock_policy_manager.h" #include "application_manager/event_engine/event_dispatcher.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc index 0404e1ece7..0a66327741 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc @@ -1084,11 +1084,9 @@ TEST_F(HMICommandsNotificationsTest, (*notification)[am::strings::msg_params][am::strings::reason] = static_cast(*it_mobile_reason); -#ifdef SDL_REMOTE_CONTROL am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_; EXPECT_CALL(app_mngr_, GetPluginManager()) .WillRepeatedly(ReturnRef(mock_rpc_plugin_manager_)); -#endif // SDL_REMOTE_CONTROL EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_)); EXPECT_CALL(mock_message_helper_, diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 5042835944..43c5c2724c 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -1068,8 +1068,6 @@ void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) { } } -#ifdef SDL_REMOTE_CONTROL - void ApplicationImpl::set_system_context( const mobile_api::SystemContext::eType& system_context) { const HmiStatePtr hmi_state = CurrentHmiState(); @@ -1137,11 +1135,6 @@ bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) { return it != extensions_.end(); } -void ApplicationImpl::RemoveExtensions() { - // application_manager_.GetPluginManager().RemoveAppExtension(app_id_); -} -#endif // SDL_REMOTE_CONTROL - void ApplicationImpl::PushMobileMessage( smart_objects::SmartObjectSPtr mobile_message) { sync_primitives::AutoLock lock(mobile_message_lock_); diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 18d4ea54d8..2611f21239 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2476,15 +2476,12 @@ void ApplicationManagerImpl::UnregisterApplication( StopAudioPassThru(app_id); MessageHelper::SendStopAudioPathThru(*this); } - -#ifdef SDL_REMOTE_CONTROL auto on_app_unregistered = [app_to_remove](plugin_manager::RPCPlugin& plugin) { plugin.OnApplicationEvent(plugin_manager::kApplicationUnregistered, app_to_remove); }; plugin_manager_->ForEachPlugin(on_app_unregistered); -#endif MessageHelper::SendOnAppUnregNotificationToHMI( app_to_remove, is_unexpected_disconnect, *this); @@ -3598,7 +3595,6 @@ void ApplicationManagerImpl::SetMockMediaManager( media_manager_ = mock_media_manager; } #endif // BUILD_TESTS -#ifdef SDL_REMOTE_CONTROL struct MobileAppIdPredicate { std::string policy_app_id_; MobileAppIdPredicate(const std::string& policy_app_id) @@ -3668,6 +3664,4 @@ void ApplicationManagerImpl::ChangeAppsHMILevel( } } -#endif // SDL_REMOTE_CONTROL - } // namespace application_manager diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc index 7bc686aef1..b005af0fb5 100644 --- a/src/components/application_manager/src/message.cc +++ b/src/components/application_manager/src/message.cc @@ -130,11 +130,9 @@ int32_t Message::function_id() const { return function_id_; } -#ifdef SDL_REMOTE_CONTROL std::string Message::function_name() const { return function_name_; } -#endif // SDL_REMOTE_CONTROL int32_t Message::correlation_id() const { return correlation_id_; @@ -176,11 +174,9 @@ void Message::set_function_id(int32_t id) { function_id_ = id; } -#ifdef SDL_REMOTE_CONTROL void Message::set_function_name(const std::string& name) { function_name_ = name; } -#endif // SDL_REMOTE_CONTROL void Message::set_correlation_id(int32_t id) { correlation_id_ = id; 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 ceb8aaaa92..42a235a991 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -737,7 +737,6 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult( return HMIResultFromString(result); } -#ifdef SDL_REMOTE_CONTROL void MessageHelper::SendHMIStatusNotification( const Application& application_impl, ApplicationManager& application_manager) { @@ -824,7 +823,6 @@ void MessageHelper::SendActivateAppToHMI( application_manager.GetRPCService().ManageHMICommand(message); } -#endif // SDL_REMOTE_CONTROL mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel( const std::string& hmi_level) { diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 81e4eadc4e..2ba7d63cdc 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2030,8 +2030,6 @@ bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx, return ((is_registered && !is_empty_urls) || is_default); } -#ifdef SDL_REMOTE_CONTROL - std::vector PolicyHandler::GetDevicesIds( const std::string& policy_app_id) { return application_manager_.devices(policy_app_id); @@ -2165,5 +2163,4 @@ void PolicyHandler::OnUpdateHMILevel(const std::string& device_id, } UpdateHMILevel(app, level); } -#endif // SDL_REMOTE_CONTROL } // namespace policy diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index f7741031a6..7d930d1432 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -511,14 +511,6 @@ void RPCServiceImpl::SendMessageToHMI( messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send)); } -void RPCServiceImpl::SendPostMessageToMobile(const MessagePtr& message) { - messages_to_mobile_.PostMessage(impl::MessageToMobile(message, false)); -} - -void RPCServiceImpl::SendPostMessageToHMI(const MessagePtr& message) { - messages_to_hmi_.PostMessage(impl::MessageToHmi(message)); -} - void RPCServiceImpl::set_protocol_handler( protocol_handler::ProtocolHandler* handler) { protocol_handler_ = handler; diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 2110e68b27..579ffe8c1b 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -72,10 +72,6 @@ set(testSourcesMockHmi ${AM_TEST_DIR}/application_manager_impl_mock_hmi_test.cc ) -if(REMOTE_CONTROL) - list(APPEND testSources ${AM_TEST_DIR}/rc_policy_handler_test.cc) -endif(REMOTE_CONTROL) - set (RequestController_SOURCES ${AM_TEST_DIR}/request_controller/request_controller_test.cc ${AM_TEST_DIR}/mock_message_helper.cc diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index cc7ae688cb..ef1cd46cce 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -308,7 +308,6 @@ class MockApplication : public ::application_manager::Application { SwapMobileMessageQueue, void(::application_manager::MobileMessageQueue& mobile_messages)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD1( set_system_context, void(const application_manager::mobile_api::SystemContext::eType&)); @@ -331,13 +330,10 @@ class MockApplication : public ::application_manager::Application { MOCK_METHOD1(AddExtension, bool(application_manager::AppExtensionPtr extention)); MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid)); - MOCK_METHOD0(RemoveExtensions, void()); MOCK_CONST_METHOD0(SubscribesIVI, const application_manager::VehicleInfoSubscriptions&()); MOCK_CONST_METHOD0(is_remote_control_supported, bool()); MOCK_METHOD1(set_remote_control_supported, void(const bool allow)); - -#endif // SDL_REMOTE_CONTROL }; } // namespace application_manager_test diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 0d6d327122..8b5670037b 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -953,6 +953,8 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) { smart_objects::SmartObjectSPtr result; + ON_CALL(mock_application_manager, GetRPCService()) + .WillByDefault(ReturnRef(mock_rpc_service_)); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); @@ -991,6 +993,8 @@ TEST_F(MessageHelperTest, smart_objects::SmartObjectSPtr result; + ON_CALL(mock_application_manager, GetRPCService()) + .WillByDefault(ReturnRef(mock_rpc_service_)); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc index 8b0ec5b854..57a35e5283 100644 --- a/src/components/application_manager/test/mock_message_helper.cc +++ b/src/components/application_manager/test/mock_message_helper.cc @@ -230,7 +230,6 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path, file_path, timeout, retries, app_mngr); } -#ifdef SDL_REMOTE_CONTROL void MessageHelper::SendActivateAppToHMI( uint32_t const app_id, ApplicationManager& application_manager, @@ -247,8 +246,6 @@ void MessageHelper::SendHMIStatusNotification( application_impl, application_manager); } -#endif // SDL_REMOTE_CONTROL - void MessageHelper::SendUpdateSDLResponse(const std::string& result, uint32_t correlation_id, ApplicationManager& app_mngr) { diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index 163fe447c0..c273cf0262 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -169,7 +169,6 @@ class ApplicationManager { virtual AppSharedPtrs applications_by_button(uint32_t button) = 0; virtual AppSharedPtrs applications_with_navi() = 0; -#ifdef SDL_REMOTE_CONTROL /** * @brief application find application by device and policy identifier * @param device_id device id @@ -186,7 +185,6 @@ class ApplicationManager { virtual std::vector devices( const std::string& policy_app_id) const = 0; -#endif // SDL_REMOTE_CONTROL virtual plugin_manager::RPCPluginManager& GetPluginManager() = 0; #ifdef BUILD_TESTS diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 9211268893..b8946a63f4 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -470,7 +470,6 @@ class PolicyHandlerInterface { virtual void OnDeviceSwitching(const std::string& device_id_from, const std::string& device_id_to) = 0; -#ifdef SDL_REMOTE_CONTROL /** * @brief Sets HMI default type for specified application * @param application_id ID application @@ -535,7 +534,6 @@ class PolicyHandlerInterface { */ virtual bool GetModuleTypes(const std::string& policy_app_id, std::vector* modules) const = 0; -#endif // SDL_REMOTE_CONTROL private: /** diff --git a/src/components/include/application_manager/rpc_service.h b/src/components/include/application_manager/rpc_service.h index 1017a13202..79b4007f71 100644 --- a/src/components/include/application_manager/rpc_service.h +++ b/src/components/include/application_manager/rpc_service.h @@ -83,11 +83,6 @@ class RPCService { protocol_handler::ProtocolHandler* handler) = 0; virtual void set_hmi_message_handler( hmi_message_handler::HMIMessageHandler* handler) = 0; - -#ifdef SDL_REMOTE_CONTROL - virtual void SendPostMessageToMobile(const MessagePtr& message) = 0; - virtual void SendPostMessageToHMI(const MessagePtr& message) = 0; -#endif // SDL_REMOTE_CONTROL }; } // namespace rpc_service } // namespace application_manager diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h index e850a3fa2b..c023f3c7fc 100644 --- a/src/components/include/policy/policy_external/policy/policy_listener.h +++ b/src/components/include/policy/policy_external/policy/policy_listener.h @@ -137,7 +137,6 @@ class PolicyListener { virtual void GetRegisteredLinks( std::map& out_links) const = 0; -#ifdef SDL_REMOTE_CONTROL /** * Gets devices ids by policy application id * @param policy_app_id @@ -173,8 +172,6 @@ class PolicyListener { virtual void OnUpdateHMIStatus(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level) = 0; - -#endif // SDL_REMOTE_CONTROL }; } // namespace policy #endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_ diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 7970d525c5..83038472cd 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -42,10 +42,7 @@ #include "policy/policy_listener.h" #include "policy/usage_statistics/statistics_manager.h" #include "policy/cache_manager_interface.h" - -#ifdef SDL_REMOTE_CONTROL #include "policy/access_remote.h" -#endif // SDL_REMOTE_CONTROL namespace policy { class PolicySettings; @@ -565,7 +562,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0; -#ifdef SDL_REMOTE_CONTROL /** * @brief Assigns new HMI types for specified application * @param application_id Unique application id @@ -614,7 +610,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual void set_access_remote( utils::SharedPtr access_remote) = 0; -#endif // SDL_REMOTE_CONTROL /** * @brief Checks if there is existing URL in the EndpointUrls vector with diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h index e8de37d5de..3f6f555bcc 100644 --- a/src/components/include/policy/policy_regular/policy/policy_listener.h +++ b/src/components/include/policy/policy_regular/policy/policy_listener.h @@ -112,7 +112,6 @@ class PolicyListener { */ virtual void OnCertificateUpdated(const std::string& certificate_data) = 0; -#ifdef SDL_REMOTE_CONTROL /** * Gets devices ids by policy application id * @param policy_app_id @@ -148,8 +147,6 @@ class PolicyListener { virtual void OnUpdateHMIStatus(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level) = 0; - -#endif // SDL_REMOTE_CONTROL }; } // namespace policy #endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_ diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index 84d48a691e..78b6675d57 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -42,10 +42,7 @@ #include "policy/policy_listener.h" #include "policy/usage_statistics/statistics_manager.h" #include "policy/cache_manager_interface.h" - -#ifdef SDL_REMOTE_CONTROL #include "policy/access_remote.h" -#endif // SDL_REMOTE_CONTROL namespace policy { class PolicySettings; @@ -543,7 +540,7 @@ class PolicyManager : public usage_statistics::StatisticsManager { * urls vector */ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0; -#ifdef SDL_REMOTE_CONTROL + /** * @brief Assigns new HMI types for specified application * @param application_id Unique application id @@ -593,7 +590,7 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual void set_access_remote( utils::SharedPtr access_remote) = 0; -#endif // SDL_REMOTE_CONTROL + /** * @brief Checks if there is existing URL in the EndpointUrls vector with diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 007df9e482..fb3578c2f0 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -78,8 +78,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { application, application_manager::ApplicationSharedPtr(uint32_t app_id)); MOCK_CONST_METHOD0(active_application, application_manager::ApplicationSharedPtr()); - -#ifdef SDL_REMOTE_CONTROL MOCK_CONST_METHOD2(application, application_manager::ApplicationSharedPtr( const std::string& device_id, @@ -88,7 +86,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { void(uint32_t app_id, mobile_apis::HMILevel::eType level)); MOCK_CONST_METHOD1( devices, std::vector(const std::string& policy_app_id)); -#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(GetPluginManager, RPCPluginManager&()); MOCK_METHOD1(SetPluginManager, diff --git a/src/components/include/test/application_manager/mock_rpc_service.h b/src/components/include/test/application_manager/mock_rpc_service.h index 360faae3ec..4eddbbe257 100644 --- a/src/components/include/test/application_manager/mock_rpc_service.h +++ b/src/components/include/test/application_manager/mock_rpc_service.h @@ -22,16 +22,10 @@ class MockRPCService : public application_manager::rpc_service::RPCService { MOCK_METHOD1( SendMessageToHMI, void(const application_manager::commands::MessageSharedPtr message)); -#ifdef SDL_REMOTE_CONTROL - MOCK_METHOD1(SendPostMessageToMobile, - void(const application_manager::MessagePtr& message)); - MOCK_METHOD1(SendPostMessageToHMI, - void(const application_manager::MessagePtr& message)); MOCK_METHOD1(set_protocol_handler, void(protocol_handler::ProtocolHandler* handler)); MOCK_METHOD1(set_hmi_message_handler, void(hmi_message_handler::HMIMessageHandler* handler)); -#endif // SDL_REMOTE_CONTROL }; } } diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index dfd537c678..ffa9222c8e 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -239,7 +239,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(const std::string& service_type, policy::EndpointUrls& end_points)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD3(OnUpdateHMILevel, void(const std::string& device_id, const std::string& policy_app_id, @@ -270,7 +269,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_METHOD2(OnDeviceSwitching, void(const std::string& device_id_from, const std::string& device_id_to)); -#endif // SDL_REMOTE_CONTROL private: #ifdef EXTERNAL_PROPRIETARY_MODE diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h index ad2f1fd56c..1f570d8699 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h @@ -92,7 +92,6 @@ class MockPolicyListener : public ::policy::PolicyListener { const std::string& hmi_level)); MOCK_CONST_METHOD1(GetRegisteredLinks, void(std::map&)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, @@ -101,7 +100,6 @@ class MockPolicyListener : public ::policy::PolicyListener { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); -#endif // SDL_REMOTE_CONTROL }; } // namespace policy_test diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index b48ebb59de..ea259fc916 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -67,7 +67,7 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetUpdateUrls, void(const std::string& service_type, EndpointUrls& out_end_points)); - MOCK_METHOD0(RequestPTUpdate, bool()); + MOCK_METHOD0(RequestPTUpdate, void()); MOCK_METHOD5(CheckPermissions, void(const PTString& app_id, const PTString& hmi_level, @@ -81,7 +81,7 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD0(ForcePTExchange, std::string()); MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string()); MOCK_METHOD0(ResetRetrySequence, void()); - MOCK_METHOD0(NextRetryTimeout, uint32_t()); + MOCK_METHOD0(NextRetryTimeout, int()); MOCK_METHOD0(TimeoutExchangeMSec, uint32_t()); MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector()); MOCK_METHOD0(OnExceededTimeout, void()); @@ -110,8 +110,9 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(SetDeviceInfo, void(const std::string& device_id, const policy::DeviceInfo& device_info)); - MOCK_METHOD1(SetUserConsentForApp, - void(const policy::PermissionConsent& permissions)); + MOCK_METHOD2(SetUserConsentForApp, + void(const policy::PermissionConsent& permissions, + const policy::PolicyManager::NotificationMode mode)); MOCK_CONST_METHOD2(GetDefaultHmi, bool(const std::string& policy_app_id, std::string* default_hmi)); @@ -147,7 +148,6 @@ class MockPolicyManager : public PolicyManager { StatusNotifier( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD2(SetDefaultHmiTypes, void(const std::string& application_id, const std::vector& hmi_types)); @@ -164,7 +164,6 @@ class MockPolicyManager : public PolicyManager { std::vector* modules)); MOCK_METHOD1(set_access_remote, void(utils::SharedPtr access_remote)); -#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h index d98a0279d7..3b0c1a925e 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h @@ -85,7 +85,6 @@ class MockPolicyListener : public ::policy::PolicyListener { std::vector(const std::string& policy_app_id)); MOCK_CONST_METHOD1(GetRegisteredLinks, void(std::map&)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, @@ -94,7 +93,6 @@ class MockPolicyListener : public ::policy::PolicyListener { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); -#endif // SDL_REMOTE_CONTROL }; } // namespace policy_test diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index e0214934ee..952b264caf 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -147,7 +147,6 @@ class MockPolicyManager : public PolicyManager { StatusNotifier( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types)); -#ifdef SDL_REMOTE_CONTROL MOCK_METHOD2(SetDefaultHmiTypes, void(const std::string& application_id, const std::vector& hmi_types)); @@ -164,7 +163,6 @@ class MockPolicyManager : public PolicyManager { std::vector* modules)); MOCK_METHOD1(set_access_remote, void(utils::SharedPtr access_remote)); -#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt index e4ed9db289..9010d15dc0 100644 --- a/src/components/media_manager/CMakeLists.txt +++ b/src/components/media_manager/CMakeLists.txt @@ -35,7 +35,6 @@ include_directories( ${COMPONENTS_DIR}/media_manager/include/ ${COMPONENTS_DIR}/media_manager/include/audio/ ${COMPONENTS_DIR}/media_manager/include/video/ - ${COMPONENTS_DIR}/remote_control/include/ ${COMPONENTS_DIR}/utils/include/ ${COMPONENTS_DIR}/protocol_handler/include/ ${COMPONENTS_DIR}/connection_handler/include/ diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt index 8d04f20470..c66313240f 100644 --- a/src/components/policy/policy_external/CMakeLists.txt +++ b/src/components/policy/policy_external/CMakeLists.txt @@ -55,13 +55,10 @@ set(SOURCES ${POLICY_PATH}/src/update_status_manager.cc ${POLICY_PATH}/src/status.cc ${POLICY_PATH}/src/cache_manager.cc + ${POLICY_PATH}/src/access_remote_impl.cc ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc ) -if (REMOTE_CONTROL) - list(APPEND SOURCES ${POLICY_PATH}/src/access_remote_impl.cc) -endif() - list(APPEND SOURCES ${POLICY_PATH}/src/sql_pt_ext_queries.cc ${POLICY_PATH}/src/sql_pt_ext_representation.cc diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index fcd9c9f69a..67756c053d 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -42,11 +42,8 @@ #include "policy/update_status_manager.h" #include "policy/policy_table/functions.h" #include "policy/usage_statistics/statistics_manager.h" - -#ifdef SDL_REMOTE_CONTROL #include "policy/access_remote.h" #include "policy/access_remote_impl.h" -#endif // SDL_REMOTE_CONTROL namespace policy_table = rpc::policy_table_interface_base; @@ -454,7 +451,6 @@ class PolicyManagerImpl : public PolicyManager { const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE; -#ifdef SDL_REMOTE_CONTROL /** * @brief Assigns new HMI types for specified application * @param application_id Unique application id @@ -489,7 +485,6 @@ class PolicyManagerImpl : public PolicyManager { * @param application_id Unique id of application */ void OnPrimaryGroupsChanged(const std::string& application_id); -#endif // SDL_REMOTE_CONTROL /** * @brief Removes consent for application functional group @@ -868,7 +863,6 @@ class PolicyManagerImpl : public PolicyManager { bool IsPTValid(utils::SharedPtr policy_table, policy_table::PolicyTableType type) const; -#ifdef SDL_REMOTE_CONTROL /** * @brief Get resulting RPCs permissions for application which started on * specific device @@ -905,7 +899,6 @@ class PolicyManagerImpl : public PolicyManager { */ bool GetModuleTypes(const std::string& policy_app_id, std::vector* modules) const OVERRIDE; -#endif // SDL_REMOTE_CONTROL /** * @brief Notify application about its permissions changes by preparing and @@ -1021,12 +1014,10 @@ class PolicyManagerImpl : public PolicyManager { * @brief pointer to CacheManagerInterface instance for getting policy data */ CacheManagerInterfaceSPtr cache_; -#ifdef SDL_REMOTE_CONTROL /** * @brief pointer to AccessRemote instance for working with RC applications */ utils::SharedPtr access_remote_; -#endif /** * @brief lock guard for protecting applications list access diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 1b1419365d..b062fa0966 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -104,11 +104,9 @@ typedef Array, 0, 255> RequestsTypeArray; typedef Strings RequestSubTypes; -#ifdef SDL_REMOTE_CONTROL typedef Map RemoteRpcs; typedef Map AccessModules; typedef Array, 0, 255> ModuleTypes; -#endif // SDL_REMOTE_CONTROL typedef AppHMIType AppHmiType; typedef std::vector AppHmiTypes; @@ -178,9 +176,7 @@ struct ApplicationParams : PolicyBase { Optional RequestSubType; Optional > memory_kb; Optional > heart_beat_timeout_ms; -#ifdef SDL_REMOTE_CONTROL mutable Optional moduleType; -#endif // SDL_REMOTE_CONTROL public: ApplicationParams(); @@ -200,9 +196,7 @@ struct ApplicationParams : PolicyBase { private: bool Validate() const; -#ifdef SDL_REMOTE_CONTROL bool ValidateModuleTypes() const; -#endif // SDL_REMOTE_CONTROL }; struct ApplicationPoliciesSection : CompositeType { diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index c32e3205ef..d56f6aeba2 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -98,7 +98,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { } #endif // BUILD_TESTS protected: -#ifdef SDL_REMOTE_CONTROL enum TypeAccess { kAllowed, kManual }; bool GatherModuleType(const std::string& app_id, policy_table::ModuleTypes* module_types) const; @@ -113,7 +112,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool SaveAccessModule(TypeAccess access, const policy_table::AccessModules& modules); bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs); -#endif // SDL_REMOTE_CONTROL virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const; virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const; diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 172e218e0e..4ac66c0d53 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -50,11 +50,8 @@ #include "policy/update_status_manager.h" #include "config_profile/profile.h" #include "utils/make_shared.h" - -#ifdef SDL_REMOTE_CONTROL #include "policy/access_remote.h" #include "policy/access_remote_impl.h" -#endif // SDL_REMOTE_CONTROL policy::PolicyManager* CreateManager() { return new policy::PolicyManagerImpl(); @@ -216,32 +213,26 @@ PolicyManagerImpl::PolicyManagerImpl() : PolicyManager() , listener_(NULL) , cache_(new CacheManager) -#ifdef SDL_REMOTE_CONTROL , access_remote_(new AccessRemoteImpl( CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) -#endif // SDL_REMOTE_CONTROL , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) - , retry_sequence_url_(0, 0, "") { -} + , retry_sequence_url_(0, 0, "") {} PolicyManagerImpl::PolicyManagerImpl(bool in_memory) : PolicyManager() , listener_(NULL) , cache_(new CacheManager(in_memory)) -#ifdef SDL_REMOTE_CONTROL , access_remote_(new AccessRemoteImpl( CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) -#endif // SDL_REMOTE_CONTROL , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) , retry_sequence_url_(0, 0, "") , wrong_ptu_update_received_(false) , send_on_update_sent_out_(false) - , trigger_ptu_(false) { -} + , trigger_ptu_(false) {} void PolicyManagerImpl::set_listener(PolicyListener* listener) { listener_ = listener; @@ -792,13 +783,11 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( LOG4CXX_INFO(logger_, "Send notification for application_id:" << application_id); -#ifdef SDL_REMOTE_CONTROL const ApplicationOnDevice who = {device_id, application_id}; if (access_remote_->IsAppRemoteControl(who)) { listener()->OnPermissionsUpdated(application_id, notification_data); return; } -#endif // SDL_REMOTE_CONTROL std::string default_hmi; GetDefaultHmi(application_id, &default_hmi); @@ -1933,7 +1922,6 @@ std::ostream& operator<<(std::ostream& output, return output; } -#ifdef SDL_REMOTE_CONTROL void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id, const std::vector& hmi_types) { LOG4CXX_INFO(logger_, "SetDefaultHmiTypes"); @@ -2039,6 +2027,5 @@ void PolicyManagerImpl::set_access_remote( utils::SharedPtr access_remote) { access_remote_ = access_remote; } -#endif // SDL_REMOTE_CONTROL } // namespace policy diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index 881ae8cbf9..5a9e403053 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -758,7 +758,6 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { } } -#ifdef SDL_REMOTE_CONTROL bool IsValidEnum(ModuleType val) { switch (val) { case MT_CLIMATE: @@ -791,7 +790,6 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) { return false; } } -#endif // SDL_REMOTE_CONTROL const std::string kDefaultApp = "default"; const std::string kPreDataConsentApp = "pre_DataConsent"; diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index 6d0bc9d697..8c4f454dfa 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -241,11 +241,7 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , RequestSubType(impl::ValueMember(value__, "RequestSubType")) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) -#ifdef SDL_REMOTE_CONTROL - , moduleType(impl::ValueMember(value__, "moduleType")) -#endif // SDL_REMOTE_CONTROL -{ -} + , moduleType(impl::ValueMember(value__, "moduleType")) {} Json::Value ApplicationParams::ToJsonValue() const { Json::Value result__(PolicyBase::ToJsonValue()); @@ -256,9 +252,7 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField("memory_kb", memory_kb, &result__); impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); -#ifdef SDL_REMOTE_CONTROL impl::WriteJsonField("moduleType", moduleType, &result__); -#endif // SDL_REMOTE_CONTROL return result__; } @@ -280,11 +274,9 @@ bool ApplicationParams::is_valid() const { if (!heart_beat_timeout_ms.is_valid()) { return false; } -#ifdef SDL_REMOTE_CONTROL if (!moduleType.is_valid()) { return false; } -#endif // SDL_REMOTE_CONTROL return Validate(); } @@ -314,11 +306,9 @@ bool ApplicationParams::struct_empty() const { if (heart_beat_timeout_ms.is_initialized()) { return false; } -#ifdef SDL_REMOTE_CONTROL if (moduleType.is_initialized()) { return false; } -#endif // SDL_REMOTE_CONTROL return true; } @@ -364,12 +354,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { heart_beat_timeout_ms.ReportErrors( &report__->ReportSubobject("heart_beat_timeout_ms")); } - -#ifdef SDL_REMOTE_CONTROL if (!moduleType.is_valid()) { moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); } -#endif // SDL_REMOTE_CONTROL } void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { @@ -379,9 +366,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { RequestSubType.SetPolicyTableType(pt_type); memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); -#ifdef SDL_REMOTE_CONTROL moduleType.SetPolicyTableType(pt_type); -#endif // SDL_REMOTE_CONTROL } // RpcParameters methods diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc index 6936948c84..9b227615d8 100644 --- a/src/components/policy/policy_external/src/policy_table/validation.cc +++ b/src/components/policy/policy_external/src/policy_table/validation.cc @@ -164,7 +164,6 @@ bool ApplicationPoliciesSection::Validate() const { return true; } -#ifdef SDL_REMOTE_CONTROL bool ApplicationParams::ValidateModuleTypes() const { // moduleType is optional so see Optional::is_valid() bool is_initialized = moduleType->is_initialized(); @@ -194,7 +193,6 @@ bool ApplicationParams::ValidateModuleTypes() const { } return true; } -#endif // SDL_REMOTE_CONTROL bool ApplicationParams::Validate() const { if (is_initialized()) { @@ -206,11 +204,7 @@ bool ApplicationParams::Validate() const { } } } -#ifdef SDL_REMOTE_CONTROL return ValidateModuleTypes(); -#else // SDL_REMOTE_CONTROL - return true; -#endif // SDL_REMOTE_CONTROL } bool RpcParameters::Validate() const { diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index b05716dc3f..3cd7388672 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -765,7 +765,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( return false; } -#ifdef SDL_REMOTE_CONTROL bool denied = false; if (!GatherRemoteControlDenied(app_id, &denied)) { return false; @@ -775,7 +774,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( return false; } } -#endif // SDL_REMOTE_CONTROL if (!GatherNickName(app_id, &*params.nicknames)) { return false; @@ -1051,14 +1049,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( return false; } -#ifdef SDL_REMOTE_CONTROL - bool denied = !app.second.moduleType->is_initialized(); if (!SaveRemoteControlDenied(app.first, denied) || !SaveModuleType(app.first, *app.second.moduleType)) { return false; } -#endif // SDL_REMOTE_CONTROL if (!SaveNickname(app.first, *app.second.nicknames)) { return false; @@ -1714,8 +1709,6 @@ bool SQLPTRepresentation::GatherAppGroup( return true; } -#ifdef SDL_REMOTE_CONTROL - bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, bool* denied) const { LOG4CXX_AUTO_TRACE(logger_); @@ -1905,7 +1898,6 @@ bool SQLPTRepresentation::GatherRemoteRpc( } return true; } -#endif // SDL_REMOTE_CONTROL bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id, bool is_revoked, diff --git a/src/components/policy/policy_external/test/CMakeLists.txt b/src/components/policy/policy_external/test/CMakeLists.txt index a455d43b91..8b77c90dd2 100644 --- a/src/components/policy/policy_external/test/CMakeLists.txt +++ b/src/components/policy/policy_external/test/CMakeLists.txt @@ -55,12 +55,6 @@ file (GLOB POLICY_TEST_SOURCES list (REMOVE_ITEM POLICY_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/policy_manager_impl_stress_test.cc) -if (REMOTE_CONTROL) - list (APPEND testSources - access_remote_impl_test.cc - ) -endif () - create_test("policy_test" "${POLICY_TEST_SOURCES}" "${testLibraries}") #Additional test files (json) diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt index c7b9c068b9..225e99329a 100644 --- a/src/components/policy/policy_regular/CMakeLists.txt +++ b/src/components/policy/policy_regular/CMakeLists.txt @@ -71,11 +71,6 @@ set(PATHS ) collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}") -if (NOT REMOTE_CONTROL) - list(REMOVE_ITEM SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src/access_remote_impl.cc) -endif() - set(LIBRARIES ConfigProfile policy_struct diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 8379cf4d82..c162d73011 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -47,10 +47,8 @@ #include "policy/usage_statistics/statistics_manager.h" #include "policy/policy_helper.h" #include "utils/timer.h" -#ifdef SDL_REMOTE_CONTROL #include "policy/access_remote.h" #include "policy/access_remote_impl.h" -#endif // SDL_REMOTE_CONTROL namespace policy_table = rpc::policy_table_interface_base; @@ -448,7 +446,6 @@ class PolicyManagerImpl : public PolicyManager { const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE; -#ifdef SDL_REMOTE_CONTROL /** * @brief Assigns new HMI types for specified application * @param application_id Unique application id @@ -483,7 +480,6 @@ class PolicyManagerImpl : public PolicyManager { * @param application_id Unique id of application */ void OnPrimaryGroupsChanged(const std::string& application_id); -#endif // SDL_REMOTE_CONTROL /** * @brief Removes consent for application functional group @@ -816,7 +812,6 @@ class PolicyManagerImpl : public PolicyManager { void RetrySequence(); private: -#ifdef SDL_REMOTE_CONTROL /** * @brief Get resulting RPCs permissions for application which started on * specific device @@ -853,10 +848,10 @@ class PolicyManagerImpl : public PolicyManager { */ bool GetModuleTypes(const std::string& policy_app_id, std::vector* modules) const OVERRIDE; -#endif // SDL_REMOTE_CONTROL - /** - * @brief pointer to policy table listener for callbacks - */ + + /** + * @brief pointer to policy table listener for callbacks + */ PolicyListener* listener_; /** @@ -868,12 +863,11 @@ class PolicyManagerImpl : public PolicyManager { * @brief pointer to CacheManagerInterface instance for getting policy data */ CacheManagerInterfaceSPtr cache_; -#ifdef SDL_REMOTE_CONTROL + /** * @brief pointer to AccessRemote instance for working with RC applications */ utils::SharedPtr access_remote_; -#endif /** * @brief lock guard for protecting applications list access diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 8197247907..ebfbb7f29f 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -98,11 +98,9 @@ typedef Array, 0, 255> RequestTypes; typedef Strings RequestSubTypes; -#ifdef SDL_REMOTE_CONTROL typedef Map RemoteRpcs; typedef Map AccessModules; typedef Array, 0, 255> ModuleTypes; -#endif // SDL_REMOTE_CONTROL typedef AppHMIType AppHmiType; typedef std::vector AppHmiTypes; @@ -145,9 +143,7 @@ struct ApplicationParams : PolicyBase { Optional > memory_kb; Optional > heart_beat_timeout_ms; Optional > certificate; -#ifdef SDL_REMOTE_CONTROL mutable Optional moduleType; -#endif // SDL_REMOTE_CONTROL public: ApplicationParams(); @@ -163,9 +159,7 @@ struct ApplicationParams : PolicyBase { private: bool Validate() const; -#ifdef SDL_REMOTE_CONTROL bool ValidateModuleTypes() const; -#endif // SDL_REMOTE_CONTROL }; struct ApplicationPoliciesSection : CompositeType { diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index e39e0d5873..b26b2c9ede 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -97,7 +97,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { } #endif // BUILD_TESTS protected: -#ifdef SDL_REMOTE_CONTROL enum TypeAccess { kAllowed, kManual }; bool GatherModuleType(const std::string& app_id, policy_table::ModuleTypes* module_types) const; @@ -112,7 +111,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool SaveAccessModule(TypeAccess access, const policy_table::AccessModules& modules); bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs); -#endif // SDL_REMOTE_CONTROL virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const; virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const; diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 8687501b2f..d01631a2a2 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -50,11 +50,8 @@ #include "config_profile/profile.h" #include "utils/timer_task_impl.h" #include "utils/make_shared.h" - -#ifdef SDL_REMOTE_CONTROL #include "policy/access_remote.h" #include "policy/access_remote_impl.h" -#endif // SDL_REMOTE_CONTROL policy::PolicyManager* CreateManager() { return new policy::PolicyManagerImpl(); @@ -76,10 +73,8 @@ PolicyManagerImpl::PolicyManagerImpl() : PolicyManager() , listener_(NULL) , cache_(new CacheManager) -#ifdef SDL_REMOTE_CONTROL , access_remote_(new AccessRemoteImpl( CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) -#endif // SDL_REMOTE_CONTROL , retry_sequence_timeout_(kDefaultRetryTimeoutInMSec) , retry_sequence_index_(0) , timer_retry_sequence_("Retry sequence timer", @@ -89,8 +84,7 @@ PolicyManagerImpl::PolicyManagerImpl() , retry_sequence_url_(0, 0, "") , wrong_ptu_update_received_(false) , send_on_update_sent_out_(false) - , trigger_ptu_(false) { -} + , trigger_ptu_(false) {} void PolicyManagerImpl::set_listener(PolicyListener* listener) { listener_ = listener; @@ -423,12 +417,16 @@ void PolicyManagerImpl::CheckPermissions(const PTString& device_id, "CheckPermissions for " << app_id << " and rpc " << rpc << " for " << hmi_level << " level."); -#ifdef SDL_REMOTE_CONTROL ApplicationOnDevice who = {device_id, app_id}; - const policy_table::Strings& groups = access_remote_->GetGroups(who); -#else // SDL_REMOTE_CONTROL - const policy_table::Strings& groups = cache_->GetGroups(app_id); -#endif // SDL_REMOTE_CONTROL + policy_table::Strings groups; + if (access_remote_->IsAppRemoteControl(who)) { + groups = access_remote_->GetGroups(who); + LOG4CXX_INFO(logger_, + "CheckPermissions for " << app_id << " and rpc " << rpc + << " for " << hmi_level << " level."); + } else { + groups = cache_->GetGroups(app_id); + } cache_->CheckPermissions(groups, hmi_level, rpc, result); if (cache_->IsApplicationRevoked(app_id)) { @@ -484,13 +482,11 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( std::string default_hmi; default_hmi = "NONE"; -#ifdef SDL_REMOTE_CONTROL const ApplicationOnDevice who = {device_id, application_id}; if (access_remote_->IsAppRemoteControl(who)) { listener()->OnPermissionsUpdated(application_id, notification_data); return; } -#endif // SDL_REMOTE_CONTROL listener()->OnPermissionsUpdated( application_id, notification_data, default_hmi); @@ -728,14 +724,15 @@ void PolicyManagerImpl::GetPermissionsForApp( } FunctionalIdType group_types; -#ifdef SDL_REMOTE_CONTROL - allowed_by_default = false; - bool ret = access_remote_->GetPermissionsForApp( - device_id, policy_app_id, group_types); -#else - bool ret = - cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types); -#endif // REMOTE_CONTROL + const ApplicationOnDevice who = {device_id, app_id_to_check}; + bool ret = false; + if (access_remote_->IsAppRemoteControl(who)) { + allowed_by_default = false; + ret = access_remote_->GetPermissionsForApp( + device_id, policy_app_id, group_types); + } else { + ret = cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types); + } if (!ret) { LOG4CXX_WARN(logger_, @@ -1188,7 +1185,6 @@ void PolicyManagerImpl::RetrySequence() { timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); } -#ifdef SDL_REMOTE_CONTROL void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id, const std::vector& hmi_types) { LOG4CXX_INFO(logger_, "SetDefaultHmiTypes"); @@ -1294,6 +1290,5 @@ void PolicyManagerImpl::set_access_remote( utils::SharedPtr access_remote) { access_remote_ = access_remote; } -#endif // SDL_REMOTE_CONTROL } // namespace policy diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 1dae9c5f96..2949ef315b 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -621,7 +621,6 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { } } -#ifdef SDL_REMOTE_CONTROL bool IsValidEnum(ModuleType val) { switch (val) { case MT_CLIMATE: @@ -654,7 +653,6 @@ bool EnumFromJsonString(const std::string& literal, ModuleType* result) { return false; } } -#endif // SDL_REMOTE_CONTROL const std::string kDefaultApp = "default"; const std::string kPreDataConsentApp = "pre_DataConsent"; diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index c4846c0d40..c983e4f12b 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -168,11 +168,7 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) , certificate(impl::ValueMember(value__, "certificate"), "not_specified") -#ifdef SDL_REMOTE_CONTROL - , moduleType(impl::ValueMember(value__, "moduleType")) -#endif // SDL_REMOTE_CONTROL -{ -} + , moduleType(impl::ValueMember(value__, "moduleType")) {} Json::Value ApplicationParams::ToJsonValue() const { Json::Value result__(PolicyBase::ToJsonValue()); @@ -184,9 +180,7 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField("memory_kb", memory_kb, &result__); impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); -#ifdef SDL_REMOTE_CONTROL impl::WriteJsonField("moduleType", moduleType, &result__); -#endif // SDL_REMOTE_CONTROL return result__; } @@ -215,11 +209,9 @@ bool ApplicationParams::is_valid() const { if (!certificate.is_valid()) { return false; } -#ifdef SDL_REMOTE_CONTROL if (!moduleType.is_valid()) { return false; } -#endif // SDL_REMOTE_CONTROL return Validate(); } @@ -255,11 +247,9 @@ bool ApplicationParams::struct_empty() const { if (certificate.is_initialized()) { return false; } -#ifdef SDL_REMOTE_CONTROL if (moduleType.is_initialized()) { return false; } -#endif // SDL_REMOTE_CONTROL return true; } @@ -295,11 +285,9 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { if (!certificate.is_valid()) { certificate.ReportErrors(&report__->ReportSubobject("certificate")); } -#ifdef SDL_REMOTE_CONTROL if (!moduleType.is_valid()) { moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); } -#endif // SDL_REMOTE_CONTROL } void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { @@ -311,9 +299,7 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); certificate.SetPolicyTableType(pt_type); -#ifdef SDL_REMOTE_CONTROL moduleType.SetPolicyTableType(pt_type); -#endif // SDL_REMOTE_CONTROL } // RpcParameters methods diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc index e760293ea6..714dfaae5a 100644 --- a/src/components/policy/policy_regular/src/policy_table/validation.cc +++ b/src/components/policy/policy_regular/src/policy_table/validation.cc @@ -147,7 +147,6 @@ bool ApplicationPoliciesSection::Validate() const { return true; } -#ifdef SDL_REMOTE_CONTROL bool ApplicationParams::ValidateModuleTypes() const { // moduleType is optional so see Optional::is_valid() bool is_initialized = moduleType->is_initialized(); @@ -181,11 +180,6 @@ bool ApplicationParams::ValidateModuleTypes() const { bool ApplicationParams::Validate() const { return ValidateModuleTypes(); } -#else // SDL_REMOTE_CONTROL -bool ApplicationParams::Validate() const { - return true; -} -#endif // SDL_REMOTE_CONTROL bool RpcParameters::Validate() const { return true; diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index a57230aeb1..b1e574578e 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -723,7 +723,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( if (!GatherAppGroup(app_id, ¶ms.groups)) { return false; } -#ifdef SDL_REMOTE_CONTROL bool denied = false; if (!GatherRemoteControlDenied(app_id, &denied)) { return false; @@ -733,7 +732,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( return false; } } -#endif // SDL_REMOTE_CONTROL if (!GatherNickName(app_id, &*params.nicknames)) { return false; } @@ -905,12 +903,10 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( LOG4CXX_WARN(logger_, "Incorrect delete from app_group."); return false; } -#ifdef SDL_REMOTE_CONTROL if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); return false; } -#endif // SDL_REMOTE_CONTROL if (!query_delete.Exec(sql_pt::kDeleteApplication)) { LOG4CXX_WARN(logger_, "Incorrect delete from application."); return false; @@ -998,13 +994,11 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( if (!SaveAppGroup(app.first, app.second.groups)) { return false; } -#ifdef SDL_REMOTE_CONTROL bool denied = !app.second.moduleType->is_initialized(); if (!SaveRemoteControlDenied(app.first, denied) || !SaveModuleType(app.first, *app.second.moduleType)) { return false; } -#endif // SDL_REMOTE_CONTROL if (!SaveNickname(app.first, *app.second.nicknames)) { return false; } @@ -1671,8 +1665,6 @@ bool SQLPTRepresentation::GatherAppGroup( return true; } -#ifdef SDL_REMOTE_CONTROL - bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, bool* denied) const { LOG4CXX_AUTO_TRACE(logger_); @@ -1862,7 +1854,6 @@ bool SQLPTRepresentation::GatherRemoteRpc( } return true; } -#endif // SDL_REMOTE_CONTROL bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id, bool is_revoked, diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt index 62ff691f83..bd6af96867 100644 --- a/src/components/policy/policy_regular/test/CMakeLists.txt +++ b/src/components/policy/policy_regular/test/CMakeLists.txt @@ -45,11 +45,6 @@ include_directories( ) collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}") -if (NOT REMOTE_CONTROL) - list (REMOVE_ITEM SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/access_remote_impl_test.cc - ) -endif () set(LIBRARIES gmock diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index 5fd0a48f7c..e4e361c52c 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -53,9 +53,8 @@ #include "utils/date_time.h" #include "utils/make_shared.h" #include "utils/gen_hash.h" -#ifdef SDL_REMOTE_CONTROL #include "policy/mock_access_remote.h" -#endif // SDL_REMOTE_CONTROL + using ::testing::ReturnRef; using ::testing::DoAll; using ::testing::SetArgReferee; @@ -146,20 +145,15 @@ class PolicyManagerImplTest : public ::testing::Test { MockCacheManagerInterface* cache_manager; NiceMock listener; const std::string device_id; -#ifdef SDL_REMOTE_CONTROL utils::SharedPtr access_remote; -#endif // SDL_REMOTE_CONTROL void SetUp() OVERRIDE { manager = new PolicyManagerImpl(); manager->set_listener(&listener); cache_manager = new MockCacheManagerInterface(); manager->set_cache_manager(cache_manager); - -#ifdef SDL_REMOTE_CONTROL access_remote = new access_remote_test::MockAccessRemote(); manager->set_access_remote(access_remote); -#endif // SDL_REMOTE_CONTROL } void TearDown() OVERRIDE { diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt index e55d67d876..bb33857ecd 100644 --- a/src/components/telemetry_monitor/CMakeLists.txt +++ b/src/components/telemetry_monitor/CMakeLists.txt @@ -39,7 +39,6 @@ include_directories ( ${COMPONENTS_DIR}/connection_handler/include/ ${COMPONENTS_DIR}/transport_manager/include/ ${COMPONENTS_DIR}/application_manager/include/ - ${COMPONENTS_DIR}/remote_control/include/ ${POLICY_PATH}/include/ ${POLICY_GLOBAL_INCLUDE_PATH}/ ${COMPONENTS_DIR}/rpc_base/include/ -- cgit v1.2.1