diff options
19 files changed, 365 insertions, 9 deletions
diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 8a75cd3dab..3c84fc96bd 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -533,6 +533,47 @@ }
}
},
+ "CloudApp":{
+ "rpcs":{
+ "SetCloudAppProperties":{
+ "hmi_levels":["BACKGROUND",
+ "FULL",
+ "LIMITED"]
+ },
+ "GetVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "OnVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "SubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ },
+ "UnsubscribeVehicleData": {
+ "hmi_levels": ["BACKGROUND",
+ "FULL",
+ "LIMITED"],
+ "parameters": [
+ "cloudAppVehicleID"
+ ]
+ }
+ }
+ },
"RemoteControl": {
"rpcs": {
"ButtonPress": {
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h new file mode 100644 index 0000000000..0c62b248b4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class SetCloudAppPropertiesRequest + : public app_mngr::commands::CommandRequestImpl { + public: + SetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesRequest(); + virtual void Run(); + virtual void on_event(const app_mngr::event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesRequest); +}; // SetCloudAppPropertiesRequest + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_REQUEST_H_
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h new file mode 100644 index 0000000000..9037cb3b73 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class SetCloudAppPropertiesResponse + : public app_mngr::commands::CommandResponseImpl { + public: + SetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesResponse(); + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesResponse); + +}; // SetCloudAppPropertiesResponse + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUDAPP_PROPERTIES_RESPONSE_H_
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc new file mode 100644 index 0000000000..ca5a46e3dc --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_request.cc @@ -0,0 +1,81 @@ +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + +SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {} +void SetCloudAppPropertiesRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + if ((*message_)[strings::msg_params].empty()) { + LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; + } + + smart_objects::SmartObject cloud_app_properties(smart_objects::SmartType_Map); + + cloud_app_properties[strings::msg_params][strings::app_name] = + (*message_)[strings::msg_params][strings::app_name]; + cloud_app_properties[strings::msg_params][strings::app_id] = + (*message_)[strings::msg_params][strings::app_id]; + + if ((*message_)[strings::msg_params].keyExists(strings::enabled)) { + smart_objects::SmartObject enabled = + (*message_)[strings::msg_params][strings::enabled]; + cloud_app_properties[strings::msg_params][strings::enabled] = enabled; + } + if ((*message_)[strings::msg_params].keyExists( + strings::cloud_app_auth_token)) { + smart_objects::SmartObject auth_token = + (*message_)[strings::msg_params][strings::cloud_app_auth_token]; + cloud_app_properties[strings::msg_params][strings::cloud_app_auth_token] = + auth_token; + } + if ((*message_)[strings::msg_params].keyExists( + strings::cloud_transport_type)) { + smart_objects::SmartObject transport_type = + (*message_)[strings::msg_params][strings::cloud_transport_type]; + cloud_app_properties[strings::msg_params][strings::cloud_transport_type] = + transport_type; + } + if ((*message_)[strings::msg_params].keyExists( + strings::hybrid_app_preference)) { + smart_objects::SmartObject hybrid_app_preference = + (*message_)[strings::msg_params][strings::hybrid_app_preference]; + cloud_app_properties[strings::msg_params][strings::hybrid_app_preference] = + hybrid_app_preference; + } + + policy_handler_.OnSetCloudAppProperties(cloud_app_properties); + SendResponse(true, mobile_apis::Result::SUCCESS); +} + +void SetCloudAppPropertiesRequest::on_event( + const app_mngr::event_engine::Event& event) { + LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event"); +} + +} // namespace commands +} // namespace sdl_rpc_plugin
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc new file mode 100644 index 0000000000..6acfb2423d --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloudapp_properties_response.cc @@ -0,0 +1,31 @@ +#include "application_manager/application_manager.h" +#include "application_manager/rpc_service.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + +SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse() {} + +void SetCloudAppPropertiesResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace sdl_rpc_plugins diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index 5207c7e432..dc5298813b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -124,6 +124,8 @@ #include "sdl_rpc_plugin/commands/mobile/dial_number_response.h" #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h" #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_request.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloudapp_properties_response.h" #include "interfaces/MOBILE_API.h" CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") @@ -337,6 +339,12 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator<commands::SendHapticDataRequest>() : factory.GetCreator<commands::SendHapticDataResponse>(); } + case mobile_apis::FunctionID::SetCloudAppPropertiesID: { + return mobile_api::messageType::request == message_type + ? factory.GetCreator<commands::SetCloudAppPropertiesRequest>() + : factory + .GetCreator<commands::SetCloudAppPropertiesResponse>(); + } case mobile_apis::FunctionID::OnButtonEventID: { return factory.GetCreator<commands::mobile::OnButtonEventNotification>(); } diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index e7af4b972e..c603659353 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -54,6 +54,7 @@ #include "interfaces/MOBILE_API.h" #include "utils/file_system.h" #include "utils/scope_guard.h" +#include "smart_objects/enum_schema_item.h" #include "utils/helpers.h" #include "policy/policy_manager.h" @@ -1921,10 +1922,16 @@ void PolicyHandler::OnSetCloudAppProperties( policy_app_id, msg_params[strings::cloud_transport_type].asString()); } if (msg_params.keyExists(strings::hybrid_app_preference)) { - // const std::string hybrid_app_preference = - // EnumConversionHelper<HybridAppPreference>::EnumToString(msg_params[strings::hybrid_app_preference]); - // policy_manager_->SetHybridAppPreference( - // policy_app_id, hybrid_app_preference); + std::string hybrid_app_preference; + + mobile_apis::HybridAppPreference::eType value = + static_cast<mobile_apis::HybridAppPreference::eType>( + msg_params[strings::hybrid_app_preference].asUInt()); + smart_objects::EnumConversionHelper< + mobile_apis::HybridAppPreference::eType>:: + EnumToString(value, &hybrid_app_preference); + policy_manager_->SetHybridAppPreference(policy_app_id, + hybrid_app_preference); } } 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 37c8a902f1..54dde0d8cf 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -554,7 +554,13 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; - + + /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 6ed42c3588..1707f65bad 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -545,6 +545,13 @@ <element name="VEHICLEDATA_CLOUDAPPVEHICLEID" since="5.1"/> </enum> + <enum name="HybridAppPreference" since="5.1"> + <description>Enumeration for the user's preference of which app type to use when both are available</description> + <element name = "MOBILE" /> + <element name = "CLOUD" /> + <element name = "BOTH" /> + </enum> + <enum name="ButtonName" since="1.0"> <description>Defines the hard (physical) and soft (touchscreen) buttons available from the module</description> <element name="OK" /> @@ -2609,6 +2616,7 @@ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" since="4.1" /> <element name="GetSystemCapabilityID" value="48" hexvalue="30" since="4.5" /> <element name="SendHapticDataID" value="49" hexvalue="31" since="4.5" /> + <element name="SetCloudAppPropertiesID" value="50" hexvalue="32" since="5.1" /> <!-- Base Notifications @@ -6626,6 +6634,51 @@ </param> </function> + <function name="SetCloudAppProperties" functionID="SetCloudAppPropertiesID" messagetype="request" since="5.1"> + <description> + RPC used to enable/disable a cloud application and set authentication data + </description> + <param name="appName" type="String" maxlength="100" mandatory="true"></param> + <param name="appID" type="String" maxlength="100" mandatory="true"></param> + <param name="enabled" type="Boolean" mandatory="false"> + <description>If true, cloud app will be included in HMI RPC UpdateAppList</description> + </param> + <param name="cloudAppAuthToken" type="String" maxlength="100" mandatory="false"> + <description>Used to authenticate websocket connection on app activation</description> + </param> + <param name="cloudTransportType" type="String" maxlength="100" mandatory="false"> + <description>Specifies the connection type Core should use</description> + </param> + <param name="hybridAppPreference" type="HybridAppPreference" mandatory="false"> + <description>Specifies the user preference to use the cloud app version or mobile app version when both are available</description> + </param> + </function> + + <function name="SetCloudAppProperties" functionID="SetCloudAppPropertiesID" messagetype="response" since="5.1"> + <description> + The response to registerAppInterface + </description> + <param name="success" type="Boolean" platform="documentation" mandatory="true"> + <description> true if successful; false if failed </description> + </param> + <param name="resultCode" type="Result" platform="documentation" mandatory="true"> + <description>See Result</description> + <element name="SUCCESS" /> + <element name="INVALID_DATA" /> + <element name="OUT_OF_MEMORY" /> + <element name="TOO_MANY_PENDING_REQUESTS" /> + <element name="GENERIC_ERROR" /> + <element name="DUPLICATE_NAME" /> + <element name="TOO_MANY_APPLICATIONS" /> + <element name="APPLICATION_REGISTERED_ALREADY" /> + <element name="UNSUPPORTED_VERSION" /> + <element name="WRONG_LANGUAGE" /> + <element name="DISALLOWED" /> + <element name="WARNINGS" /> + <element name="RESUME_FAILED" /> + </param> + </function> + <!-- Notifications --> <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification" since="1.0"> diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 98f279b345..e5258e36c8 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -189,6 +189,14 @@ class CacheManager : public CacheManagerInterface { std::string& auth_token, std::string& cloud_transport_type, std::string& hybrid_app_preference) const; + + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id); /** * @brief Enable or disable a cloud application in the HMI diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index 2a334876ae..aba3e32004 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -198,6 +198,14 @@ class CacheManagerInterface { std::string& cloud_transport_type, std::string& hybrid_app_preference) const = 0; + /** + * Initializes a new cloud application with default policies + * Then adds cloud specific policies + * @param app_id application id + * @return true if success + */ + virtual void InitCloudApp(const std::string& policy_app_id) = 0; + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state 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 6d4cbbf773..d9bec20791 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 @@ -603,6 +603,12 @@ class PolicyManagerImpl : public PolicyManager { std::string& hybrid_app_preference) const OVERRIDE; /** + * @ brief Initialize new cloud app in the policy table + * @ param policy_app_id Application ID + */ + void InitCloudApp(const std::string& policy_app_id) OVERRIDE; + + /** * @brief Enable or disable a cloud application in the HMI * @param enabled Cloud app enabled state */ diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h index dc2fdab2fa..5b494629bb 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h @@ -441,6 +441,11 @@ enum FunctionID { SendHapticDataID = 49, /** + * @brief SetCloudAppPropertiesID. + */ + SetCloudAppPropertiesID = 50, + + /** * @brief OnHMIStatusID. */ OnHMIStatusID = 32768, diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index dc0838d429..31f0f4110e 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1435,6 +1435,25 @@ void CacheManager::GetCloudAppParameters( } } +void CacheManager::InitCloudApp(const std::string& policy_app_id) { + CACHE_MANAGER_CHECK_VOID(); + sync_primitives::AutoLock auto_lock(cache_lock_); + + policy_table::ApplicationPolicies& policies = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator default_iter = + policies.find(kDefaultId); + policy_table::ApplicationPolicies::const_iterator app_iter = + policies.find(policy_app_id); + if (default_iter != policies.end()) { + if (app_iter == policies.end()){ + policies[policy_app_id] = policies[kDefaultId]; + } + } + //Add cloud app specific policies + Backup(); +} + void CacheManager::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { policy_table::ApplicationPolicies& policies = 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 df474268ba..1aa6776011 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -747,6 +747,10 @@ void PolicyManagerImpl::GetCloudAppParameters( hybrid_app_preference); } +void PolicyManagerImpl::InitCloudApp(const std::string& policy_app_id){ + cache_->InitCloudApp(policy_app_id); +} + void PolicyManagerImpl::SetCloudAppEnabled(const std::string& policy_app_id, const bool enabled) { cache_->SetCloudAppEnabled(policy_app_id, enabled); 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 48ce4d4f72..d7d5a241de 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -1121,6 +1121,11 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { return true; } + if ("SetCloudAppProperties" == literal) { + *result = SetCloudAppPropertiesID; + return true; + } + if ("OnHMIStatus" == literal) { *result = OnHMIStatusID; return true; diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h index fce6b7b865..563e822a36 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h @@ -427,6 +427,11 @@ enum FunctionID { SendHapticDataID = 49, /** + * @brief SetCloudAppPropertiesID. + */ + SetCloudAppPropertiesID = 50, + + /** * @brief OnHMIStatusID. */ OnHMIStatusID = 32768, 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 2ddf74af7e..91d0a6990f 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -847,6 +847,8 @@ bool IsValidEnum(FunctionID val) { return true; case SendHapticDataID: return true; + case SetCloudAppPropertiesID: + return true; case OnHMIStatusID: return true; case OnAppInterfaceUnregisteredID: @@ -994,6 +996,8 @@ const char* EnumToJsonString(FunctionID val) { return "GetSystemCapability"; case SendHapticDataID: return "SendHapticData"; + case SetCloudAppPropertiesID: + return "SetCloudAppProperties"; case OnHMIStatusID: return "OnHMIStatus"; case OnAppInterfaceUnregisteredID: @@ -1283,6 +1287,10 @@ bool EnumFromJsonString(const std::string& literal, FunctionID* result) { *result = SendHapticDataID; return true; } + if ("SetCloudAppProperties" == literal) { + *result = SetCloudAppPropertiesID; + return true; + } if ("OnHMIStatus" == literal) { *result = OnHMIStatusID; diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h index cbba5bd7cd..942b491927 100644 --- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h @@ -220,11 +220,10 @@ class EnumConversionHelper { static bool EnumToString(const EnumType value, std::string* str) { const char* cstr; - if (EnumToCString(value, &cstr)) { - return false; - } - if (str) { + bool success = EnumToCString(value, &cstr); + if (success && str) { *str = cstr; + return true; } return false; } |