diff options
Diffstat (limited to 'src/components/application_manager/include')
14 files changed, 395 insertions, 0 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 4f176fcc4d..d0e8c99fae 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 @@ -281,6 +281,44 @@ class ApplicationManagerImpl bool IsAppTypeExistsInFullOrLimited(ApplicationConstSharedPtr app) const; /** + * @brief Checks if Application is subscribed for way points + * @param Application AppID + * @return true if Application is subscribed for way points + * otherwise false + */ + bool IsAppSubscribedForWayPoints(const uint32_t app); + + /** + * @brief Subscribe Application for way points + * @param Application AppID + */ + void SubscribeAppForWayPoints(const uint32_t app); + + /** + * @brief Unsubscribe Application for way points + * @param Application AppID + */ + void UnSubscribeAppForWayPoints(const uint32_t app); + + /** + * @brief Is Any Application is subscribed for way points + * @return true if some app is subscribed otherwise false + */ + bool IsAnyAppSubscribedForWayPoints() const; + + /** + * @brief Get subscribed for way points + * @return reference to set of subscribed apps for way points + */ + const std::set<int32_t>& GetSubscribedForWayPoints() const; + + /** + * @brief Set subscribed for way points + * @param subscribed_way_points_apps + */ + void SetSubscribedForWayPoints(const std::set<int32_t>& subscribed_way_points_apps); + + /** * @brief Notifies all components interested in Vehicle Data update * i.e. new value of odometer etc and returns list of applications * subscribed for event. @@ -1426,6 +1464,11 @@ typedef utils::SharedPtr<timer::Timer> TimerSPtr; std::map<const int32_t, const uint32_t> appID_list_; /** + * @brief Set AppIDs of subscribed apps for way points + */ + std::set<int32_t> subscribed_way_points_apps_list_; + + /** * @brief Map contains applications which * will send TTS global properties to HMI after timeout */ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h new file mode 100644 index 0000000000..2e9465b1e3 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h @@ -0,0 +1,39 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/hmi/request_to_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief NaviSubscribeWayPointsRequest command class + **/ +class NaviSubscribeWayPointsRequest + : public RequestToHMI { +public: + /** + * @brief NaviSubscribeWayPointsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + explicit NaviSubscribeWayPointsRequest(const MessageSharedPtr &); + /** + * @brief NaviSubscribeWayPointsRequest class destructor + **/ + virtual ~NaviSubscribeWayPointsRequest(); + /** + * @brief Execute command + **/ + virtual void Run(); + +private: + DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h new file mode 100644 index 0000000000..716ec8ff4e --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h @@ -0,0 +1,40 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/hmi/response_from_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief NaviSubscribeWaypoints command class + **/ +class NaviSubscribeWaypointsResponse + : public ResponseFromHMI { + public: + /** + * @brief NaviSubscribeWaypoints class constructor + * + * @param message Incoming SmartObject message + **/ + explicit NaviSubscribeWaypointsResponse(const MessageSharedPtr& message); + + /** + * @brief NaviSubscribeWaypoints class destructor + **/ + virtual ~NaviSubscribeWaypointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + private: + DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWaypointsResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h new file mode 100644 index 0000000000..58d0fc266f --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h @@ -0,0 +1,39 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/hmi/request_to_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief NaviSubscribeWayPointsRequest command class + **/ +class NaviUnSubscribeWayPointsRequest + : public RequestToHMI { +public: + /** + * @brief NaviUnSubscribeWayPointsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + explicit NaviUnSubscribeWayPointsRequest(const MessageSharedPtr &); + /** + * @brief NaviUnSubscribeWayPointsRequest class destructor + **/ + virtual ~NaviUnSubscribeWayPointsRequest(); + /** + * @brief Execute command + **/ + virtual void Run(); + +private: + DISALLOW_COPY_AND_ASSIGN(NaviUnSubscribeWayPointsRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h new file mode 100644 index 0000000000..e8a524f78d --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h @@ -0,0 +1,40 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/hmi/response_from_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief NaviUnSubscribeWaypoints command class + **/ +class NaviUnSubscribeWaypointsResponse + : public ResponseFromHMI { + public: + /** + * @brief NaviUnSubscribeWaypoints class constructor + * + * @param message Incoming SmartObject message + **/ + explicit NaviUnSubscribeWaypointsResponse(const MessageSharedPtr& message); + + /** + * @brief NaviUnSubscribeWaypoints class destructor + **/ + virtual ~NaviUnSubscribeWaypointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + private: + DISALLOW_COPY_AND_ASSIGN(NaviUnSubscribeWaypointsResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h new file mode 100644 index 0000000000..c665904067 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h @@ -0,0 +1,43 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief SubsribeWayPointsRequest command class + **/ +class SubscribeWayPointsRequest : public CommandRequestImpl { +public: + /** + * \brief SubscribeWayPointsRequest class constructor + **/ + explicit SubscribeWayPointsRequest(const MessageSharedPtr& message); + + /** + * \brief SubscribeWayPointsRequest class destructor + **/ + virtual ~SubscribeWayPointsRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); +private: + DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h new file mode 100644 index 0000000000..6514a3e7aa --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h @@ -0,0 +1,38 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief SubscribeWayPointsResponse command class + **/ +class SubscribeWayPointsResponse : public CommandResponseImpl { +public: + /** + * \brief SubscribeWayPointsResponse class constructor + **/ + explicit SubscribeWayPointsResponse(const MessageSharedPtr& message); + + /** + * \brief SubscribeWayPointsResponse class destructor + **/ + virtual ~SubscribeWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); +private: + DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h new file mode 100644 index 0000000000..25637598e2 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h @@ -0,0 +1,40 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace application_manager { + +namespace commands { + +class UnSubscribeWayPointsRequest : public CommandRequestImpl { +public: + /** + * \brief UnSubscribeWayPointsRequest class constructor + **/ + explicit UnSubscribeWayPointsRequest(const MessageSharedPtr& message); + + /** + * \brief UnSubscribeWayPointsRequest class destructor + **/ + virtual ~UnSubscribeWayPointsRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); +private: + DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h new file mode 100644 index 0000000000..219cdb200f --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h @@ -0,0 +1,38 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief UnSubscribeWayPointsResponse command class + **/ +class UnSubscribeWayPointsResponse : public CommandResponseImpl { +public: + /** + * \brief UnSubscribeWayPointsResponse class constructor + **/ + explicit UnSubscribeWayPointsResponse(const MessageSharedPtr& message); + + /** + * \brief UnSubscribeWayPointsResponse class destructor + **/ + virtual ~UnSubscribeWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); +private: + DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsResponse); +}; + +} // commands + +} // application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ 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 64cd9485cf..3c727faa19 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -480,6 +480,12 @@ class MessageHelper { */ static bool SendStopAudioPathThru(); + /** + * @brief Sends UnsubscribeWayPoints request + * @return true if UnSubscribedWayPoints is send otherwise false + */ + static bool SendUnSubscribedWayPoints(); + static smart_objects::SmartObjectSPtr CreateNegativeResponse( uint32_t connection_key, int32_t function_id, diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h index 5c4e5ff256..6a9c41c59e 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h @@ -237,6 +237,13 @@ class ResumptionData { app_mngr::ApplicationConstSharedPtr application) const; /** + * @brief Retrieves of subscribed apps for way points + * @param reference for set of subscribed for way points + * @return subscribed apps for way points + */ + smart_objects::SmartObject GetSubscribedForWayPoints(const std::set<int32_t>& subscribed_for_way_points); + + /** * @brief Retrieves of subscriptions from application * @param application contains application of which selection subscriptions * @return subscriptions of application diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h index 18c9369f2e..8b5a36958a 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h @@ -821,6 +821,24 @@ class ResumptionDataDB : public ResumptionData { const std::string& device_id); /** + * @brief Insert subscribed AppIDs for way points to DB + * @return true if query is success otherwise false + */ + bool InsertSubscribedForWayPoints(); + + /** + * @brief Get subscribed AppIDs for way points to DB + * @return true if query is success otherwise false + */ + bool SelectSubscribedForWayPoints() const; + + /** + * @brief Delete from DB subscribed apps for way points + * @return true if query is success otherwise false + */ + bool DeleteSubscribedForWayPoints(); + + /** * @brief Writes data to DB after update */ void WriteDb(); diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h index c3a17d868c..3f8ca3a416 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h @@ -130,6 +130,9 @@ extern const std::string kUpdateApplicationData; extern const std::string kSelectDBVersion; extern const std::string kUpdateDBVersion; extern const std::string kUpdateGrammarID; +extern const std::string kInsertSubscribedForWayPoints; +extern const std::string kSelectSubscribedForWayPoints; +extern const std::string kDeleteSubscribedForWayPoints; } // namespace resumption #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERY_H_ diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index ec725f05aa..60ddd38cd0 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -53,6 +53,7 @@ extern const char* info; extern const char* app_id; extern const char* hmi_app_id; extern const char* device_id; +extern const char* subscribed_for_way_points; extern const char* url; extern const char* urlScheme; extern const char* packageName; |