summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAGaliuzov <AGaliuzov@luxoft.com>2015-09-25 17:00:15 +0300
committerAGaliuzov <AGaliuzov@luxoft.com>2015-09-25 17:00:15 +0300
commit1c997837f63833c13026def2f4c6a468f2553a7e (patch)
tree78ad73094f394fb69a7002156437ee972d1f60f0
parent7833169b7db8ebec30201d6d081a5f308244c799 (diff)
parentc9f8988d4669c40221d1bde18bba464d8b4724bc (diff)
downloadsmartdevicelink-1c997837f63833c13026def2f4c6a468f2553a7e.tar.gz
Merge pull request #207 from LuxoftSDL/hotfix/Fix_HMI_level_setting_on_RAI
Fixes setting of HMI level for consequtive permissions validation.
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc19
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc6
-rw-r--r--src/components/application_manager/src/resume_ctrl.cpp4
3 files changed, 14 insertions, 15 deletions
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 11c53f6bd..ac6971ac3 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
@@ -493,21 +493,26 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
}
- // By default app subscribed to CUSTOM_BUTTON
- // Need to send notification to HMI
- SendSubscribeCustomButtonNotification();
-
- MessageHelper::SendChangeRegistrationRequestToHMI(application);
-
- SendResponse(true, result, add_info.c_str(), &response_params);
MessageHelper::SendOnAppRegisteredNotificationToHMI(*(application.get()),
resumption,
need_restore_vr);
+
+ SendResponse(true, result, add_info.c_str(), &response_params);
+
+ // Default HMI level should be set before any permissions validation, since it
+ // relies on HMI level.
+ resumer.SetupDefaultHMILevel(application);
+
if (result != mobile_apis::Result::RESUME_FAILED) {
resumer.StartResumption(application, hash_id);
} else {
resumer.StartResumptionOnlyHMILevel(application);
}
+
+ // By default app subscribed to CUSTOM_BUTTON
+ // Need to send notification to HMI
+ SendSubscribeCustomButtonNotification();
+ MessageHelper::SendChangeRegistrationRequestToHMI(application);
}
mobile_apis::Result::eType
diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
index 25de8d3ef..b31879585 100644
--- a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
+++ b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc
@@ -60,16 +60,14 @@ void RegisterAppInterfaceResponse::Run() {
// Add registered application to the policy db right after response sent to
// mobile to be able to check all other API according to app permissions
- uint32_t connection_key =
- (*message_)[strings::params][strings::connection_key].asUInt();
application_manager::ApplicationConstSharedPtr app =
application_manager::ApplicationManagerImpl::instance()->
- application(connection_key);
+ application(connection_key());
if (app.valid()) {
policy::PolicyHandler *policy_handler = policy::PolicyHandler::instance();
std::string mobile_app_id = app->mobile_app_id();
policy_handler->AddApplication(mobile_app_id);
- SetHeartBeatTimeout(connection_key, mobile_app_id);
+ SetHeartBeatTimeout(connection_key(), mobile_app_id);
}
}
diff --git a/src/components/application_manager/src/resume_ctrl.cpp b/src/components/application_manager/src/resume_ctrl.cpp
index 6dd46aa3d..19cad8013 100644
--- a/src/components/application_manager/src/resume_ctrl.cpp
+++ b/src/components/application_manager/src/resume_ctrl.cpp
@@ -451,8 +451,6 @@ bool ResumeCtrl::StartResumption(ApplicationSharedPtr application,
return false;
}
- SetupDefaultHMILevel(application);
-
LOG4CXX_DEBUG(logger_, " Resume app_id = " << application->app_id()
<< " hmi_app_id = " << application->hmi_app_id()
<< " mobile_id = " << application->mobile_app_id()
@@ -544,8 +542,6 @@ bool ResumeCtrl::StartResumptionOnlyHMILevel(ApplicationSharedPtr application) {
return false;
}
- SetupDefaultHMILevel(application);
-
LOG4CXX_DEBUG(logger_, "ENTER app_id = " << application->app_id()
<< "mobile_id = "
<< application->mobile_app_id());