summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhdanovP <pzhdanov@luxoft.com>2018-09-06 19:22:21 +0300
committerAndriy Byzhynar <abyzhynar@luxoft.com>2018-09-17 16:53:28 +0300
commit81078873a00a0a9253ee13372f89a1760283cc09 (patch)
tree6affb2fa16b3ce4e26be1cdd53a990131147c630
parent0d397fa6dc01a53d56665080308f2f3cf8e7e02b (diff)
downloadsdl_core-81078873a00a0a9253ee13372f89a1760283cc09.tar.gz
HMI does not respond during timeout
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h6
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc29
2 files changed, 30 insertions, 5 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
index 753502eb8b..6e21a0416a 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h
@@ -84,6 +84,11 @@ class RegisterAppInterfaceRequest
virtual void Run();
/**
+ * @brief onTimeOut from requrst Controller
+ **/
+ void onTimeOut() OVERRIDE;
+
+ /**
* @brief Prepares and sends RegisterAppInterface response to mobile
* considering application type
**/
@@ -292,6 +297,7 @@ class RegisterAppInterfaceRequest
*/
void CheckLanguage();
+ bool is_data_resumption_;
std::string response_info_;
mobile_apis::Result::eType result_code_;
DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest);
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
index 96fa8cd70a..133ea2c5ea 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
@@ -184,6 +184,7 @@ RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
rpc_service,
hmi_capabilities,
policy_handler)
+ , is_data_resumption_(false)
, result_code_(mobile_apis::Result::INVALID_ENUM) {}
RegisterAppInterfaceRequest::~RegisterAppInterfaceRequest() {}
@@ -421,6 +422,18 @@ RegisterAppInterfaceRequest::ApplicationDataShouldBeResumed() {
return DataResumeResult::RESUME_DATA;
}
+void RegisterAppInterfaceRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!is_data_resumption_) {
+ app_mngr::commands::CommandRequestImpl::onTimeOut();
+ return;
+ }
+ result_code_ = mobile_api::Result::RESUME_FAILED;
+ const std::string info = "HMI does not respond during timeout.";
+ SendRegisterAppInterfaceResponseToMobile(
+ ApplicationType::kNewApplication, info, true);
+}
+
void RegisterAppInterfaceRequest::Run() {
using namespace helpers;
LOG4CXX_AUTO_TRACE(logger_);
@@ -561,6 +574,7 @@ void RegisterAppInterfaceRequest::Run() {
application_manager_.GetPluginManager().ForEachPlugin(on_app_registered);
if (DataResumeResult::RESUME_DATA == resume_data_result) {
+ is_data_resumption_ = true;
auto& resume_ctrl = application_manager_.resume_controller();
const auto& msg_params = (*message_)[strings::msg_params];
const auto& hash_id = msg_params[strings::hash_id].asString();
@@ -794,7 +808,8 @@ void FinishSendingRegisterAppInterfaceToMobile(
&(msg_params[strings::app_hmi_type]));
}
- // Default HMI level should be set before any permissions validation, since it
+ // Default HMI level should be set before any permissions validation, since
+ // it
// relies on HMI level.
app_manager.OnApplicationRegistered(application);
(*notify_upd_manager)();
@@ -820,11 +835,14 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
ApplicationSharedPtr application = application_manager_.application(key);
response_params[strings::sync_msg_version][strings::major_version] =
- major_version; // From generated file interfaces/generated_msg_version.h
+ major_version; // From generated file
+ // interfaces/generated_msg_version.h
response_params[strings::sync_msg_version][strings::minor_version] =
- minor_version; // From generated file interfaces/generated_msg_version.h
+ minor_version; // From generated file
+ // interfaces/generated_msg_version.h
response_params[strings::sync_msg_version][strings::patch_version] =
- patch_version; // From generated file interfaces/generated_msg_version.h
+ patch_version; // From generated file
+ // interfaces/generated_msg_version.h
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
@@ -1232,7 +1250,8 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
// If AppHMIType is not included in policy - allow any type
if (!app_hmi_types.empty()) {
if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
- // If AppHmiTypes are partially same, the system should allow those listed
+ // If AppHmiTypes are partially same, the system should allow those
+ // listed
// in the policy table and send warning info on missed values
smart_objects::SmartArray app_types =
*(message[strings::msg_params][strings::app_hmi_type].asArray());