From 00aa63e09f522039d36896d1af13e774fff2a1fe Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Mon, 24 Mar 2014 15:58:58 +0200 Subject: [PATCH] APPLINK-6388 APPLINK-6150 HMI: OnAppRegistered new param resume Some potential bugs fixed --- .../include/application_manager/message_helper.h | 2 +- src/components/application_manager/src/application_manager_impl.cc | 5 ++--- .../src/commands/mobile/register_app_interface_request.cc | 7 +++---- src/components/application_manager/src/message_helper.cc | 6 +++++- src/components/interfaces/HMI_API.xml | 5 +++++ src/components/interfaces/QT_HMI_API.xml | 5 +++++ 6 files changed, 21 insertions(+), 9 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 07967c6..3a9ed2e 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -141,7 +141,7 @@ class MessageHelper { * **/ static void SendOnAppRegisteredNotificationToHMI( - const Application& application_impl); + const Application& application_impl, bool resumption = false); /** * @brief Create mobile HashUpdateNotification diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 8463d39..998ffa5 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -391,10 +391,10 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::PutApplicationInLimited( if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_FULL) { if (curr_app->is_media_application()) { result = mobile_api::HMILevel::HMI_BACKGROUND; + break; } else { result = mobile_api::HMILevel::HMI_LIMITED; } - break; } } @@ -420,10 +420,10 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::PutApplicationInFull( if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_FULL) { if (curr_app->is_media_application()) { result = mobile_api::HMILevel::HMI_BACKGROUND; + break; } else { result = mobile_api::HMILevel::HMI_LIMITED; } - break; } if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) { result = mobile_api::HMILevel::HMI_BACKGROUND; @@ -436,7 +436,6 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::PutApplicationInFull( } if (curr_app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) { result = mobile_api::HMILevel::HMI_FULL; - break; } } } 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 2ca5c58..e838e53 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 @@ -142,8 +142,6 @@ void RegisterAppInterfaceRequest::Run() { } } } - - MessageHelper::SendOnAppRegisteredNotificationToHMI(*app); SendRegisterAppInterfaceResponseToMobile(); } @@ -332,7 +330,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( uint32_t hash_id = 0; const char* add_info = ""; - if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) { + bool resumption = (*message_)[strings::msg_params].keyExists(strings::hash_id); + if (resumption) { hash_id = (*message_)[strings::msg_params][strings::hash_id].asUInt(); const std::string& mobile_app_id = (*application->mobile_app_id()).asString(); @@ -349,7 +348,7 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( add_info = " Resume Succesed"; } } - + MessageHelper::SendOnAppRegisteredNotificationToHMI(*(application.get()), resumption); SendResponse(true, result, add_info, params); if (result != mobile_apis::Result::RESUME_FAILED) { resumer.StartResumption(application, hash_id); diff --git a/src/components/application_manager/src/message_helper.cc b/src/components/application_manager/src/message_helper.cc index a070aa3..078f6b6 100644 --- a/src/components/application_manager/src/message_helper.cc +++ b/src/components/application_manager/src/message_helper.cc @@ -200,7 +200,7 @@ void MessageHelper::SendHMIStatusNotification( } void MessageHelper::SendOnAppRegisteredNotificationToHMI( - const Application& application_impl) { + const Application& application_impl, bool resumption ) { smart_objects::SmartObject* notification = new smart_objects::SmartObject; if (!notification) { // TODO(VS): please add logger. @@ -219,6 +219,10 @@ void MessageHelper::SendOnAppRegisteredNotificationToHMI( const smart_objects::SmartObject* ngn_media_screen_name = application_impl.ngn_media_screen_name(); + if (resumption) { + message[strings::msg_params][strings::resumption] = true; + } + if (ngn_media_screen_name) { message[strings::msg_params][strings::application] [strings::ngn_media_screen_app_name] = *ngn_media_screen_name; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 11d0955..bb57182 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1863,6 +1863,11 @@ May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands) + + + The information about resumption application. + + Issued by SDL to notify HMI about application unregistered. Application then to be removed from application list; all data connected with application has to be cleared up. diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml index 6862457..fedc8ed 100644 --- a/src/components/interfaces/QT_HMI_API.xml +++ b/src/components/interfaces/QT_HMI_API.xml @@ -1870,6 +1870,11 @@ May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands) + + + The information about resumption application. + + Issued by SDL to notify HMI about application unregistered. Application then to be removed from application list; all data connected with application has to be cleared up. -- 2.7.4