From fa179cbd5585a9d9cc9d55c580d8ddde7f8d68aa Mon Sep 17 00:00:00 2001 From: igapchuck Date: Sat, 1 Sep 2018 14:19:44 +0300 Subject: [PATCH 1/3] Fix does not send UnsubscribeVehicleData request to HMI after last unregister app. --- .../application_manager_impl.h | 11 ++++ .../application_manager/message_helper.h | 17 ++++++ .../src/application_manager_impl.cc | 61 +++++++++++++++++++ .../vi_unsubscribe_vehicle_data_request.cc | 1 - .../src/message_helper/message_helper.cc | 58 ++++++++++++++++-- .../src/mobile_command_factory.cc | 1 - 6 files changed, 142 insertions(+), 7 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index be52046888f..02903515c5e 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1235,6 +1235,17 @@ class ApplicationManagerImpl */ bool IsLowVoltage(); + /** + * @brief Selects vehicle data of specified application for unsubscribing + * according to subscriptions of other registered applications that also + * subscribed to vehicle data . + * @param app - pointer to application instance. + * @return vehicle_data_for_unscribe - collection with selected vehicle data + * to unsubscribe. + */ + application_manager::VehicleInfoSubscriptions SelectVehicleDataForUnsubscribe( + const app_mngr::ApplicationSharedPtr& application); + private: /* * NaviServiceStatusMap shows which navi service (audio/video) is opened 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 a423ea75079..0bc5eb9eedc 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -259,6 +259,23 @@ class MessageHelper { static smart_objects::SmartObjectList CreateAddCommandRequestToHMI( ApplicationConstSharedPtr app, ApplicationManager& app_mngr); + static smart_objects::SmartObjectSPtr CreateMessageForHMI( + hmi_apis::messageType::eType message_type, const uint32_t correlation_id); + + /** + * @brief Creates Message for sending to HMI for unsubscribe from specified + * VehicleData. Creates and returns message with vehicle data for unsubscribe. + * @param vehicle_data - collection with vehicle data types to unsubscribe. + * @param app - application which should be unsubscribed from specified + * vehicle data. + * @return - request filled with vehicle data params to unsubscribe + * ,application id and function id. + */ + static smart_objects::SmartObjectSPtr + CreateUnsubscribeVehicleDataMessageForHMI( + const VehicleInfoSubscriptions& vehicle_data, + const application_manager::ApplicationSharedPtr& app); + static smart_objects::SmartObjectList CreateAddVRCommandRequestFromChoiceToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr); diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 97dcce10bfc..ef2bf88e308 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2624,7 +2624,47 @@ void ApplicationManagerImpl::UnregisterApplication( } else { resume_controller().RemoveApplicationFromSaved(app_to_remove); } + + application_manager::VehicleInfoSubscriptions vehicle_data_for_unsubscribe = + SelectVehicleDataForUnsubscribe(app_to_remove); + auto message_to_hmi = + MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( + vehicle_data_for_unsubscribe, app_to_remove); + +#ifdef DEBUG + MessageHelper::PrintSmartObject(*message_to_hmi); +#endif + + CommandSharedPtr command = + HMICommandFactory::CreateCommand(message_to_hmi, *this); + if (!command) { + LOG4CXX_WARN(logger_, "Failed to create command from smart object"); + } + + int32_t message_type = + (*(message_to_hmi.get()))[strings::params][strings::message_type] + .asInt(); + + if (kRequest == message_type) { + LOG4CXX_DEBUG(logger_, "ManageHMICommand"); + request_ctrl_.addHMIRequest(command); + } + + if (command->Init()) { + command->Run(); + if (kResponse == message_type) { + const uint32_t correlation_id = + (*(message_to_hmi.get()))[strings::params][strings::correlation_id] + .asUInt(); + const int32_t function_id = + (*(message_to_hmi.get()))[strings::params][strings::function_id] + .asInt(); + request_ctrl_.OnHMIResponse(correlation_id, function_id); + } + } + applications_.erase(app_to_remove); + (hmi_capabilities_->get_hmi_language_handler()) .OnUnregisterApplication(app_id); AppV4DevicePredicate finder(handle); @@ -2849,6 +2889,27 @@ bool ApplicationManagerImpl::IsLowVoltage() { return is_low_voltage_; } +VehicleInfoSubscriptions +ApplicationManagerImpl::SelectVehicleDataForUnsubscribe( + const ApplicationSharedPtr& application) { + auto vehicle_data_for_unsubscribe = application->SubscribedIVI().GetData(); + auto vehicle_data_collector = + [this, &vehicle_data_for_unsubscribe, application]( + const std::uint32_t vehicle_data) { + for (auto& app : applications_) { + if (app->app_id() != application->app_id()) { + if (app->IsSubscribedToIVI(vehicle_data)) { + vehicle_data_for_unsubscribe.erase(vehicle_data); + } + } + } + }; + std::for_each(vehicle_data_for_unsubscribe.begin(), + vehicle_data_for_unsubscribe.end(), + vehicle_data_collector); + return vehicle_data_for_unsubscribe; +} + std::string ApplicationManagerImpl::GetHashedAppID( uint32_t connection_key, const std::string& mobile_app_id) const { uint32_t device_id = 0; diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc index 2211cde19ca..c1f517acd38 100644 --- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc @@ -44,7 +44,6 @@ VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {} void VIUnsubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - SendRequest(); } diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index a764c574d05..f8e6f4c34c4 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -39,8 +39,9 @@ #include #include #include -#include #include +#include +#include #include "application_manager/application.h" #include "application_manager/application_manager.h" @@ -1063,6 +1064,48 @@ smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI( return requests; } +smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI( + hmi_apis::messageType::eType message_type, const uint32_t correlation_id) { + auto message = new smart_objects::SmartObject(smart_objects::SmartType_Map); + auto& ref = *message; + + ref[strings::params][strings::message_type] = static_cast(message_type); + ref[strings::params][strings::protocol_version] = + commands::CommandImpl::protocol_version_; + ref[strings::params][strings::protocol_type] = + commands::CommandImpl::hmi_protocol_type_; + ref[strings::params][strings::correlation_id] = correlation_id; + return message; +} + +smart_objects::SmartObjectSPtr +MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( + const VehicleInfoSubscriptions& vehicle_data, + const application_manager::ApplicationSharedPtr& app) { + auto message_to_hmi = + CreateMessageForHMI(hmi_apis::messageType::request, app->app_id()); + (*message_to_hmi)[strings::params][strings::function_id] = + hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData; + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); + const VehicleData& v_data = MessageHelper::vehicle_data(); + + // This lambda puts data (as boolean) into message about needed vehicle + // data to unsubscribe, according to smart object keys. + auto vehicle_data_setter = [&msg_params, &v_data](const uint32_t v_type) { + for (const auto& item : v_data) { + if (item.second == v_type) { + msg_params[item.first] = true; + } + } + }; + + std::for_each(vehicle_data.begin(), vehicle_data.end(), vehicle_data_setter); + (*message_to_hmi)[strings::msg_params] = msg_params; + + return message_to_hmi; +} + smart_objects::SmartObjectList MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI( ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { @@ -1328,9 +1371,11 @@ void MessageHelper::SendOnAppUnregNotificationToHMI( hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered; message[strings::params][strings::message_type] = MessageType::kNotification; - // we put hmi_app_id because applicaton list does not contain application on + // we put hmi_app_id because applicaton list does not contain application + // on // this momment - // and ReplaceHMIByMobileAppId function will be unable to replace app_id to + // and ReplaceHMIByMobileAppId function will be unable to replace app_id + // to // hmi_app_id message[strings::msg_params][strings::app_id] = app->hmi_app_id(); message[strings::msg_params][strings::unexpected_disconnect] = @@ -2183,7 +2228,8 @@ mobile_apis::Result::eType MessageHelper::VerifyImage( smart_objects::SmartObject& image, ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - // Checking image type first: if STATIC - skip existence check, since it is + // Checking image type first: if STATIC - skip existence check, since it + // is // HMI related file and it should know it location const uint32_t image_type = image[strings::image_type].asUInt(); mobile_apis::ImageType::eType type = @@ -2447,7 +2493,9 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) { if (0 != tab) { --tab; } else { - printf("\n-------------------------------------------------------------\n"); + printf( + "\n-------------------------------------------------------------" + "\n"); } #endif return true; diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index 688bacf1ac0..3cc7de5de55 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -143,7 +143,6 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( commands::Command::CommandOrigin origin, ApplicationManager& application_manager) { CommandSharedPtr command; - switch ((*message)[strings::params][strings::function_id].asInt()) { case mobile_apis::FunctionID::RegisterAppInterfaceID: { if ((*message)[strings::params][strings::message_type] == From 5e67cdc87ff813894c0251022529df1eab8464a8 Mon Sep 17 00:00:00 2001 From: igapchuck Date: Mon, 3 Sep 2018 10:40:13 +0300 Subject: [PATCH 2/3] Add checking if needed to send UnsibscribeVehicle request. --- .../src/application_manager_impl.cc | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index ef2bf88e308..7dc90779dcb 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2627,39 +2627,43 @@ void ApplicationManagerImpl::UnregisterApplication( application_manager::VehicleInfoSubscriptions vehicle_data_for_unsubscribe = SelectVehicleDataForUnsubscribe(app_to_remove); - auto message_to_hmi = - MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( - vehicle_data_for_unsubscribe, app_to_remove); + + if (!vehicle_data_for_unsubscribe.empty()) { + auto message_to_hmi = + MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( + vehicle_data_for_unsubscribe, app_to_remove); #ifdef DEBUG - MessageHelper::PrintSmartObject(*message_to_hmi); + MessageHelper::PrintSmartObject(*message_to_hmi); #endif - CommandSharedPtr command = - HMICommandFactory::CreateCommand(message_to_hmi, *this); - if (!command) { - LOG4CXX_WARN(logger_, "Failed to create command from smart object"); - } + CommandSharedPtr command = + HMICommandFactory::CreateCommand(message_to_hmi, *this); + if (!command) { + LOG4CXX_WARN(logger_, "Failed to create command from smart object"); + } - int32_t message_type = - (*(message_to_hmi.get()))[strings::params][strings::message_type] - .asInt(); + int32_t message_type = + (*(message_to_hmi.get()))[strings::params][strings::message_type] + .asInt(); - if (kRequest == message_type) { - LOG4CXX_DEBUG(logger_, "ManageHMICommand"); - request_ctrl_.addHMIRequest(command); - } + if (kRequest == message_type) { + LOG4CXX_DEBUG(logger_, "ManageHMICommand"); + request_ctrl_.addHMIRequest(command); + } - if (command->Init()) { - command->Run(); - if (kResponse == message_type) { - const uint32_t correlation_id = - (*(message_to_hmi.get()))[strings::params][strings::correlation_id] - .asUInt(); - const int32_t function_id = - (*(message_to_hmi.get()))[strings::params][strings::function_id] - .asInt(); - request_ctrl_.OnHMIResponse(correlation_id, function_id); + if (command->Init()) { + command->Run(); + if (kResponse == message_type) { + const uint32_t correlation_id = + (*(message_to_hmi + .get()))[strings::params][strings::correlation_id] + .asUInt(); + const int32_t function_id = + (*(message_to_hmi.get()))[strings::params][strings::function_id] + .asInt(); + request_ctrl_.OnHMIResponse(correlation_id, function_id); + } } } From 36b0eadff97e5756477026c3d51f33e575f5d77a Mon Sep 17 00:00:00 2001 From: igapchuck Date: Mon, 3 Sep 2018 15:25:05 +0300 Subject: [PATCH 3/3] Answer to PR. --- .../application_manager_impl.h | 10 ++- .../application_manager/message_helper.h | 12 +++- .../src/application_manager_impl.cc | 64 +++++++------------ .../vi_unsubscribe_vehicle_data_request.cc | 1 + .../src/message_helper/message_helper.cc | 29 ++++----- .../src/mobile_command_factory.cc | 1 + 6 files changed, 57 insertions(+), 60 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 02903515c5e..b793837309d 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1244,7 +1244,15 @@ class ApplicationManagerImpl * to unsubscribe. */ application_manager::VehicleInfoSubscriptions SelectVehicleDataForUnsubscribe( - const app_mngr::ApplicationSharedPtr& application); + app_mngr::ApplicationConstSharedPtr application); + + /** + * @brief Unsubscribe specified application from vehicle data. + * @param - Pointer to application instance. + * @return - Return result of sending (success or not). + */ + bool SendUnsubscribeAppFromVehicleDataToHMI( + application_manager::ApplicationConstSharedPtr application); private: /* 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 0bc5eb9eedc..a3629c9a1e1 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -259,8 +259,16 @@ class MessageHelper { static smart_objects::SmartObjectList CreateAddCommandRequestToHMI( ApplicationConstSharedPtr app, ApplicationManager& app_mngr); + /** + * @brief CreateMessageForHMI Creates HMI message with prepared header + * acccoring to message type + * @param message_type Message type + * @param correlation_id Correlation id + * @return HMI message object with filled header + */ static smart_objects::SmartObjectSPtr CreateMessageForHMI( - hmi_apis::messageType::eType message_type, const uint32_t correlation_id); + const hmi_apis::messageType::eType message_type, + const uint32_t correlation_id); /** * @brief Creates Message for sending to HMI for unsubscribe from specified @@ -274,7 +282,7 @@ class MessageHelper { static smart_objects::SmartObjectSPtr CreateUnsubscribeVehicleDataMessageForHMI( const VehicleInfoSubscriptions& vehicle_data, - const application_manager::ApplicationSharedPtr& app); + application_manager::ApplicationConstSharedPtr app); static smart_objects::SmartObjectList CreateAddVRCommandRequestFromChoiceToHMI(ApplicationConstSharedPtr app, diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 7dc90779dcb..63c5b848f02 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2625,47 +2625,10 @@ void ApplicationManagerImpl::UnregisterApplication( resume_controller().RemoveApplicationFromSaved(app_to_remove); } - application_manager::VehicleInfoSubscriptions vehicle_data_for_unsubscribe = - SelectVehicleDataForUnsubscribe(app_to_remove); - - if (!vehicle_data_for_unsubscribe.empty()) { - auto message_to_hmi = - MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( - vehicle_data_for_unsubscribe, app_to_remove); - -#ifdef DEBUG - MessageHelper::PrintSmartObject(*message_to_hmi); -#endif - - CommandSharedPtr command = - HMICommandFactory::CreateCommand(message_to_hmi, *this); - if (!command) { - LOG4CXX_WARN(logger_, "Failed to create command from smart object"); - } - - int32_t message_type = - (*(message_to_hmi.get()))[strings::params][strings::message_type] - .asInt(); - - if (kRequest == message_type) { - LOG4CXX_DEBUG(logger_, "ManageHMICommand"); - request_ctrl_.addHMIRequest(command); - } - - if (command->Init()) { - command->Run(); - if (kResponse == message_type) { - const uint32_t correlation_id = - (*(message_to_hmi - .get()))[strings::params][strings::correlation_id] - .asUInt(); - const int32_t function_id = - (*(message_to_hmi.get()))[strings::params][strings::function_id] - .asInt(); - request_ctrl_.OnHMIResponse(correlation_id, function_id); - } - } - } + const bool result = SendUnsubscribeAppFromVehicleDataToHMI(app_to_remove); + LOG4CXX_INFO(logger_, + "Sending UnsubscribeVehicleData to HMI finished " + << (result ? " successful." : " with fail.")); applications_.erase(app_to_remove); @@ -2895,7 +2858,7 @@ bool ApplicationManagerImpl::IsLowVoltage() { VehicleInfoSubscriptions ApplicationManagerImpl::SelectVehicleDataForUnsubscribe( - const ApplicationSharedPtr& application) { + ApplicationConstSharedPtr application) { auto vehicle_data_for_unsubscribe = application->SubscribedIVI().GetData(); auto vehicle_data_collector = [this, &vehicle_data_for_unsubscribe, application]( @@ -2914,6 +2877,23 @@ ApplicationManagerImpl::SelectVehicleDataForUnsubscribe( return vehicle_data_for_unsubscribe; } +bool ApplicationManagerImpl::SendUnsubscribeAppFromVehicleDataToHMI( + ApplicationConstSharedPtr application) { + bool sending_result = false; + + const application_manager::VehicleInfoSubscriptions + vehicle_data_for_unsubscribe = + SelectVehicleDataForUnsubscribe(application); + + if (!vehicle_data_for_unsubscribe.empty()) { + auto message_to_hmi = + MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( + vehicle_data_for_unsubscribe, application); + sending_result = ManageHMICommand(message_to_hmi); + } + return sending_result; +} + std::string ApplicationManagerImpl::GetHashedAppID( uint32_t connection_key, const std::string& mobile_app_id) const { uint32_t device_id = 0; diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc index c1f517acd38..2211cde19ca 100644 --- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc @@ -44,6 +44,7 @@ VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {} void VIUnsubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); } diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index f8e6f4c34c4..2b3a39bfc99 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include "application_manager/application.h" @@ -1065,23 +1064,26 @@ smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI( } smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI( - hmi_apis::messageType::eType message_type, const uint32_t correlation_id) { - auto message = new smart_objects::SmartObject(smart_objects::SmartType_Map); - auto& ref = *message; + const hmi_apis::messageType::eType message_type, + const uint32_t correlation_id) { + auto message_so = + new smart_objects::SmartObject(smart_objects::SmartType_Map); + auto& message_ref = *message_so; - ref[strings::params][strings::message_type] = static_cast(message_type); - ref[strings::params][strings::protocol_version] = + message_ref[strings::params][strings::message_type] = + static_cast(message_type); + message_ref[strings::params][strings::protocol_version] = commands::CommandImpl::protocol_version_; - ref[strings::params][strings::protocol_type] = + message_ref[strings::params][strings::protocol_type] = commands::CommandImpl::hmi_protocol_type_; - ref[strings::params][strings::correlation_id] = correlation_id; - return message; + message_ref[strings::params][strings::correlation_id] = correlation_id; + return message_so; } smart_objects::SmartObjectSPtr MessageHelper::CreateUnsubscribeVehicleDataMessageForHMI( const VehicleInfoSubscriptions& vehicle_data, - const application_manager::ApplicationSharedPtr& app) { + ApplicationConstSharedPtr app) { auto message_to_hmi = CreateMessageForHMI(hmi_apis::messageType::request, app->app_id()); (*message_to_hmi)[strings::params][strings::function_id] = @@ -1372,11 +1374,8 @@ void MessageHelper::SendOnAppUnregNotificationToHMI( message[strings::params][strings::message_type] = MessageType::kNotification; // we put hmi_app_id because applicaton list does not contain application - // on - // this momment - // and ReplaceHMIByMobileAppId function will be unable to replace app_id - // to - // hmi_app_id + // on this momment and ReplaceHMIByMobileAppId function will be unable to + // replace app_id to hmi_app_id message[strings::msg_params][strings::app_id] = app->hmi_app_id(); message[strings::msg_params][strings::unexpected_disconnect] = is_unexpected_disconnect; diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index 3cc7de5de55..688bacf1ac0 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -143,6 +143,7 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( commands::Command::CommandOrigin origin, ApplicationManager& application_manager) { CommandSharedPtr command; + switch ((*message)[strings::params][strings::function_id].asInt()) { case mobile_apis::FunctionID::RegisterAppInterfaceID: { if ((*message)[strings::params][strings::message_type] ==