summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/message_helper.h
diff options
context:
space:
mode:
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.h143
1 files changed, 112 insertions, 31 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 6bfc36e09..cfd3d4c72 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2013, Ford Motor Company
All rights reserved.
@@ -67,9 +67,6 @@ typedef std::map<std::string, VehicleDataType> VehicleData;
**/
class MessageHelper {
public:
-
- typedef std::vector<smart_objects::SmartObject*> SmartObjectList;
-
/**
* @brief Creates request for different interfaces(JSON, DBUS)
* @param correlation_id unique ID
@@ -99,7 +96,17 @@ class MessageHelper {
/**
* @brief Create mobile HashUpdateNotification
*/
- static smart_objects::SmartObject* GetHashUpdateNotification(const uint32_t app_id);
+ static smart_objects::SmartObjectSPtr GetHashUpdateNotification(const uint32_t app_id);
+
+ /**
+ * @brief Create OnSystemRequest notification for lock screen icon url
+ */
+ static smart_objects::SmartObject* GetLockScreenIconUrlNotification(const uint32_t connection_key);
+
+ /**
+ * @brief Send the OnSystemRequest notification for lock screen icon url to the mobile device
+ */
+ static void SendLockScreenIconUrlNotification(const uint32_t connection_key);
/**
* @brief Sends to mobile HashUpdateNotification
@@ -149,7 +156,7 @@ class MessageHelper {
static std::string StringifiedFunctionID(
mobile_apis::FunctionID::eType function_id);
- static smart_objects::SmartObject* CreateBlockedByPoliciesResponse(
+ static smart_objects::SmartObjectSPtr CreateBlockedByPoliciesResponse(
mobile_apis::FunctionID::eType function_id,
mobile_apis::Result::eType result, uint32_t correlation_id,
uint32_t connection_key);
@@ -161,45 +168,64 @@ class MessageHelper {
* @param devices Devices list
*
*/
- static smart_objects::SmartObject* CreateDeviceListSO(
- const connection_handler::DeviceMap& devices);
+ static smart_objects::SmartObjectSPtr CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices);
- static smart_objects::SmartObject* CreateModuleInfoSO(
- uint32_t function_id);
+ static smart_objects::SmartObjectSPtr CreateModuleInfoSO(
+ uint32_t function_id);
- static smart_objects::SmartObject* CreateSetAppIcon(
- const std::string& path_to_icon, uint32_t app_id);
+ static smart_objects::SmartObjectSPtr CreateSetAppIcon(
+ const std::string& path_to_icon, uint32_t app_id);
/**
- * @brief Sends IVI subscriptions
+ * @brief Sends IVI subscription requests
*/
static bool SendIVISubscribtions(const uint32_t app_id);
/**
- * @brief Sends IVI subscriptions
+ * @brief Returns IVI subscription requests
*/
- static SmartObjectList GetIVISubscribtionRequests(const uint32_t app_id);
+ static smart_objects::SmartObjectList GetIVISubscriptionRequests(ApplicationSharedPtr app);
+
+ /**
+ * @brief Sends button subscription notification
+ */
+ static void SendOnButtonSubscriptionNotification(
+ uint32_t app_id, hmi_apis::Common_ButtonName::eType button, bool is_subscribed);
+
+ /**
+ * @brief Sends button subscription notifications for all buttons
+ * that application is subscribed on
+ */
+ static void SendAllOnButtonSubscriptionNotificationsForApp(
+ ApplicationConstSharedPtr app);
static void SendAppDataToHMI(ApplicationConstSharedPtr app);
static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app);
- static smart_objects::SmartObject* CreateAppVrHelp(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectSPtr CreateAppVrHelp(
+ ApplicationConstSharedPtr app);
- static SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateShowRequestToHMI(ApplicationConstSharedPtr app);
static void SendShowRequestToHMI(ApplicationConstSharedPtr app);
static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app);
static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateAddCommandRequestToHMI(ApplicationConstSharedPtr app);
+ /**
+ * @brief Sends UI_ChangeRegistration to HMI with list of AppHMIType
+ * @param app applicaton instace
+ */
+ static void SendUIChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app);
static void SendAddVRCommandToHMI(
uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
uint32_t app_id);
- static smart_objects::SmartObject* CreateAddVRCommandToHMI(
- uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
- uint32_t app_id);
+ static smart_objects::SmartObjectSPtr CreateAddVRCommandToHMI(
+ uint32_t cmd_id, const smart_objects::SmartObject& vr_commands,
+ uint32_t app_id);
/*
* @brief Create Common.HMIApplication struct application instance
@@ -211,7 +237,7 @@ class MessageHelper {
smart_objects::SmartObject& output);
static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
- static SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
+ static smart_objects::SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app);
/*
* @brief Creates BasicCommunication.OnAppUnregistered notification
@@ -221,9 +247,10 @@ class MessageHelper {
*/
static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app,
bool is_unexpected_disconnect = false);
- static void SendActivateAppToHMI(
+ static uint32_t SendActivateAppToHMI(
uint32_t const app_id,
- hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL);
+ hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL,
+ bool send_policy_priority = true);
static void SendOnResumeAudioSourceToHMI(const uint32_t app_id);
@@ -305,6 +332,29 @@ class MessageHelper {
unsigned int connection_key, const std::vector<uint8_t>& policy_data,
const std::string& url = "", int timeout = -1);
+ static void SendSystemRequestNotification(
+ uint32_t connection_key,
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& content);
+
+ /**
+ * @brief SendLaunchApp allows to send OnSystemRequest with LAUNCH_UP.
+ *
+ * @param connection_key application id.
+ *
+ * @param urlSchema application's url schema.
+ *
+ * @param packageName application's package name.
+ */
+ static void SendLaunchApp(uint32_t connection_key,
+ const std::string& urlSchema,
+ const std::string& packageName);
+
+ /**
+ * @brief Sends OnSystemRequest which queries remote apps list
+ * @param connection_key application id, which is used for sending out
+ */
+ static void SendQueryApps(uint32_t connection_key);
+
/*
* @brief Send notification to mobile on application permissions update
* @param connection_key Id of application to send message to
@@ -365,6 +415,9 @@ class MessageHelper {
*/
static void SendAudioStopStream(int32_t connection_key);
+ static void SendOnDataStreaming(protocol_handler::ServiceType service,
+ bool available);
+
/*
* @brief Sends notification to HMI to stop audioPathThru
*
@@ -374,9 +427,9 @@ class MessageHelper {
*/
static bool SendStopAudioPathThru();
- static smart_objects::SmartObject* CreateNegativeResponse(
- uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
- int32_t result_code);
+ static smart_objects::SmartObjectSPtr CreateNegativeResponse(
+ uint32_t connection_key, int32_t function_id, uint32_t correlation_id,
+ int32_t result_code);
/*
* @brief Verify image and add image file full path
@@ -421,6 +474,16 @@ class MessageHelper {
smart_objects::SmartObject& message_params,
ApplicationConstSharedPtr app);
+ /**
+ * @brief checkWithPolicy allows to check soft button's parameters
+ * according to the current policy
+ * @param system_action system action
+ * @param app_mobile_id policy application id
+ * @return
+ */
+ static bool CheckWithPolicy(mobile_apis::SystemAction::eType system_action,
+ const std::string& app_mobile_id);
+
/*
* @brief subscribe application to softbutton
*
@@ -451,6 +514,14 @@ class MessageHelper {
hmi_apis::Common_Language::eType language);
/**
+ * @brief Converts string to common language enum value
+ * @param language language as string
+ * @return Common language enum value
+ */
+ static hmi_apis::Common_Language::eType CommonLanguageFromString(
+ const std::string& language);
+
+ /**
* @brief Gets command limit number per minute for specific application
* @param policy_app_id Unique application id
* @return Limit for number of command per minute
@@ -471,7 +542,16 @@ class MessageHelper {
static void SendTTSGlobalProperties(
ApplicationSharedPtr app, bool default_help_prompt);
- private:
+ /**
+ * @brief SendSetAppIcon allows to send SetAppIcon request.
+ *
+ * @param app_id application for which icon request should be sent.
+ *
+ * @param icon_path path to the icon.
+ */
+ static void SendSetAppIcon(uint32_t app_id,
+ const std::string& icon_path);
+ private:
/**
* @brief Allows to fill SO according to the current permissions.
* @param permissions application permissions.
@@ -480,8 +560,9 @@ class MessageHelper {
static void FillAppRevokedPermissions(const policy::AppPermissions& permissions,
smart_objects::SmartObject& message);
- static smart_objects::SmartObject* CreateChangeRegistration(
- int32_t function_id, int32_t language, uint32_t app_id);
+ static smart_objects::SmartObjectSPtr CreateChangeRegistration(
+ int32_t function_id, int32_t language, uint32_t app_id,
+ const smart_objects::SmartObject* app_types = NULL);
MessageHelper();