diff options
Diffstat (limited to 'src/components/application_manager/include/application_manager/message_helper.h')
-rw-r--r-- | src/components/application_manager/include/application_manager/message_helper.h | 108 |
1 files changed, 103 insertions, 5 deletions
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 98992a20d5..09d225a120 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -42,6 +42,7 @@ #include <application_manager/smart_object_keys.h> #include "application_manager/application.h" +#include "application_manager/hmi_capabilities.h" #include "application_manager/policies/policy_handler_interface.h" #include "connection_handler/device.h" #include "interfaces/HMI_API.h" @@ -88,10 +89,18 @@ class MessageHelper { static smart_objects::SmartObjectSPtr CreateHMINotification( hmi_apis::FunctionID::eType function_id); + static smart_objects::SmartObjectSPtr CreateOnServiceUpdateNotification( + const hmi_apis::Common_ServiceType::eType type, + const hmi_apis::Common_ServiceEvent::eType event, + const hmi_apis::Common_ServiceStatusUpdateReason::eType reason = + hmi_apis::Common_ServiceStatusUpdateReason::INVALID_ENUM, + const uint32_t app_id = 0); + /** * @brief Creates request for different interfaces(JSON) * @param correlation_id unique ID - * @param params Vector of arguments that we need in GetVehicleData request + * @param params Vector of arguments that we need in GetVehicleData + * request * (e.g. gps, odometer, fuel_level) */ static void CreateGetVehicleDataRequest( @@ -302,6 +311,30 @@ class MessageHelper { const uint32_t app_id, ApplicationManager& app_mngr); + /** + * @brief Creates UI.CreateWindow request + * @param application application instance + * @param app_mngr reference to application manager + * @param windows_info smart object containing saved windows info + * @return smart object with UI.CreateWindow request + */ + static smart_objects::SmartObjectSPtr CreateUICreateWindowRequestToHMI( + ApplicationSharedPtr application, + ApplicationManager& app_mngr, + const smart_objects::SmartObject& window_info); + + /** + * @brief Creates UI.CreateWindow requests + * @param application application instance + * @param app_mngr reference to application manager + * @param windows_info smart object containing saved windows info + * @return list of smart objects with UI.CreateWindow requests + */ + static smart_objects::SmartObjectList CreateUICreateWindowRequestsToHMI( + application_manager::ApplicationSharedPtr application, + ApplicationManager& app_mngr, + const smart_objects::SmartObject& windows_info); + /* * @brief Create Common.DeviceInfo struct from device handle * @param device_handle device handle of the app @@ -347,6 +380,15 @@ class MessageHelper { static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app, bool is_unexpected_disconnect, ApplicationManager& app_mngr); + /** + * @brief Creates BasicCommunication.OnAppPropertiesChange + * notification to the HMI + * @param policy_app_id unique policy app id + * @param app_mngr application manager + * @return smart object with BC.OnAppPropertiesChange notification + */ + static smart_objects::SmartObjectSPtr CreateOnAppPropertiesChangeNotification( + const std::string& policy_app_id, ApplicationManager& app_mngr); static smart_objects::SmartObjectSPtr GetBCActivateAppRequestToHMI( ApplicationConstSharedPtr app, @@ -449,9 +491,23 @@ class MessageHelper { * @brief Send notification for Update of Policy Table * with PT Snapshot. * @param connection_key Id of application to send message to + * @param snapshot_file_path path to PT Snapshot + * @param url If empty string, no URL is provided + * @param timeout If -1 no timeout is provided + */ + static void SendPolicySnapshotNotification( + uint32_t connection_key, + const std::string& snapshot_file_path, + const std::string& url, + ApplicationManager& app_mngr); + + /* + * @brief Send notification for Update of Policy Table + * with PT Snapshot. + * @param connection_key Id of application to send message to * @param policy_data PT Snapshot * @param url If empty string, no URL is provided - * @param timeout If -1 no timeout is provdied + * @param timeout If -1 no timeout is provided */ static void SendPolicySnapshotNotification( uint32_t connection_key, @@ -489,11 +545,14 @@ class MessageHelper { * @brief Send notification to mobile on application permissions update * @param connection_key Id of application to send message to * @param permissions updated permissions for application + * @param app_mngr reference to application manager + * @param require_encryption require encryption flag */ static void SendOnPermissionsChangeNotification( uint32_t connection_key, const policy::Permissions& permissions, - ApplicationManager& app_mngr); + ApplicationManager& app_mngr, + const policy::EncryptionRequired encryprion_required); /* * @brief Send notification to HMI on application permissions update @@ -695,6 +754,23 @@ class MessageHelper { * @param app current application * * @param function_id Unique command id from mobile API + * + * @param window_id window id containing soft buttons + */ + static void SubscribeApplicationToSoftButton( + smart_objects::SmartObject& message_params, + ApplicationSharedPtr app, + int32_t function_id, + const WindowID window_id); + + /* + * @brief subscribe application to softbutton + * + * @param message_params contains data of request + * + * @param app current application + * + * @param function_id Unique command id from mobile API */ static void SubscribeApplicationToSoftButton( smart_objects::SmartObject& message_params, @@ -711,6 +787,15 @@ class MessageHelper { */ static bool PrintSmartObject(const smart_objects::SmartObject& object); + /** + * @brief Extract window unique ID from message, this id is used for identify + * the window + * @param s_map contains application's window id + * @return window id from current message + */ + static WindowID ExtractWindowIdFromSmartObject( + const smart_objects::SmartObject& s_map); + template <typename From, typename To> static To ConvertEnumAPINoCheck(const From& input) { return static_cast<To>(input); @@ -864,10 +949,13 @@ class MessageHelper { /** * @brief Sends HMI status notification to mobile - * @param application_impl application with changed HMI status + * @param application application with changed HMI status + * @param window_id id of affected window + * @param application_manager reference to application manager **/ static void SendHMIStatusNotification( - const Application& application_impl, + ApplicationSharedPtr application, + const WindowID window_id, ApplicationManager& application_manager); /** @@ -901,6 +989,16 @@ class MessageHelper { static void BroadcastCapabilityUpdate(smart_objects::SmartObject& msg_params, ApplicationManager& app_mngr); + /** + * @brief CreateDisplayCapabilityUpdateToMobile creates notification with + * updated display capabilities acccoring to message type + * @param system_capabilities SO containing notification data + * @param app reference to application + * @return shared ptr to notification SO + */ + static smart_objects::SmartObjectSPtr CreateDisplayCapabilityUpdateToMobile( + const smart_objects::SmartObject& system_capabilities, Application& app); + private: /** * @brief Allows to fill SO according to the current permissions. |