From: Andrey Oleynik Date: Wed, 9 Apr 2014 09:13:16 +0000 (+0300) Subject: APPLINK-6609. OnSystemInfoChanged info saving to policy table was added. X-Git-Tag: 3.5~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a660b1335125430eacbcfd2f47d892425ae304d;p=profile%2Fivi%2Fsmartdevicelink.git APPLINK-6609. OnSystemInfoChanged info saving to policy table was added. --- 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 83382b8..93cc880 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 @@ -172,6 +172,12 @@ class PolicyHandler : public utils::Singleton, void OnCurrentDeviceIdUpdateRequired(const std::string& policy_app_id); /** + * @brief Set parameters from OnSystemInfoChanged to policy table + * @param language System language + */ + void OnSystemInfoChanged(const std::string& language); + + /** * Adds statistics info * @param type type of info */ diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index 14ad5aa..cc1ce09 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -68,6 +68,7 @@ #include "application_manager/commands/hmi/on_exit_application_notification.h" #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/close_popup_request.h" #include "application_manager/commands/hmi/close_popup_response.h" #include "application_manager/commands/hmi/button_get_capabilities_request.h" @@ -1057,6 +1058,10 @@ CommandSharedPtr HMICommandFactory::CreateCommand( command.reset(new commands::OnIgnitionCycleOverNotification(message)); break; } + case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: { + command.reset(new commands::OnSystemInfoChangedNotification(message)); + break; + } case hmi_apis::FunctionID::BasicCommunication_PlayTone: { command.reset(new commands::OnPlayToneNotification(message)); break; diff --git a/src/components/application_manager/src/message_helper.cc b/src/components/application_manager/src/message_helper.cc index d8b692d..929c320 100644 --- a/src/components/application_manager/src/message_helper.cc +++ b/src/components/application_manager/src/message_helper.cc @@ -67,7 +67,7 @@ hmi_apis::Common_Language::eType ToCommonLanguage( return hmi_apis::Common_Language::eType(lang_val); } -} +} // namespase namespace application_manager { @@ -169,6 +169,62 @@ namespace { } #endif // #ifdef HMI_DBUS_API +std::string MessageHelper::CommonLanguageToString( + hmi_apis::Common_Language::eType language) { + switch (language) { + case hmi_apis::Common_Language::EN_US: + return "en-us"; + case hmi_apis::Common_Language::ES_MX: + return "es-mx"; + case hmi_apis::Common_Language::FR_CA: + return "fr-ca"; + case hmi_apis::Common_Language::DE_DE: + return "de-de"; + case hmi_apis::Common_Language::ES_ES: + return "es-es"; + case hmi_apis::Common_Language::EN_GB: + return "en-gb"; + case hmi_apis::Common_Language::RU_RU: + return "ru-ru"; + case hmi_apis::Common_Language::TR_TR: + return "tr-tr"; + case hmi_apis::Common_Language::PL_PL: + return "pl-pl"; + case hmi_apis::Common_Language::FR_FR: + return "fr-fr"; + case hmi_apis::Common_Language::IT_IT: + return "it-it"; + case hmi_apis::Common_Language::SV_SE: + return "sv-se"; + case hmi_apis::Common_Language::PT_PT: + return "pt-pt"; + case hmi_apis::Common_Language::NL_NL: + return "nl-nl"; + case hmi_apis::Common_Language::EN_AU: + return "en-au"; + case hmi_apis::Common_Language::ZH_CN: + return "zh-cn"; + case hmi_apis::Common_Language::ZH_TW: + return "zh-tw"; + case hmi_apis::Common_Language::JA_JP: + return "ja-jp"; + case hmi_apis::Common_Language::AR_SA: + return "as-sa"; + case hmi_apis::Common_Language::KO_KR: + return "ko-kr"; + case hmi_apis::Common_Language::PT_BR: + return "pt-br"; + case hmi_apis::Common_Language::CS_CZ: + return "cs-cz"; + case hmi_apis::Common_Language::DA_DK: + return "da-dk"; + case hmi_apis::Common_Language::NO_NO: + return "no-no"; + default: + return ""; + } +} + void MessageHelper::SendHMIStatusNotification( const Application& application_impl) { smart_objects::SmartObject* notification = new smart_objects::SmartObject; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 66ab2aa..a8a2d32 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -318,6 +318,11 @@ void PolicyHandler::OnCurrentDeviceIdUpdateRequired( policy_manager_->UpdateCurrentDeviceId(device_param.device_mac_address); } +void PolicyHandler::OnSystemInfoChanged(const std::string& language) { + LOG4CXX_INFO(logger_, "OnSystemInfoChanged"); + policy_manager_->SetSystemLanguage(language); +} + void PolicyHandler::OnAppRevoked(const std::string& policy_app_id) { LOG4CXX_INFO(logger_, "OnAppRevoked"); if (!policy_manager_) { diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc index 410852f..5b395ef 100644 --- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc +++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc @@ -124,6 +124,7 @@ void MessageBrokerAdapter::SubscribeTo() { MessageBrokerController::subscribeTo("VR.Stopped"); MessageBrokerController::subscribeTo("BasicCommunication.OnSystemRequest"); MessageBrokerController::subscribeTo("BasicCommunication.OnIgnitionCycleOver"); + MessageBrokerController::subscribeTo("BasicCommunication.OnSystemInfoChanged"); MessageBrokerController::subscribeTo("SDL.OnAppPermissionConsent"); MessageBrokerController::subscribeTo("SDL.OnAllowSDLFunctionality"); diff --git a/src/components/policy b/src/components/policy index 2cbcce5..dcb8e5a 160000 --- a/src/components/policy +++ b/src/components/policy @@ -1 +1 @@ -Subproject commit 2cbcce5076e817009906a60de69474fc43352460 +Subproject commit dcb8e5a81ee4dbd771f5c3142a5c60132e12f608