diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/rc_rpc_plugin/include')
3 files changed, 27 insertions, 17 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager.h index cde7928a14..c8b99cc724 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager.h @@ -70,7 +70,7 @@ class RCConsentManager { virtual rc_rpc_plugin::rc_rpc_types::ModuleConsent GetModuleConsent( const std::string& app_id, const std::string& mac_address, - const rc_rpc_types::ModuleUid& module_id) const = 0; + const rc_rpc_types::ModuleUid& module_id) = 0; /** * @brief Remove modules consents from LastState if they exist diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h index b3c6a0b129..5cbc4b977e 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_consent_manager_impl.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_CONSENT_MANAGER_IMPL_H #include "rc_consent_manager.h" -#include "resumption/last_state.h" +#include "resumption/last_state_wrapper.h" #include "utils/lock.h" namespace Json { @@ -46,6 +46,12 @@ namespace rc_rpc_plugin { class RCConsentManagerImpl : public RCConsentManager { public: RCConsentManagerImpl( + resumption::LastStateWrapperPtr last_state, + application_manager::ApplicationManager& application_manager, + const uint32_t period_of_consent_expired); + + DEPRECATED + RCConsentManagerImpl( resumption::LastState& last_state, application_manager::ApplicationManager& application_manager, const uint32_t period_of_consent_expired); @@ -58,7 +64,7 @@ class RCConsentManagerImpl : public RCConsentManager { rc_rpc_types::ModuleConsent GetModuleConsent( const std::string& app_id, const std::string& mac_address, - const rc_rpc_types::ModuleUid& module_id) const OVERRIDE; + const rc_rpc_types::ModuleUid& module_id) OVERRIDE; void RemoveExpiredConsents() OVERRIDE; @@ -111,7 +117,7 @@ class RCConsentManagerImpl : public RCConsentManager { * In case the section is absent, will be appended a new empty section. * @return Remote Control section of LastState in Json */ - Json::Value& GetRemoteControlDataOrAppend() const; + Json::Value& GetRemoteControlDataOrAppend(Json::Value& last_state_data); /** * @brief Gets Device applications section for specified device mac adress @@ -119,8 +125,8 @@ class RCConsentManagerImpl : public RCConsentManager { * @param mac_aress Device MAC adress * @return Device applications section of LastState in Json */ - Json::Value& GetDeviceApplicationsOrAppend( - const std::string& mac_address) const; + Json::Value& GetDeviceApplicationsOrAppend(const std::string& mac_address, + Json::Value& last_state_data); /** * @brief Get AppConsentsList section of LastState for specified application. @@ -130,7 +136,8 @@ class RCConsentManagerImpl : public RCConsentManager { * @return AppConsentsList of LastState in Json */ Json::Value& GetAppConsentsListOrAppend(const std::string& policy_app_id, - const std::string& mac_address) const; + const std::string& mac_address, + Json::Value& last_state_data); /** * @brief Get Application consents section of Remote Control section of @@ -138,7 +145,7 @@ class RCConsentManagerImpl : public RCConsentManager { * is absent, will be created a new empty section * @return AppConsents section of RemoteControl section of LastState in Jason */ - Json::Value& GetAppsConsentsOrAppend() const; + Json::Value& GetAppsConsentsOrAppend(Json::Value& last_state_data); /** * @brief Get all module resource consents for specified application and @@ -149,14 +156,14 @@ class RCConsentManagerImpl : public RCConsentManager { * acquiring resource * @param module_type Module type with consents */ - Json::Value& GetModuleTypeConsentsOrAppend( - const std::string& policy_app_id, - const std::string& mac_address, - const std::string& module_type) const; + Json::Value& GetModuleTypeConsentsOrAppend(const std::string& policy_app_id, + const std::string& mac_address, + const std::string& module_type, + Json::Value& last_state_data); private: application_manager::ApplicationManager& app_manager_; - resumption::LastState& last_state_; + resumption::LastStateWrapperPtr last_state_; const uint32_t period_of_consent_expired_; mutable sync_primitives::Lock dictionary_control_lock_; mutable sync_primitives::Lock remote_control_lock_; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h index 1225feb67f..e12bd88e58 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h @@ -43,10 +43,6 @@ #include "rc_rpc_plugin/rc_consent_manager.h" #include "rc_rpc_plugin/resource_allocation_manager.h" -namespace resumption { -class LastState; -} - namespace rc_rpc_plugin { namespace plugins = application_manager::plugin_manager; namespace app_mngr = application_manager; @@ -65,6 +61,13 @@ class RCRPCPlugin : public plugins::RPCPlugin { app_mngr::rpc_service::RPCService& rpc_service, app_mngr::HMICapabilities& hmi_capabilities, policy::PolicyHandlerInterface& policy_handler, + resumption::LastStateWrapperPtr last_state) OVERRIDE; + + DEPRECATED + bool Init(app_mngr::ApplicationManager& app_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler, resumption::LastState& last_state) OVERRIDE; /** * @param int32_t command id |