summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2018-11-29 17:30:43 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2018-11-30 09:44:35 -0500
commit5d8b46597fcded6c8c279733700f904d39248556 (patch)
treeb4381d9a2d625b7bb2a401bee188bcd7474e7b03
parente443110f744f0aa6ddc03e34a04d12cf556a10dd (diff)
downloadsdl_core-feature/cloud_app_test.tar.gz
Fix HMI Level resettingfeature/cloud_app_test
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc4
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc15
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc16
3 files changed, 16 insertions, 19 deletions
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 f8d3267441..b346ee5798 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
@@ -805,8 +805,6 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
file_system::FileExists(application->app_icon_path());
SendResponse(true, result_code, add_info.c_str(), &response_params);
- SendOnAppRegisteredNotificationToHMI(
- application, resumption, need_restore_vr);
if (msg_params.keyExists(strings::app_hmi_type)) {
GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
&(msg_params[strings::app_hmi_type]));
@@ -815,6 +813,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
// Default HMI level should be set before any permissions validation, since it
// relies on HMI level.
application_manager_.OnApplicationRegistered(application);
+ SendOnAppRegisteredNotificationToHMI(
+ application, resumption, need_restore_vr);
(*notify_upd_manager)();
// Start PTU after successfull registration
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index d2d2458ac0..938e994ba0 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -381,21 +381,6 @@ void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
plugin.OnApplicationEvent(plugin_manager::kApplicationRegistered, app);
};
plugin_manager_->ForEachPlugin(on_app_registered);
-
- // TODO(AOleynik): Is neccessary to be able to know that registration process
- // has been completed and default HMI level is set, otherwise policy will
- // block all the requests/notifications to mobile
- // APPLINK-20764 - introduce usage of internal events or re-implement
- event_engine::Event event(
- hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
-
- smart_objects::SmartObject msg;
- msg[strings::params][strings::message_type] =
- hmi_apis::messageType::notification;
- msg[strings::params][strings::app_id] = app->app_id();
-
- event.set_smart_object(msg);
- event.raise(event_dispatcher());
}
void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index 3e77078ee5..6af8826491 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -399,7 +399,13 @@ bool ResumeCtrlImpl::StartResumption(ApplicationSharedPtr application,
<< " hmi_app_id = " << application->hmi_app_id()
<< " policy_id = " << application->policy_app_id()
<< " received hash = " << hash);
- SetupDefaultHMILevel(application);
+ if (!application->is_cloud_app()) {
+ // Default HMI Level is already set before resumption in
+ // ApplicationManager::OnApplicationRegistered, and handling low bandwidth
+ // transports doesn't apply to cloud apps, so this step can be skipped for
+ // such apps
+ SetupDefaultHMILevel(application);
+ }
smart_objects::SmartObject saved_app;
const std::string& device_mac = application->mac_address();
bool result = resumption_storage_->GetSavedApplication(
@@ -426,7 +432,13 @@ bool ResumeCtrlImpl::StartResumptionOnlyHMILevel(
<< application->app_id() << "with hmi_app_id "
<< application->hmi_app_id() << ", policy_app_id "
<< application->policy_app_id());
- SetupDefaultHMILevel(application);
+ if (!application->is_cloud_app()) {
+ // Default HMI Level is already set before resumption in
+ // ApplicationManager::OnApplicationRegistered, and handling low bandwidth
+ // transports doesn't apply to cloud apps, so this step can be skipped for
+ // such apps
+ SetupDefaultHMILevel(application);
+ }
const std::string& device_mac = application->mac_address();
smart_objects::SmartObject saved_app;
bool result = resumption_storage_->GetSavedApplication(