summaryrefslogtreecommitdiff
path: root/src/components/application_manager/include/application_manager/message_helper.h
diff options
context:
space:
mode:
authorJustin Dickow <jjdickow@gmail.com>2015-02-20 09:11:18 -0500
committerJustin Dickow <jjdickow@gmail.com>2015-02-20 09:11:18 -0500
commita7c5d752cb75485baa0ded5226335d0f8eb10321 (patch)
treefbfd9251ada2cdcd5cf6a03a79887d08f6b496d7 /src/components/application_manager/include/application_manager/message_helper.h
parentb2b2233d866f102d3de339afa8ccaf37d3cf2570 (diff)
downloadsdl_core-a7c5d752cb75485baa0ded5226335d0f8eb10321.tar.gz
Bug Fixes and ImprovementsSynchronizationCommit
Fix Empty perform iteration request Fix type of name from string to enum SendLocation implemented on HTML5 HMI Fixed PI response on VR rejection due to high priority. Fix Apps not responsive/not able to start app/apps remain listed on SYNC even after USB disconnect Mobile API change and processing capabilities Change perform interaction request conditions. Fix SDL must always start 3sec timer before resuming the HMILevel of the app Remove redundant StartSavePersistentDataTimer() call. Change wrong predicate name to right. Added stream request handling feature Made streaming timeout in media manager configurable Put navi app in LIMITED in case of phone call Handling of audio state for applications Add stop streaming timeout into ini file Implement HMILevel resumption for job-1 Fix result code ABORTED when interrupts it by Voice recognition activation Fix incorrect value parameter unexpectedDisconnect in BCOnAppUnregistered Fix SDL send BC.OnAppUnregistered with "unexpectedDisconnect" set to "true" in case received from HMI OnExitAllApplications {"reason":"MASTER_RESET"} Fix Update ini file for iAP1 support Current working directory added to image path Fix helpers to make it workable with more then 2 parameters DCHECK() for ManageMobileCommand() replaced with log message because the latter returns false in some regular situations (e.g. TOO_MANY_PENDING_REQUESTS, see SDLAQ-CRS-10) Remove connection after closing. Signed-off-by: Justin Dickow <jjdickow@gmail.com>
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.h113
1 files changed, 75 insertions, 38 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 2fc69d8162..8ee8256001 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,17 +96,7 @@ class MessageHelper {
/**
* @brief Create mobile HashUpdateNotification
*/
- static smart_objects::SmartObject* 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);
+ static smart_objects::SmartObjectSPtr GetHashUpdateNotification(const uint32_t app_id);
/**
* @brief Sends to mobile HashUpdateNotification
@@ -159,7 +146,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);
@@ -171,14 +158,14 @@ 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
@@ -188,28 +175,34 @@ class MessageHelper {
/**
* @brief Sends IVI subscriptions
*/
- static SmartObjectList GetIVISubscribtionRequests(const uint32_t app_id);
+ static smart_objects::SmartObjectList GetIVISubscriptionRequests(ApplicationSharedPtr 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
@@ -221,7 +214,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
@@ -233,7 +226,8 @@ class MessageHelper {
bool is_unexpected_disconnect = false);
static void 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);
@@ -315,6 +309,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
@@ -384,9 +401,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
@@ -431,6 +448,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
*
@@ -481,7 +508,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.
@@ -490,8 +526,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();