summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc36
1 files changed, 21 insertions, 15 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 920805be7c..9a9aa0c533 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
@@ -134,11 +134,11 @@ RegisterAppInterfaceRequest::RegisterAppInterfaceRequest(
app_mngr::rpc_service::RPCService& rpc_service,
app_mngr::HMICapabilities& hmi_capabilities,
policy::PolicyHandlerInterface& policy_handler)
- : CommandRequestImpl(message,
- application_manager,
- rpc_service,
- hmi_capabilities,
- policy_handler)
+ : RequestFromMobileImpl(message,
+ application_manager,
+ rpc_service,
+ hmi_capabilities,
+ policy_handler)
, are_tts_chunks_invalid_(false)
, are_hmi_types_invalid_(false)
, is_resumption_failed_(false)
@@ -224,7 +224,8 @@ void RegisterAppInterfaceRequest::FillApplicationParams(
application->set_webengine_projection_enabled(true);
break;
}
- default: {}
+ default: {
+ }
}
}
}
@@ -439,6 +440,8 @@ void FinishSendingResponseToMobile(const smart_objects::SmartObject& msg_params,
&(msg_params[strings::app_hmi_type]));
}
+ application->MarkRegistered();
+
// Default HMI level should be set before any permissions validation, since
// it relies on HMI level.
app_manager.OnApplicationRegistered(application);
@@ -702,8 +705,11 @@ void RegisterAppInterfaceRequest::Run() {
SendOnAppRegisteredNotificationToHMI(
application, is_resumption_required && !is_resumption_failed_);
- // By default app subscribed to CUSTOM_BUTTON
- SendSubscribeCustomButtonNotification();
+ if (CheckHMICapabilities(mobile_apis::ButtonName::CUSTOM_BUTTON)) {
+ SDL_LOG_DEBUG("CUSTOM_BUTTON available");
+ SendSubscribeCustomButtonRequest();
+ }
+
SendChangeRegistrationOnHMI(application);
if (is_resumption_required) {
@@ -728,7 +734,6 @@ void RegisterAppInterfaceRequest::Run() {
}
CheckLanguage();
-
SendRegisterAppInterfaceResponseToMobile(
ApplicationType::kNewApplication, status_notifier, add_info);
}
@@ -983,12 +988,13 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
file_system::FileExists(application->app_icon_path());
smart_objects::SmartObject msg_params_copy = msg_params;
+ ApplicationManager& app_manager = application_manager_;
const auto result_code = CalculateFinalResultCode();
SendResponse(true, result_code, response_info_.c_str(), &response_params);
FinishSendingResponseToMobile(
- msg_params_copy, application_manager_, key, status_notifier);
+ msg_params_copy, app_manager, key, status_notifier);
}
void RegisterAppInterfaceRequest::SendChangeRegistration(
@@ -1459,14 +1465,14 @@ void RegisterAppInterfaceRequest::CheckResponseVehicleTypeParam(
}
}
-void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
+void RegisterAppInterfaceRequest::SendSubscribeCustomButtonRequest() {
+ SDL_LOG_AUTO_TRACE();
using namespace smart_objects;
SmartObject msg_params = SmartObject(SmartType_Map);
msg_params[strings::app_id] = connection_key();
- msg_params[strings::name] = hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
- msg_params[strings::is_suscribed] = true;
- CreateHMINotification(hmi_apis::FunctionID::Buttons_OnButtonSubscription,
- msg_params);
+ msg_params[strings::button_name] = hmi_apis::Common_ButtonName::CUSTOM_BUTTON;
+ SendHMIRequest(
+ hmi_apis::FunctionID::Buttons_SubscribeButton, &msg_params, false);
}
bool RegisterAppInterfaceRequest::IsApplicationSwitched() {