void OnSystemInfoChanged(const std::string& language);
/**
+ * @brief Save data from GetSystemInfo request to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void OnGetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ /**
+ * @brief Send request to HMI to get update on system parameters
+ */
+ virtual void OnSystemInfoUpdateRequired();
+
+ /**
* Adds statistics info
* @param type type of info
*/
#include "application_manager/commands/hmi/on_put_file_notification.h"
#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/commands/hmi/get_system_info_request.h"
+#include "application_manager/commands/hmi/get_system_info_response.h"
#include "application_manager/commands/hmi/close_popup_request.h"
#include "application_manager/commands/hmi/close_popup_response.h"
#include "application_manager/commands/hmi/button_get_capabilities_request.h"
}
break;
}
+ case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
+ if (is_response) {
+ command.reset(new commands::GetSystemInfoResponse(message));
+ } else {
+ command.reset(new commands::GetSystemInfoRequest(message));
+ }
+ break;
+ }
case hmi_apis::FunctionID::SDL_ActivateApp: {
if (is_response) {
command.reset(new commands::SDLActivateAppResponse(message));
command.reset(new commands::UpdateSDLRequest(message));
}
break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAppPermissionChanged: {
- command.reset(new commands::OnAppPermissionChangedNotification(message));
- break;
- }
- case hmi_apis::FunctionID::BasicCommunication_OnAllowApp: {
- command.reset(new commands::OnAllowAppNotification(message));
- break;
- }*/
+ */
case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: {
command.reset(new commands::OnIgnitionCycleOverNotification(message));
break;
ApplicationManagerImpl::instance()->ManageHMICommand(message);
}
+void MessageHelper::SendGetSystemInfoRequest() {
+ smart_objects::SmartObject* message = new smart_objects::SmartObject(
+ smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
+
+ (*message)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_GetSystemInfo;
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] =
+ ApplicationManagerImpl::instance()->GetNextHMICorrelationID();
+ (*message)[strings::params][strings::protocol_version] =
+ commands::CommandImpl::protocol_version_;
+ (*message)[strings::params][strings::protocol_type] =
+ commands::CommandImpl::hmi_protocol_type_;
+
+ ApplicationManagerImpl::instance()->ManageHMICommand(message);
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
smart_objects::SmartObject& message, ApplicationConstSharedPtr app) {
if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == message.getType()) {
policy_manager_->SetSystemLanguage(language);
}
+void PolicyHandler::OnGetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) {
+ LOG4CXX_INFO(logger_, "OnGetSystemInfo");
+ policy_manager_->SetSystemInfo(ccpu_version, wers_country_code, language);
+}
+
+void PolicyHandler::OnSystemInfoUpdateRequired() {
+ LOG4CXX_INFO(logger_, "OnSystemInfoUpdateRequired");
+ application_manager::MessageHelper::SendGetSystemInfoRequest();
+}
+
void PolicyHandler::OnAppRevoked(const std::string& policy_app_id) {
LOG4CXX_INFO(logger_, "OnAppRevoked");
if (!policy_manager_) {
-Subproject commit bb04121e5d947c2cffb395b840d5faf83797d978
+Subproject commit a39fc98a0f29a115834c6acdad7288824e4b2e78