diff options
author | Mick Wollman <mick.wollman@gmail.com> | 2015-02-18 13:29:09 -0500 |
---|---|---|
committer | Mick Wollman <mick.wollman@gmail.com> | 2015-02-18 13:29:09 -0500 |
commit | b2b2233d866f102d3de339afa8ccaf37d3cf2570 (patch) | |
tree | df193eb04eeebc342452e1d2e04aa3b3a496aa37 /src/components/application_manager | |
parent | e35533df5fa5080e8d1907b075478196beed039f (diff) | |
parent | 4ca94352560ef2578c80a58775fb837988769191 (diff) | |
download | sdl_core-b2b2233d866f102d3de339afa8ccaf37d3cf2570.tar.gz |
Merge branch 'feature/lock_screen_icon_url' into develop
Diffstat (limited to 'src/components/application_manager')
5 files changed, 47 insertions, 0 deletions
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 6bfc36e093..2fc69d8162 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -102,6 +102,16 @@ class MessageHelper { static smart_objects::SmartObject* GetHashUpdateNotification(const uint32_t app_id); /** + * @brief Create OnSystemRequest notification for lock screen icon url + */ + static smart_objects::SmartObject* GetLockScreenIconUrlNotification(const uint32_t connection_key); + + /** + * @brief Send the OnSystemRequest notification for lock screen icon url to the mobile device + */ + static void SendLockScreenIconUrlNotification(const uint32_t connection_key); + + /** * @brief Sends to mobile HashUpdateNotification */ static void SendHashUpdateNotification(const uint32_t app_id); 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 dfc29fe00a..1ded00f5f7 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 @@ -86,6 +86,7 @@ class PolicyHandler : StringArray* nicknames = NULL, StringArray* app_hmi_types = NULL); EndpointUrls GetUpdateUrls(int service_type); + std::string GetLockScreenIconUrl() const; void ResetRetrySequence(); int NextRetryTimeout(); int TimeoutExchange(); diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index a035e86f2d..f62e0d4b84 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -281,6 +281,10 @@ void RegisterAppInterfaceRequest::Run() { device_info); SendRegisterAppInterfaceResponseToMobile(); + + MessageHelper::SendLockScreenIconUrlNotification( + (*message_)[strings::params][strings::connection_key].asInt()); + policy::PolicyHandler::instance()->PTExchangeAtRegistration(mobile_app_id); } } diff --git a/src/components/application_manager/src/message_helper.cc b/src/components/application_manager/src/message_helper.cc index ffde928db6..8048b37dda 100644 --- a/src/components/application_manager/src/message_helper.cc +++ b/src/components/application_manager/src/message_helper.cc @@ -383,6 +383,33 @@ smart_objects::SmartObject* MessageHelper::GetHashUpdateNotification( return message; } +smart_objects::SmartObject* MessageHelper::GetLockScreenIconUrlNotification(const uint32_t connection_key) { + ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(connection_key); + DCHECK(app.get()); + + smart_objects::SmartObject* message = new smart_objects::SmartObject(smart_objects::SmartType_Map); + (*message)[strings::params][strings::function_id] = mobile_apis::FunctionID::OnSystemRequestID; + (*message)[strings::params][strings::connection_key] = connection_key; + (*message)[strings::params][strings::message_type] = mobile_apis::messageType::notification; + (*message)[strings::params][strings::protocol_type] = commands::CommandImpl::mobile_protocol_type_; + (*message)[strings::params][strings::protocol_version] = commands::CommandImpl::protocol_version_; + + (*message)[strings::msg_params][strings::request_type] = mobile_apis::RequestType::LOCK_SCREEN_ICON_URL; + + (*message)[strings::msg_params][strings::url] = policy::PolicyHandler::instance()->GetLockScreenIconUrl(); + + + return message; +} + +void MessageHelper::SendLockScreenIconUrlNotification(const uint32_t connection_key) { + LOG4CXX_INFO(logger_, "SendLockScreenIconUrlNotification"); + + smart_objects::SmartObject* so = GetLockScreenIconUrlNotification(connection_key); + PrintSmartObject(*so); + DCHECK(ApplicationManagerImpl::instance()->ManageMobileCommand(so)); +} + void MessageHelper::SendHashUpdateNotification(const uint32_t app_id) { LOG4CXX_INFO(logger_, "SendHashUpdateNotification"); diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 0033743e75..8e73b4bdf4 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1177,6 +1177,11 @@ EndpointUrls PolicyHandler::GetUpdateUrls(int service_type) { return policy_manager_->GetUpdateUrls(service_type); } +std::string PolicyHandler::GetLockScreenIconUrl() const { + POLICY_LIB_CHECK(std::string("")); + return policy_manager_->GetLockScreenIconUrl(); +} + void PolicyHandler::ResetRetrySequence() { POLICY_LIB_CHECK_VOID(); policy_manager_->ResetRetrySequence(); |