diff options
Diffstat (limited to 'src/components/application_manager')
1152 files changed, 21754 insertions, 5064 deletions
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 67a7136a62..625e119270 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -61,6 +61,7 @@ include_directories ( ${ENCRYPTION_INCLUDE_DIRECTORY} ${MESSAGE_BROKER_INCLUDE_DIRECTORY} ${LOG4CXX_INCLUDE_DIRECTORY} + ${BOOST_INCLUDE_DIR} ${BSON_INCLUDE_DIRECTORY} ) diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h index e3231de347..5167aa88c0 100644 --- a/src/components/application_manager/include/application_manager/app_extension.h +++ b/src/components/application_manager/include/application_manager/app_extension.h @@ -33,11 +33,13 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ +#include <memory> + namespace ns_smart_device_link { namespace ns_smart_objects { class SmartObject; } -} +} // namespace ns_smart_device_link namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h index a10963ad82..2dd64a2941 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h @@ -32,8 +32,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_ -#include <string> #include <memory> +#include <string> namespace application_manager { class Application; @@ -49,22 +49,22 @@ namespace app_launch { class AppLaunchCtrl { public: /** - * @brief OnAppRegistered should be called when application registered - * Save application parameters to database - * @param app application to save - */ + * @brief OnAppRegistered should be called when application registered + * Save application parameters to database + * @param app application to save + */ virtual void OnAppRegistered(const application_manager::Application& app) = 0; /** - * @brief OnDeviceConnected shoudl be called on device connected event - * Start launching saaved applications on ios device - * @param device_mac - */ + * @brief OnDeviceConnected shoudl be called on device connected event + * Start launching saaved applications on ios device + * @param device_mac + */ virtual void OnDeviceConnected(const std::string& device_mac) = 0; /** - * @brief OnMasterReset clear database of saved applications - */ + * @brief OnMasterReset clear database of saved applications + */ virtual void OnMasterReset() = 0; virtual ~AppLaunchCtrl() {} }; diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h index 61f3480f77..986f4ad4ff 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h @@ -41,11 +41,11 @@ namespace connection_handler { class ConnectionHandler; -} // connection_handler +} // namespace connection_handler namespace resumption { class ResumeCtrl; -} // resumption +} // namespace resumption namespace app_launch { // TODO(AK) Use unique pointer diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h index 73e9623b62..c1ad8d4003 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h @@ -34,9 +34,9 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_H_ #include <stdint.h> -#include <vector> -#include <string> #include <memory> +#include <string> +#include <vector> namespace app_launch { diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h index ccbf4c7c01..b232d1874c 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_db.h @@ -104,8 +104,8 @@ class AppLaunchDataDB : public AppLaunchDataImpl { bool IsAppDataAlreadyExisted(const ApplicationData& app_data) const OVERRIDE; /** - * @brief returns pointer to data base - */ + * @brief returns pointer to data base + */ utils::dbms::SQLDatabase* db() const; enum ApplicationDataDBIndexes { @@ -151,13 +151,13 @@ class AppLaunchDataDB : public AppLaunchDataImpl { bool WriteDb(); /** - * @brief returns pointer to data base - */ + * @brief returns pointer to data base + */ std::unique_ptr<utils::dbms::SQLDatabase> db_; /** - * @brief indicate initializing status of DB - */ + * @brief indicate initializing status of DB + */ bool init_successeful_; DISALLOW_COPY_AND_ASSIGN(AppLaunchDataDB); diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h index a2b8630bcc..b28c7fdd3d 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h @@ -33,10 +33,10 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_IMPL_H_ +#include <memory> #include "application_manager/app_launch/app_launch_data.h" #include "application_manager/app_launch_settings.h" #include "utils/macro.h" -#include <memory> namespace app_launch { diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h index a292b84fc0..9463a349d9 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h @@ -33,12 +33,12 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_DATA_JSON_H_ +#include <memory> #include "application_manager/app_launch/app_launch_data_impl.h" -#include "smart_objects/smart_object.h" #include "resumption/last_state.h" +#include "smart_objects/smart_object.h" #include "utils/lock.h" #include "utils/macro.h" -#include <memory> namespace app_launch { diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h index 6285514be9..7e360aa460 100644 --- a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h +++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h @@ -1,9 +1,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APPS_LAUNCHER_H_ +#include <memory> #include "application_manager/app_launch/app_launch_data.h" #include "connection_handler/connection_handler.h" #include "utils/timer.h" -#include <memory> namespace app_launch { class AppLaunchCtrlImpl; diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h index f156654215..f27e4569fc 100644 --- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h +++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h @@ -1,12 +1,12 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_DEVICE_APPS_LAUNCHER_H_ #include <stdint.h> -#include <vector> -#include <string> #include <memory> +#include <string> +#include <vector> #include "application_manager/app_launch/app_launch_data.h" -#include "application_manager/application_manager.h" #include "application_manager/app_launch_settings.h" +#include "application_manager/application_manager.h" namespace app_launch { class AppLaunchCtrlImpl; diff --git a/src/components/application_manager/include/application_manager/app_service_manager.h b/src/components/application_manager/include/application_manager/app_service_manager.h new file mode 100644 index 0000000000..5080748f17 --- /dev/null +++ b/src/components/application_manager/include/application_manager/app_service_manager.h @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_SERVICE_MANAGER_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_SERVICE_MANAGER_H_ + +#include "application_manager/application.h" +#include "application_manager/rpc_passing_handler.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" + +namespace resumption { +class LastState; +} + +namespace application_manager { + +struct AppService { + uint32_t connection_key; + bool mobile_service; + bool default_service = false; + smart_objects::SmartObject record; +}; + +class RPCPassingHandler; +class ApplicationManager; +/** + * @brief The AppServiceManager is TODO. + */ +class AppServiceManager { + public: + const std::string kEmbeddedService = "EMBEDDED_SERVICE"; + + /** + * @brief Class constructor + * @param app_manager + */ + AppServiceManager(ApplicationManager& app_manager, + resumption::LastState& last_state); + + /** + * @brief Class destructor + */ + virtual ~AppServiceManager(); + + /** + * @brief Publish an app service. This service will be activated if it is the + * default service for its type, or if it is the first service to register of + * its type. + * @param manifest - The app service manifest of the service to be published + * @param mobile_service - True, if the service is being published by a mobile + * app. False, if published by the embedded system. + * @param connection_key - If mobile_service is true, the connection key of + * the app publishing this service. + * @return The app service record of the published app service on success, a + * Null SmartObject value on failure + */ + virtual smart_objects::SmartObject PublishAppService( + const smart_objects::SmartObject& manifest, + const bool mobile_service, + const uint32_t connection_key = 0u); + + /** + * @brief Unpublish an existing app service + * @param service_id - The ID of the app service to be deleted. + * @return True on success, false otherwise + */ + virtual bool UnpublishAppService(const std::string service_id); + + /** + * @brief Callback for when an application is activated. Will activate all + * services which were published by this app. + * @param app - The application that was activated. + */ + virtual void OnAppActivated(ApplicationConstSharedPtr app); + + /** + * @brief Unpublish any published services for a given mobile application + * @param connection_key - The connection key of the application from which + * all published services should be deleted. + */ + virtual void UnpublishServices(const uint32_t connection_key); + + /** + * @brief Sets a service to the default service for its type + * @param service_id - The ID of the service to become the default + * @return True on success, false otherwise + */ + virtual bool SetDefaultService(const std::string service_id); + + /** + * @brief Removes a service from the list of default services. + * @param service_id - The ID of the existing default service. + * @return True on success, false otherwise + */ + virtual bool RemoveDefaultService(const std::string service_id); + + /** + * @brief Activate an existing service + * @param service_id - The ID of the service to be activated. + * @return True if the service is active, false otherwise + */ + virtual bool ActivateAppService(const std::string service_id); + + /** + * @brief Deactivate an existing active service + * @param service_id - The ID of the service to be deactivated. + * @return True if the service was deactivated, false otherwise + */ + virtual bool DeactivateAppService(const std::string service_id); + + /** + * @brief Get a list of all published service records. + * @return A list of all all published service records. + */ + virtual std::vector<smart_objects::SmartObject> GetAllServiceRecords(); + + /** + * @brief Get a list of all active app services. + * @return A list of all all active app services. + */ + virtual std::vector<AppService> GetActiveServices(); + + /** + * @brief Retrieve the active service provider for a given service type + * @param service_type - The service type of the provider to be retrieved + * @param mobile_consumer - True, if the consumer trying to communicate with + * the provider is a mobile application + * @param app - Output parameter that will be filled with the application + * providing the requested service on success, unchanged on failure + * @param hmi_service - Output parameter set to true if the service + * provider is the HMI, unchanged on failure + */ + virtual void GetProviderByType(const std::string& service_type, + const bool mobile_consumer, + ApplicationSharedPtr& app, + bool& hmi_service); + + /** + * @brief Retrieve the service provider with a given service ID + * @param service_type - The service type of the provider to be retrieved + * @param mobile_consumer - True, if the consumer trying to communicate with + * the provider is a mobile application + * @param app - Output parameter that will be filled with the application + * providing the requested service on success, unchanged on failure + * @param hmi_service - Output parameter set to true if the service + * provider is the HMI, unchanged on failure + */ + virtual void GetProviderByID(const std::string& service_id, + const bool mobile_consumer, + ApplicationSharedPtr& app, + bool& hmi_service); + + /** + * @brief Get the active service for a given service type. + * @param service_type - The service type + * @return A pointer to the active service for the given service type on + * success, NULL on failure + */ + virtual AppService* ActiveServiceForType(const std::string service_type); + + /** + * @brief Get the embedded service for a given service type. + * @param service_type - The service type + * @return A pointer to the embedded service for the given service type on + * success, NULL on failure + */ + virtual AppService* EmbeddedServiceForType(const std::string service_type); + + /** + * @brief Get the service with a given service ID. + * @param service_id - The service ID + * @return A pointer to requested service on success, NULL on failure + */ + virtual AppService* FindServiceByID(const std::string service_id); + + /** + * @brief Update a navigation system capability struct with the capabilities + * of the active navigation service. + * @param out_params - The struct to be modified + * @return True on success, false otherwise (if there was no active NAVIGATION + * service) + */ + virtual bool UpdateNavigationCapabilities( + smart_objects::SmartObject& out_params); + + /** + * @brief Get the RPCPassingHandler tied to this object + * @return The RPCPassingHandler tied to this object + */ + virtual RPCPassingHandler& GetRPCPassingHandler(); + + private: + ApplicationManager& app_manager_; + resumption::LastState& last_state_; + + sync_primitives::RecursiveLock published_services_lock_; + std::map<std::string, AppService> published_services_; + RPCPassingHandler rpc_passing_handler_; + + void SetServicePublished(const std::string service_id, + bool service_published); + void AppServiceUpdated( + const smart_objects::SmartObject& service_record, + const mobile_apis::ServiceUpdateReason::eType update_reason, + smart_objects::SmartObject& msg_params); + void GetProviderFromService(const AppService& service, + const bool mobile_consumer, + ApplicationSharedPtr& app, + bool& hmi_service); + + /** + * @brief Get the policy app ID of the default service provider for a given + * service type. + * @param service_type - The service type + * @return The policy app ID of the default service provider for the given + * service type on success, "" on failure + */ + std::string DefaultServiceByType(const std::string service_type); + AppService* FindServiceByPolicyAppID(const std::string policy_app_id, + const std::string type); + + /** + * @brief Get the service of a given type published by a given provider. + * @param connection_key - The connection key of the service provider + * @param service_type - The service type + * @return A pointer to requested service on success, NULL on failure + */ + AppService* FindServiceByProvider(const uint32_t connection_key, + const std::string service_type); + AppService* FindServiceByName(std::string name); + std::string GetPolicyAppID(AppService service); +}; + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_SERVICE_MANAGER_H_ diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index ad7570955e..72122ff3ec 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -33,23 +33,23 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_H_ -#include <string> +#include <list> #include <map> +#include <memory> #include <set> -#include <list> +#include <string> #include <vector> -#include <memory> -#include "utils/data_accessor.h" -#include "interfaces/MOBILE_API.h" -#include "connection_handler/device.h" #include "application_manager/app_extension.h" -#include "application_manager/message.h" -#include "application_manager/hmi_state.h" #include "application_manager/application_state.h" #include "application_manager/help_prompt_manager.h" +#include "application_manager/hmi_state.h" +#include "application_manager/message.h" +#include "connection_handler/device.h" +#include "interfaces/MOBILE_API.h" #include "protocol_handler/protocol_handler.h" #include "smart_objects/smart_object.h" +#include "utils/data_accessor.h" #include "utils/macro.h" #include "utils/semantic_version.h" @@ -236,8 +236,8 @@ class DynamicApplicationData { virtual bool is_audio() const = 0; /* - * @brief Adds a command to the in application menu - */ + * @brief Adds a command to the in application menu + */ virtual void AddCommand(uint32_t cmd_id, const smart_objects::SmartObject& command) = 0; @@ -353,10 +353,10 @@ class DynamicApplicationData { virtual uint32_t is_perform_interaction_active() const = 0; /* - * @brief Set perform interaction layout - * - * @param Current Interaction layout of the perform interaction - */ + * @brief Set perform interaction layout + * + * @param Current Interaction layout of the perform interaction + */ virtual void set_perform_interaction_layout( mobile_api::LayoutMode::eType layout) = 0; @@ -366,10 +366,10 @@ class DynamicApplicationData { virtual mobile_api::LayoutMode::eType perform_interaction_layout() const = 0; /* - * @brief Sets the mode for perform interaction: UI/VR/BOTH - * - * @param mode Mode that was selected (MENU; VR; BOTH) - */ + * @brief Sets the mode for perform interaction: UI/VR/BOTH + * + * @param mode Mode that was selected (MENU; VR; BOTH) + */ virtual void set_perform_interaction_mode(int32_t mode) = 0; /* @@ -706,11 +706,11 @@ class Application : public virtual InitialApplicationData, virtual void SetRegularState(HmiStatePtr state) = 0; /** - * @brief SetPostponedState sets postponed state to application. - * This state could be set as regular later - * - * @param state state to setup - */ + * @brief SetPostponedState sets postponed state to application. + * This state could be set as regular later + * + * @param state state to setup + */ virtual void SetPostponedState(HmiStatePtr state) = 0; virtual void RemovePostponedState() = 0; @@ -946,6 +946,73 @@ class Application : public virtual InitialApplicationData, */ virtual const std::list<AppExtensionPtr>& Extensions() const = 0; + /** + * @brief Get cloud app endpoint for websocket connection + * @return cloud app endpoint + */ + virtual const std::string& cloud_app_endpoint() const = 0; + + /** + * @brief Get cloud app auth token to be used in connection handshake after + * websocket open. + * @return cloud app auth token + */ + virtual const std::string& auth_token() const = 0; + + /** + * @brief Get cloud app transport type. Defines the type of websocket + * connection used. + * @return cloud app transport type + */ + virtual const std::string& cloud_app_transport_type() const = 0; + + /** + * @brief Get hybrid app preference. Defines behaviour for when a similar + * mobile and cloud app are connected simultaneously. + * @return hybrid app preference + */ + virtual const mobile_apis::HybridAppPreference::eType& hybrid_app_preference() + const = 0; + + /** + * @brief Get cloud app certificate. Used for secured websocket connections. + * @return cloud app certificate. + */ + virtual const std::string& cloud_app_certificate() const = 0; + + /** + * @brief Check whether the given application is a cloud app. + * @return true if the application is a cloud application, false otherwise. + */ + virtual bool is_cloud_app() const = 0; + + /** + * @brief Set cloud app endpoint + */ + virtual void set_cloud_app_endpoint(const std::string& endpoint) = 0; + + /** + * @brief Set cloud app auth token + */ + virtual void set_auth_token(const std::string& auth_token) = 0; + + /** + * @brief Set cloud app transport type + */ + virtual void set_cloud_app_transport_type( + const std::string& transport_type) = 0; + + /** + * @brief Set hybrid app preference + */ + virtual void set_hybrid_app_preference( + const mobile_apis::HybridAppPreference::eType& hybrid_app_preference) = 0; + + /** + * @brief Set cloud app certificate + */ + virtual void set_cloud_app_certificate(const std::string& certificate) = 0; + protected: mutable sync_primitives::Lock hmi_states_lock_; diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h index 8f24f124f9..7852d6805b 100644 --- a/src/components/application_manager/include/application_manager/application_data_impl.h +++ b/src/components/application_manager/include/application_manager/application_data_impl.h @@ -34,11 +34,11 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_ #include <string> -#include "utils/lock.h" -#include "utils/semantic_version.h" -#include "smart_objects/smart_object.h" #include "application_manager/application.h" #include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" +#include "utils/lock.h" +#include "utils/semantic_version.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 8dc3b2da20..fd9b77eb0f 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -33,28 +33,28 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_IMPL_H_ +#include <stdint.h> +#include <forward_list> +#include <list> #include <map> #include <set> -#include <vector> #include <utility> -#include <list> -#include <forward_list> -#include <stdint.h> +#include <vector> #include "application_manager/application.h" #include "application_manager/application_data_impl.h" -#include "application_manager/usage_statistics.h" #include "application_manager/help_prompt_manager_impl.h" #include "application_manager/hmi_state.h" +#include "application_manager/usage_statistics.h" #include "protocol_handler/protocol_handler.h" -#include "connection_handler/device.h" -#include "utils/lock.h" #include <atomic> +#include "connection_handler/device.h" #include "utils/custom_string.h" -#include "utils/timer.h" -#include "utils/macro.h" #include "utils/date_time.h" +#include "utils/lock.h" +#include "utils/macro.h" +#include "utils/timer.h" namespace usage_statistics { @@ -304,18 +304,18 @@ class ApplicationImpl : public virtual Application, void SetInitialState(HmiStatePtr state) FINAL; /** - * @brief SetRegularState set permanent state of application - * - * @param state state to setup - */ + * @brief SetRegularState set permanent state of application + * + * @param state state to setup + */ virtual void SetRegularState(HmiStatePtr state); /** - * @brief SetPostponedState sets postponed state to application. - * This state could be set as regular later - * - * @param state state to setup - */ + * @brief SetPostponedState sets postponed state to application. + * This state could be set as regular later + * + * @param state state to setup + */ virtual void SetPostponedState(HmiStatePtr state); virtual void RemovePostponedState(); @@ -409,6 +409,72 @@ class ApplicationImpl : public virtual Application, void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) OVERRIDE; + /** + * @brief Get cloud app endpoint for websocket connection + * @return cloud app endpoint + */ + const std::string& cloud_app_endpoint() const OVERRIDE; + + /** + * @brief Get cloud app auth token to be used in connection handshake after + * websocket open. + * @return cloud app auth token + */ + const std::string& auth_token() const OVERRIDE; + + /** + * @brief Get cloud app transport type. Defines the type of websocket + * connection used. + * @return cloud app transport type + */ + const std::string& cloud_app_transport_type() const OVERRIDE; + + /** + * @brief Get hybrid app preference. Defines behaviour for when a similar + * mobile and cloud app are connected simultaneously. + * @return hybrid app preference + */ + const mobile_apis::HybridAppPreference::eType& hybrid_app_preference() + const OVERRIDE; + + /** + * @brief Get cloud app certificate. Used for secured websocket connections. + * @return cloud app certificate. + */ + const std::string& cloud_app_certificate() const OVERRIDE; + + /** + * @brief Check whether the given application is a cloud app. + * @return true if the application is a cloud application, false otherwise. + */ + bool is_cloud_app() const OVERRIDE; + + /** + * @brief Set cloud app endpoint + */ + void set_cloud_app_endpoint(const std::string& endpoint) OVERRIDE; + + /** + * @brief Set cloud app auth token + */ + void set_auth_token(const std::string& auth_token) OVERRIDE; + + /** + * @brief Set cloud app transport type + */ + void set_cloud_app_transport_type(const std::string& transport_type) OVERRIDE; + + /** + * @brief Set hybrid app preference + */ + void set_hybrid_app_preference(const mobile_apis::HybridAppPreference::eType& + hybrid_app_preference) OVERRIDE; + + /** + * @brief Set cloud app certificate + */ + void set_cloud_app_certificate(const std::string& certificate) OVERRIDE; + protected: /** * @brief Clean up application folder. Persistent files will stay @@ -513,6 +579,13 @@ class ApplicationImpl : public virtual Application, std::list<AppExtensionPtr> extensions_; + // Cloud app properties + std::string endpoint_; + std::string auth_token_; + std::string cloud_transport_type_; + mobile_apis::HybridAppPreference::eType hybrid_app_preference_; + std::string certificate_; + /** * @brief Defines number per time in seconds limits */ 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 6c111dbbb3..c34affbf13 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 @@ -34,40 +34,41 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_IMPL_H_ #include <stdint.h> -#include <vector> -#include <map> -#include <set> -#include <deque> #include <algorithm> +#include <deque> +#include <map> #include <memory> +#include <set> +#include <vector> +#include "application_manager/app_launch/app_launch_data.h" +#include "application_manager/app_service_manager.h" #include "application_manager/application_manager.h" +#include "application_manager/application_manager_settings.h" +#include "application_manager/command_factory.h" +#include "application_manager/command_holder.h" +#include "application_manager/event_engine/event_dispatcher_impl.h" #include "application_manager/hmi_capabilities.h" +#include "application_manager/hmi_interfaces_impl.h" #include "application_manager/message.h" #include "application_manager/message_helper.h" #include "application_manager/request_controller.h" #include "application_manager/resumption/resume_ctrl.h" -#include "application_manager/state_controller_impl.h" -#include "application_manager/app_launch/app_launch_data.h" -#include "application_manager/application_manager_settings.h" -#include "application_manager/event_engine/event_dispatcher_impl.h" -#include "application_manager/hmi_interfaces_impl.h" -#include "application_manager/command_holder.h" -#include "application_manager/command_factory.h" -#include "application_manager/rpc_service.h" #include "application_manager/rpc_handler.h" +#include "application_manager/rpc_service.h" +#include "application_manager/state_controller_impl.h" -#include "protocol_handler/protocol_observer.h" -#include "protocol_handler/protocol_handler.h" -#include "hmi_message_handler/hmi_message_observer.h" -#include "hmi_message_handler/hmi_message_sender.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/policies/policy_handler_observer.h" #include "connection_handler/connection_handler.h" #include "connection_handler/connection_handler_observer.h" #include "connection_handler/device.h" #include "formatters/CSmartFactory.h" +#include "hmi_message_handler/hmi_message_observer.h" +#include "hmi_message_handler/hmi_message_sender.h" #include "policies/policy_handler.h" +#include "protocol_handler/protocol_handler.h" +#include "protocol_handler/protocol_observer.h" #include "interfaces/HMI_API.h" #include "interfaces/HMI_API_schema.h" @@ -87,14 +88,14 @@ #include "utils/macro.h" +#include "smart_objects/smart_object.h" +#include "utils/data_accessor.h" +#include "utils/lock.h" #include "utils/message_queue.h" #include "utils/prioritized_queue.h" -#include "utils/threads/thread.h" #include "utils/threads/message_loop_thread.h" -#include "utils/lock.h" -#include "utils/data_accessor.h" +#include "utils/threads/thread.h" #include "utils/timer.h" -#include "smart_objects/smart_object.h" struct BsonObject; @@ -117,6 +118,14 @@ struct CommandParametersPermissions; typedef std::map<std::string, hmi_apis::Common_TransportType::eType> DeviceTypes; +struct AppIconInfo { + std::string endpoint; + bool pending_request; + AppIconInfo(); + AppIconInfo(std::string ws_endpoint, bool pending) + : endpoint(ws_endpoint), pending_request(pending) {} +}; + CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") typedef std::shared_ptr<timer::Timer> TimerSPtr; @@ -125,14 +134,14 @@ class ApplicationManagerImpl public connection_handler::ConnectionHandlerObserver, public policy::PolicyHandlerObserver #ifdef ENABLE_SECURITY - , + , public security_manager::SecurityManagerListener #endif // ENABLE_SECURITY #ifdef TELEMETRY_MONITOR - , + , public telemetry_monitor::TelemetryObservable<AMTelemetryObserver> #endif // TELEMETRY_MONITOR - { +{ friend class ResumeCtrl; friend class CommandImpl; @@ -156,6 +165,7 @@ class ApplicationManagerImpl bool Stop() OVERRIDE; DataAccessor<ApplicationSet> applications() const OVERRIDE; + DataAccessor<AppsWaitRegistrationSet> pending_applications() const OVERRIDE; ApplicationSharedPtr application(uint32_t app_id) const OVERRIDE; ApplicationSharedPtr active_application() const OVERRIDE; @@ -164,6 +174,10 @@ class ApplicationManagerImpl uint32_t hmi_app_id) const OVERRIDE; ApplicationSharedPtr application_by_policy_id( const std::string& policy_app_id) const OVERRIDE; + ApplicationSharedPtr application_by_name( + const std::string& app_name) const OVERRIDE; + ApplicationSharedPtr pending_application_by_policy_id( + const std::string& policy_app_id) const OVERRIDE; std::vector<ApplicationSharedPtr> applications_by_button( uint32_t button) OVERRIDE; @@ -194,6 +208,9 @@ class ApplicationManagerImpl void SendDriverDistractionState(ApplicationSharedPtr application); + void SendGetIconUrlNotifications(const uint32_t connection_key, + ApplicationSharedPtr application); + ApplicationSharedPtr application( const std::string& device_id, const std::string& policy_app_id) const OVERRIDE; @@ -213,6 +230,11 @@ class ApplicationManagerImpl return *plugin_manager_; } + virtual AppServiceManager& GetAppServiceManager() OVERRIDE { + DCHECK(app_service_manager_); + return *app_service_manager_; + } + std::vector<std::string> devices( const std::string& policy_app_id) const OVERRIDE; @@ -302,8 +324,9 @@ class ApplicationManagerImpl void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE; #endif // TELEMETRY_MONITOR - ApplicationSharedPtr RegisterApplication(const std::shared_ptr< - smart_objects::SmartObject>& request_for_registration) OVERRIDE; + ApplicationSharedPtr RegisterApplication( + const std::shared_ptr<smart_objects::SmartObject>& + request_for_registration) OVERRIDE; /* * @brief Closes application by id * @@ -320,9 +343,9 @@ class ApplicationManagerImpl bool is_unexpected_disconnect = false) OVERRIDE; /** - * @brief Handle sequence for unauthorized application - * @param app_id Application id - */ + * @brief Handle sequence for unauthorized application + * @param app_id Application id + */ void OnAppUnauthorized(const uint32_t& app_id) OVERRIDE; /* @@ -360,6 +383,44 @@ class ApplicationManagerImpl void ConnectToDevice(const std::string& device_mac) OVERRIDE; void OnHMIStartedCooperation() OVERRIDE; + void DisconnectCloudApp(ApplicationSharedPtr app) OVERRIDE; + + void RefreshCloudAppInformation() OVERRIDE; + + void CreatePendingApplication( + const transport_manager::ConnectionUID connection_id, + const transport_manager::DeviceInfo& device_info, + connection_handler::DeviceHandle device_id); + + void SetPendingApplicationState( + const transport_manager::ConnectionUID connection_id, + const transport_manager::DeviceInfo& device_info); + + std::string PolicyIDByIconUrl(const std::string url) OVERRIDE; + + void SetIconFileFromSystemRequest(const std::string policy_id) OVERRIDE; + + /** + * @brief Notifies the applicaiton manager that a cloud connection status has + * updated and should trigger an UpdateAppList RPC to the HMI + */ + void OnConnectionStatusUpdated(); + + /** + * @brief Retrieve the current connection status of a cloud app + * @param app A cloud application + * @return The current CloudConnectionStatus of app + */ + hmi_apis::Common_CloudConnectionStatus::eType GetCloudAppConnectionStatus( + ApplicationConstSharedPtr app) const; + + /* + * @brief Returns unique correlation ID for to mobile request + * + * @return Unique correlation ID + */ + uint32_t GetNextMobileCorrelationID() OVERRIDE; + /* * @brief Returns unique correlation ID for HMI request * @@ -476,18 +537,12 @@ class ApplicationManagerImpl // typedef for Applications list typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplictionSet; - typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter> - AppsWaitRegistrationSet; - // typedef for Applications list iterator typedef ApplictionSet::iterator ApplictionSetIt; // typedef for Applications list const iterator typedef ApplictionSet::const_iterator ApplictionSetConstIt; - DataAccessor<AppsWaitRegistrationSet> apps_waiting_for_registration() const; - ApplicationConstSharedPtr waiting_app(const uint32_t hmi_id) const; - /** * @brief Notification from PolicyHandler about PTU. * Compares AppHMIType between saved in app and received from PTU. If they are @@ -678,6 +733,15 @@ class ApplicationManagerImpl uint32_t new_timeout_value) OVERRIDE; /** + * @brief TODO + * + * @param connection_key Connection key of application + * @param mobile_correlation_id Correlation ID of the mobile request + */ + void IncreaseForwardedRequestTimeout(uint32_t connection_key, + uint32_t mobile_correlation_id) OVERRIDE; + + /** * @brief AddPolicyObserver allows to subscribe needed component to events * from policy. * @@ -764,9 +828,9 @@ class ApplicationManagerImpl ApplicationConstSharedPtr application) const; /** - * Getter for resume_controller - * @return Resume Controller - */ + * Getter for resume_controller + * @return Resume Controller + */ resumption::ResumeCtrl& resume_controller() OVERRIDE { return *resume_ctrl_.get(); } @@ -935,8 +999,7 @@ class ApplicationManagerImpl AppV4DevicePredicate(const connection_handler::DeviceHandle handle) : handle_(handle) {} bool operator()(const ApplicationSharedPtr app) const { - return app - ? handle_ == app->device() && + return app ? handle_ == app->device() && Message::is_sufficient_version( protocol_handler::MajorProtocolVersion:: PROTOCOL_VERSION_4, @@ -962,6 +1025,14 @@ class ApplicationManagerImpl } }; + struct AppNamePredicate { + std::string app_name_; + AppNamePredicate(const std::string& app_name) : app_name_(app_name) {} + bool operator()(const ApplicationSharedPtr app) const { + return app ? app->name() == app_name_ : false; + } + }; + /** * @brief Sends UpdateAppList notification to HMI */ @@ -1004,14 +1075,14 @@ class ApplicationManagerImpl } /** - * @brief ProcessReconnection handles reconnection flow for application on - * transport switch - * @param application Pointer to switched application, must be validated - * before passing - * @param connection_key Connection key from registration request of - * switched - * application - */ + * @brief ProcessReconnection handles reconnection flow for application on + * transport switch + * @param application Pointer to switched application, must be validated + * before passing + * @param connection_key Connection key from registration request of + * switched + * application + */ void ProcessReconnection(ApplicationSharedPtr application, const uint32_t connection_key) FINAL; @@ -1078,7 +1149,8 @@ class ApplicationManagerImpl mobile_apis::MOBILE_API& mobile_so_factory(); bool ConvertSOtoMessage(const smart_objects::SmartObject& message, - Message& output); + Message& output, + const bool allow_unknown_parameters = false); template <typename ApplicationList> void PrepareApplicationListSO(ApplicationList app_list, @@ -1382,6 +1454,7 @@ class ApplicationManagerImpl protocol_handler::ProtocolHandler* protocol_handler_; request_controller::RequestController request_ctrl_; std::unique_ptr<plugin_manager::RPCPluginManager> plugin_manager_; + std::unique_ptr<application_manager::AppServiceManager> app_service_manager_; /** * @brief Map contains apps with HMI state before incoming call @@ -1404,6 +1477,7 @@ class ApplicationManagerImpl hmi_apis::HMI_API* hmi_so_factory_; mobile_apis::MOBILE_API* mobile_so_factory_; + static uint32_t mobile_corelation_id_; static uint32_t corelation_id_; static const uint32_t max_corelation_id_; @@ -1449,6 +1523,13 @@ class ApplicationManagerImpl DeviceMap secondary_transport_devices_cache_; + mutable std::shared_ptr<sync_primitives::RecursiveLock> + pending_device_map_lock_ptr_; + std::map<std::string, std::string> pending_device_map_; + + sync_primitives::Lock app_icon_map_lock_ptr_; + std::map<std::string, AppIconInfo> app_icon_map_; + #ifdef TELEMETRY_MONITOR AMTelemetryObserver* metric_observer_; #endif // TELEMETRY_MONITOR @@ -1478,18 +1559,47 @@ class ApplicationManagerImpl void AddMockApplication(ApplicationSharedPtr mock_app); /** + * @brief Add a mock application to the pending application list without going + * through the formal registration process. Only for unit testing. + * @param mock_app the mock app to be added to the pending application list + */ + void AddMockPendingApplication(ApplicationSharedPtr mock_app); + + /** * @brief set a mock media manager without running Init(). Only for unit * testing. - * @param mock_app the mock app to be registered + * @param mock_media_manager the mock media manager to be assigned */ void SetMockMediaManager(media_manager::MediaManager* mock_media_manager); + /** + * @brief set a mock rpc service directly. Only for unit + * testing. + * @param mock_app the mock rpc service to be assigned + */ + void SetMockRPCService(rpc_service::RPCService* rpc_service) { + rpc_service_.reset(rpc_service); + } + + /** + * @brief set a mock rpc service directly. Only for unit + * testing. + * @param mock_app the mock rpc service to be assigned + */ + void SetMockPolicyHandler(policy::PolicyHandlerInterface* policy_handler) { + policy_handler_.reset(policy_handler); + } + virtual void SetPluginManager( std::unique_ptr<plugin_manager::RPCPluginManager>& plugin_manager) OVERRIDE { plugin_manager_.reset(plugin_manager.release()); } + virtual void SetAppServiceManager(AppServiceManager* app_service_manager) { + app_service_manager_.reset(app_service_manager); + } + private: #endif diff --git a/src/components/application_manager/include/application_manager/application_state.h b/src/components/application_manager/include/application_manager/application_state.h index bf894eaf94..d708a6188d 100644 --- a/src/components/application_manager/include/application_manager/application_state.h +++ b/src/components/application_manager/include/application_manager/application_state.h @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_ #include <vector> +#include "application_manager/hmi_state.h" #include "utils/lock.h" #include "utils/macro.h" -#include "application_manager/hmi_state.h" namespace application_manager { @@ -119,11 +119,11 @@ class ApplicationState { void SetRegularState(HmiStatePtr state); /** - * @brief Sets postponed state of application. - * This state could be set as regular later on - * - * @param state state to setup - */ + * @brief Sets postponed state of application. + * This state could be set as regular later on + * + * @param state state to setup + */ void SetPostponedState(HmiStatePtr state); /** @@ -154,6 +154,6 @@ class ApplicationState { DISALLOW_COPY_AND_ASSIGN(ApplicationState); }; -} +} // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_STATE_H_ diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h index 7dc8a0cfc1..f479ee7f37 100644 --- a/src/components/application_manager/include/application_manager/command_factory.h +++ b/src/components/application_manager/include/application_manager/command_factory.h @@ -33,10 +33,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_FACTORY_H -#include "application_manager/commands/command.h" #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" +#include "application_manager/commands/command.h" +#include "application_manager/hmi_capabilities.h" #include "application_manager/policies/policy_handler_interface.h" +#include "application_manager/rpc_service.h" #include "utils/macro.h" namespace application_manager { @@ -63,10 +64,10 @@ class CommandFactory { const commands::MessageSharedPtr& message, commands::Command::CommandSource source) = 0; /** - * @param int32_t command id - * @param CommandSource source - * @return return true if command can be create, else return false - **/ + * @param int32_t command id + * @param CommandSource source + * @return return true if command can be create, else return false + **/ virtual bool IsAbleToProcess( const int32_t, const application_manager::commands::Command::CommandSource source) diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h index 18a1de7526..8867336b3e 100644 --- a/src/components/application_manager/include/application_manager/command_holder_impl.h +++ b/src/components/application_manager/include/application_manager/command_holder_impl.h @@ -35,9 +35,9 @@ #include "application_manager/command_holder.h" +#include <map> #include <string> #include <vector> -#include <map> #include "application_manager/application.h" #include "application_manager/rpc_service.h" #include "smart_objects/smart_object.h" diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h index f8ea7db24d..0693f9868d 100644 --- a/src/components/application_manager/include/application_manager/commands/command.h +++ b/src/components/application_manager/include/application_manager/commands/command.h @@ -100,19 +100,24 @@ class Command { virtual void onTimeOut() = 0; /** - * @brief AllowedToTerminate tells if request controller is allowed - * to terminate this command - * @return - */ + * @brief AllowedToTerminate tells if request controller is allowed + * to terminate this command + * @return + */ virtual bool AllowedToTerminate() = 0; /** - * @brief SetAllowedToTerminate set up allowed to terminate flag. - * If true, request controller will terminate request on response - */ + * @brief SetAllowedToTerminate set up allowed to terminate flag. + * If true, request controller will terminate request on response + */ virtual void SetAllowedToTerminate(const bool allowed) = 0; - enum CommandSource { SOURCE_SDL, SOURCE_MOBILE, SOURCE_HMI }; + enum CommandSource { + SOURCE_SDL, + SOURCE_MOBILE, + SOURCE_HMI, + SOURCE_SDL_TO_HMI + }; }; typedef smart_objects::SmartObjectSPtr MessageSharedPtr; diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h index 4859f73a55..4e52ac23ce 100644 --- a/src/components/application_manager/include/application_manager/commands/command_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_impl.h @@ -33,10 +33,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_IMPL_H_ +#include "application_manager/application_manager.h" #include "application_manager/commands/command.h" #include "application_manager/event_engine/event_observer.h" -#include "application_manager/application_manager.h" #include "application_manager/smart_object_keys.h" +#include "policy/policy_types.h" #include "utils/logger.h" namespace application_manager { @@ -124,18 +125,19 @@ class CommandImpl : public Command { void onTimeOut() OVERRIDE; /** - * @brief AllowedToTerminate tells request Controller if it can terminate this - * request by response. - * By default, RequestCtrl should terminate all requests by their responses. - * If request need to terminate itself, it should override this function false - * @return allowed_to_terminate_ value - */ + * @brief AllowedToTerminate tells request Controller if it can terminate this + * request by response. + * By default, RequestCtrl should terminate all requests by their responses. + * If request need to terminate itself, it should override this function + * false + * @return allowed_to_terminate_ value + */ bool AllowedToTerminate() OVERRIDE; /** - * @brief SetAllowedToTerminate set up allowed to terminate flag. - * If true, request controller will terminate request on response - */ + * @brief SetAllowedToTerminate set up allowed to terminate flag. + * If true, request controller will terminate request on response + */ void SetAllowedToTerminate(const bool allowed) OVERRIDE; // members diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h index 8741dae540..e8485a3abc 100644 --- a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h @@ -53,6 +53,11 @@ class CommandNotificationFromMobileImpl : public CommandImpl { virtual bool CleanUp(); virtual void Run(); void SendNotification(); + void SendNotificationToMobile(); + void SendNotificationToHMI( + const hmi_apis::FunctionID::eType& hmi_function_id); + void SendNotificationToConsumers( + const hmi_apis::FunctionID::eType& hmi_function_id); private: DISALLOW_COPY_AND_ASSIGN(CommandNotificationFromMobileImpl); diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h index 27aa93d1d8..b5a330d907 100644 --- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h @@ -34,10 +34,10 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_IMPL_H_ #include "application_manager/commands/command_impl.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" -#include "utils/lock.h" +#include "interfaces/MOBILE_API.h" #include "smart_objects/smart_object.h" +#include "utils/lock.h" namespace application_manager { namespace commands { @@ -149,6 +149,8 @@ class CommandRequestImpl : public CommandImpl, */ virtual void on_event(const event_engine::Event& event); + virtual void on_event(const event_engine::MobileEvent& event); + /* * @brief Creates Mobile response * @@ -157,10 +159,12 @@ class CommandRequestImpl : public CommandImpl, * @param info Provides additional human readable info regarding the result * @param response_params Additional params in response */ - void SendResponse(const bool success, - const mobile_apis::Result::eType& result_code, - const char* info = NULL, - const smart_objects::SmartObject* response_params = NULL); + void SendResponse( + const bool success, + const mobile_apis::Result::eType& result_code, + const char* info = NULL, + const smart_objects::SmartObject* response_params = NULL, + const std::vector<uint8_t> binary_data = std::vector<uint8_t>()); /** * @brief Check syntax of string from mobile @@ -170,6 +174,16 @@ class CommandRequestImpl : public CommandImpl, */ bool CheckSyntax(const std::string& str, bool allow_empty_line = false); + void SendProviderRequest( + const mobile_apis::FunctionID::eType& mobile_function_id, + const hmi_apis::FunctionID::eType& hmi_function_id, + const smart_objects::SmartObject* msg, + bool use_events = false); + + void SendMobileRequest(const mobile_apis::FunctionID::eType& function_id, + smart_objects::SmartObjectSPtr msg, + bool use_events = false); + /* * @brief Sends HMI request * @@ -235,6 +249,14 @@ class CommandRequestImpl : public CommandImpl, bool HasDisallowedParams() const; /** + * @brief Checks result code from Mobile for single RPC + * @param result_code contains result code from Mobile response + * @return true if result code complies successful result codes, + * false otherwise. + */ + bool IsMobileResultSuccess(mobile_apis::Result::eType result_code) const; + + /** * @brief Checks result code from HMI for single RPC * and returns parameter for sending to mobile app. * @param result_code contains result code from HMI response @@ -313,7 +335,7 @@ class CommandRequestImpl : public CommandImpl, * @param interface_id interface which SDL awaits for response in given time * @return true if SDL awaits for response from given interface in * interface_id - */ + */ bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const; /** @@ -324,7 +346,7 @@ class CommandRequestImpl : public CommandImpl, void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id); /** - * @brief This set stores all the interfaces which are awaited by SDL to + * @brief This set stores all the interfaces which are awaited by SDL to * return a response on some request */ std::set<HmiInterfaces::InterfaceID> awaiting_response_interfaces_; @@ -365,10 +387,10 @@ class CommandRequestImpl : public CommandImpl, const hmi_apis::FunctionID::eType& function_id); /** - * @brief UpdateHash updates hash field for application and sends - * OnHashChanged notification to mobile side in case of approriate hash mode - * is set - */ + * @brief UpdateHash updates hash field for application and sends + * OnHashChanged notification to mobile side in case of approriate hash mode + * is set + */ void UpdateHash(); /** diff --git a/src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h b/src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h new file mode 100644 index 0000000000..430e549523 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/command_request_to_mobile.h @@ -0,0 +1,73 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_TO_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_TO_MOBILE_H_ + +#include "application_manager/application_manager.h" +#include "application_manager/commands/command_impl.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" + +namespace application_manager { + +namespace commands { + +class CommandRequestToMobile : public CommandImpl { + public: + CommandRequestToMobile(const MessageSharedPtr& message, + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + ~CommandRequestToMobile(); + bool Init() OVERRIDE; + bool CleanUp() OVERRIDE; + void Run() OVERRIDE; + void SendRequest(); + + /* + * @brief Retrieves application ID + */ + inline uint32_t application_id() const { + return (*message_)[strings::msg_params][strings::app_id].asUInt(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(CommandRequestToMobile); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_REQUEST_TO_MOBILE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h b/src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h new file mode 100644 index 0000000000..1401888890 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/command_response_from_mobile.h @@ -0,0 +1,73 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_TO_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_TO_MOBILE_H_ + +#include "application_manager/application_manager.h" +#include "application_manager/commands/command_impl.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" + +namespace application_manager { + +namespace commands { + +class CommandResponseFromMobile : public CommandImpl { + public: + CommandResponseFromMobile(const MessageSharedPtr& message, + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + ~CommandResponseFromMobile(); + bool Init() OVERRIDE; + bool CleanUp() OVERRIDE; + void Run() OVERRIDE; + void SendResponse(); + + /* + * @brief Retrieves application ID + */ + inline uint32_t application_id() const { + return (*message_)[strings::msg_params][strings::app_id].asUInt(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(CommandResponseFromMobile); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_RESPONSE_TO_MOBILE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h index 8bbbd0e3de..25cfd7b207 100644 --- a/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/notification_from_hmi.h @@ -53,8 +53,14 @@ class NotificationFromHMI : public CommandImpl { virtual bool CleanUp(); virtual void Run(); void SendNotificationToMobile(const MessageSharedPtr& message); + void SendNotificationToMobile( + const MessageSharedPtr& message, + const mobile_apis::FunctionID::eType& mobile_function_id); + void SendNotificationToHMI(MessageSharedPtr& message); void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const; + void SendNotificationToConsumers( + const mobile_apis::FunctionID::eType& mobile_function_id); private: DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI); diff --git a/src/components/application_manager/include/application_manager/commands/pending.h b/src/components/application_manager/include/application_manager/commands/pending.h index bbfc246659..9083d81d73 100644 --- a/src/components/application_manager/include/application_manager/commands/pending.h +++ b/src/components/application_manager/include/application_manager/commands/pending.h @@ -35,9 +35,9 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PENDING_H_ #include <set> -#include "utils/macro.h" -#include "utils/lock.h" #include "interfaces/HMI_API.h" +#include "utils/lock.h" +#include "utils/macro.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h index 927a45c6a6..4464056175 100644 --- a/src/components/application_manager/include/application_manager/commands/request_from_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/request_from_hmi.h @@ -55,16 +55,22 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver { virtual bool CleanUp(); virtual void Run(); virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::MobileEvent& event) OVERRIDE; /** * @brief SendResponse allows to send response to hmi * @param correlation_id the correlation id for the rfesponse. * @param function_id the function id for which response will be sent * @param result_code the result code. + * @param response_params extra response params. + * @param source command source. */ - void SendResponse(const bool success, - const uint32_t correlation_id, - const hmi_apis::FunctionID::eType function_id, - const hmi_apis::Common_Result::eType result_code); + void SendResponse( + const bool success, + const uint32_t correlation_id, + const hmi_apis::FunctionID::eType function_id, + const hmi_apis::Common_Result::eType result_code, + const smart_objects::SmartObject* response_params = NULL, + commands::Command::CommandSource source = commands::Command::SOURCE_HMI); /** * @brief SendResponse allows to send error response to hmi @@ -72,11 +78,39 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver { * @param function_id the function id for which response will be sent * @param result_code the result code. * @param error_message info message for error. + * @param source command source. */ - void SendErrorResponse(const uint32_t correlation_id, - const hmi_apis::FunctionID::eType function_id, - const hmi_apis::Common_Result::eType result_code, - const std::string error_message); + void SendErrorResponse( + const uint32_t correlation_id, + const hmi_apis::FunctionID::eType function_id, + const hmi_apis::Common_Result::eType result_code, + const std::string error_message, + commands::Command::CommandSource source = commands::Command::SOURCE_HMI); + + void SendProviderRequest( + const mobile_apis::FunctionID::eType& mobile_function_id, + const hmi_apis::FunctionID::eType& hmi_function_id, + const smart_objects::SmartObject* msg, + bool use_events = false); + + void SendMobileRequest(const mobile_apis::FunctionID::eType& function_id, + const ApplicationSharedPtr app, + const smart_objects::SmartObject* msg_params, + bool use_events); + + void SendHMIRequest(const hmi_apis::FunctionID::eType& function_id, + const smart_objects::SmartObject* msg_params, + bool use_events); + + bool ProcessHMIInterfacesAvailability( + const uint32_t hmi_correlation_id, + const hmi_apis::FunctionID::eType& function_id); + + protected: + bool IsMobileResultSuccess(mobile_apis::Result::eType result_code) const; + + bool IsHMIResultSuccess(hmi_apis::Common_Result::eType result_code, + HmiInterfaces::InterfaceID interface) const; private: /** diff --git a/src/components/application_manager/include/application_manager/commands/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h index 91586a74ce..e8850fbe8d 100644 --- a/src/components/application_manager/include/application_manager/commands/request_to_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/request_to_hmi.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_REQUEST_TO_HMI_H_ -#include "application_manager/commands/command_impl.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/command_impl.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/commands/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h index 605d04067e..6c00957d3f 100644 --- a/src/components/application_manager/include/application_manager/commands/response_from_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/response_from_hmi.h @@ -1,40 +1,40 @@ /* -* Copyright (c) 2018, Ford Motor Company -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* Redistributions of source code must retain the above copyright notice, this -* list of conditions and the following disclaimer. -* -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following -* disclaimer in the documentation and/or other materials provided with the -* distribution. -* -* Neither the name of the Ford Motor Company nor the names of its contributors -* may be used to endorse or promote products derived from this software -* without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_RESPONSE_FROM_HMI_H_ -#include "application_manager/commands/command_impl.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/command_impl.h" #include "interfaces/HMI_API.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/event_engine/event.h b/src/components/application_manager/include/application_manager/event_engine/event.h index 68ee508a9b..e7382e01a4 100644 --- a/src/components/application_manager/include/application_manager/event_engine/event.h +++ b/src/components/application_manager/include/application_manager/event_engine/event.h @@ -34,9 +34,10 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_H_ #include <interfaces/HMI_API.h> +#include <interfaces/MOBILE_API.h> -#include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace application_manager { namespace event_engine { @@ -130,9 +131,9 @@ int32_t Event::smart_object_function_id() const { } int32_t Event::smart_object_correlation_id() const { - return response_so_.getElement(strings::params) - .getElement(strings::correlation_id) - .asInt(); + return static_cast<int32_t>(response_so_.getElement(strings::params) + .getElement(strings::correlation_id) + .asInt()); } int32_t Event::smart_object_type() const { @@ -141,6 +142,104 @@ int32_t Event::smart_object_type() const { .asInt(); } +class MobileEvent { + public: + // Typedef for possible Event ID's from mobile_apis functionID enum + typedef mobile_apis::FunctionID::eType MobileEventID; + + /* + * @brief Constructor with parameters + * + * @param id Event ID. Please see mobile_apis::FunctionID for possible ID's + */ + explicit MobileEvent(const MobileEventID& id); + + /* + * @brief Destructor + */ + virtual ~MobileEvent(); + + /* + * @brief Sends synchronously event to all subscribers. + * + */ + void raise(EventDispatcher& event_dispatcher); + + /* + * @brief Provides event ID + */ + inline const MobileEventID& id() const; + + /* + * @brief Sets event smart object + * + * @param so The smart_object received in Mobile response + */ + void set_smart_object(const smart_objects::SmartObject& so); + + /* + * @brief Retrieves event smart object + * + * @return The smart_object received in Mobile response + */ + inline const smart_objects::SmartObject& smart_object() const; + + /* + * @brief Retrieves smart object request ID + */ + inline int32_t smart_object_function_id() const; + + /* + * @brief Retrieves smart object correlation ID + */ + inline int32_t smart_object_correlation_id() const; + + /* + * @brief Retrieves smart_object response type + */ + inline int32_t smart_object_type() const; + + protected: + private: + MobileEventID id_; + smart_objects::SmartObject response_so_; + + /* + * @brief Default constructor + * + * Unimplemented to avoid misusing + */ + MobileEvent(); + + DISALLOW_COPY_AND_ASSIGN(MobileEvent); +}; + +const MobileEvent::MobileEventID& MobileEvent::id() const { + return id_; +} + +const smart_objects::SmartObject& MobileEvent::smart_object() const { + return response_so_; +} + +int32_t MobileEvent::smart_object_function_id() const { + return static_cast<int32_t>(response_so_.getElement(strings::params) + .getElement(strings::function_id) + .asInt()); +} + +int32_t MobileEvent::smart_object_correlation_id() const { + return static_cast<int32_t>(response_so_.getElement(strings::params) + .getElement(strings::correlation_id) + .asInt()); +} + +int32_t MobileEvent::smart_object_type() const { + return static_cast<int32_t>(response_so_.getElement(strings::params) + .getElement(strings::message_type) + .asInt()); +} + } // namespace event_engine } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h index 813dda0295..0656372f47 100644 --- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h +++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h @@ -77,6 +77,42 @@ class EventDispatcher { */ virtual void remove_observer(EventObserver& observer) = 0; + // Mobile Events + + /* + * @brief Delivers the event to all subscribers + * + * @param event Received event + */ + virtual void raise_mobile_event(const MobileEvent& event) = 0; + + /* + * @brief Subscribe the observer to event + * + * @param event_id The event ID to subscribe for + * @param hmi_correlation_id The event HMI correlation ID + * @param observer The observer to subscribe for event + */ + virtual void add_mobile_observer(const MobileEvent::MobileEventID& event_id, + int32_t mobile_correlation_id, + EventObserver& observer) = 0; + + /* + * @brief Unsubscribes the observer from specific event + * + * @param event_id The event ID to unsubscribe from + * @param observer The observer to be unsubscribed + */ + virtual void remove_mobile_observer( + const MobileEvent::MobileEventID& event_id, EventObserver& observer) = 0; + + /* + * @brief Unsubscribes the observer from all events + * + * @param observer The observer to be unsubscribed + */ + virtual void remove_mobile_observer(EventObserver& observer) = 0; + /* * @brief Destructor */ diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h index ed923369ac..3644299499 100644 --- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h +++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_ -#include <vector> #include <map> +#include <vector> #include "utils/lock.h" @@ -52,6 +52,8 @@ class EventDispatcherImpl : public EventDispatcher { typedef std::vector<EventObserver*> ObserverVector; typedef std::map<int32_t, ObserverVector> ObserversMap; typedef std::map<Event::EventID, ObserversMap> EventObserverMap; + typedef std::map<MobileEvent::MobileEventID, ObserversMap> + MobileEventObserverMap; /* * @brief Destructor */ @@ -66,6 +68,9 @@ class EventDispatcherImpl : public EventDispatcher { EventObserverMap get_observers() const { return observers_event_; } + MobileEventObserverMap get_mobile_observers() const { + return mobile_observers_event_; + } ObserverVector get_observers_list() const { return observers_; } @@ -105,6 +110,41 @@ class EventDispatcherImpl : public EventDispatcher { */ void remove_observer(EventObserver& observer) OVERRIDE; + // Mobile requests + /* + * @brief Delivers the event to all subscribers + * + * @param event Received event + */ + void raise_mobile_event(const MobileEvent& event) OVERRIDE; + + /* + * @brief Subscribe the observer to event + * + * @param event_id The event ID to subscribe for + * @param hmi_correlation_id The event HMI correlation ID + * @param observer The observer to subscribe for event + */ + void add_mobile_observer(const MobileEvent::MobileEventID& event_id, + int32_t mobile_correlation_id, + EventObserver& observer) OVERRIDE; + + /* + * @brief Unsubscribes the observer from specific event + * + * @param event_id The event ID to unsubscribe from + * @param observer The observer to be unsubscribed + */ + void remove_mobile_observer(const MobileEvent::MobileEventID& event_id, + EventObserver& observer) OVERRIDE; + + /* + * @brief Unsubscribes the observer from all events + * + * @param observer The observer to be unsubscribed + */ + void remove_mobile_observer(EventObserver& observer) OVERRIDE; + private: /* * @brief removes observer @@ -113,14 +153,25 @@ class EventDispatcherImpl : public EventDispatcher { */ void remove_observer_from_vector(EventObserver& observer); + /* + * @brief removes observer + * when occurs unsubscribe from event + * @param observer to be removed + */ + void remove_mobile_observer_from_vector(EventObserver& observer); + DISALLOW_COPY_AND_ASSIGN(EventDispatcherImpl); private: // Members section sync_primitives::Lock state_lock_; + sync_primitives::Lock mobile_state_lock_; sync_primitives::RecursiveLock observer_lock_; + sync_primitives::RecursiveLock mobile_observer_lock_; EventObserverMap observers_event_; + MobileEventObserverMap mobile_observers_event_; ObserverVector observers_; + ObserverVector mobile_observers_; }; } // namespace event_engine diff --git a/src/components/application_manager/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/include/application_manager/event_engine/event_observer.h index 593f1df657..7a7fe7c2ec 100644 --- a/src/components/application_manager/include/application_manager/event_engine/event_observer.h +++ b/src/components/application_manager/include/application_manager/event_engine/event_observer.h @@ -72,6 +72,8 @@ class EventObserver { */ virtual void on_event(const Event& event) = 0; + virtual void on_event(const MobileEvent& event); + protected: /* * @brief Subscribe to an event @@ -94,7 +96,38 @@ class EventObserver { * @brief Unsubscribes the observer from all events * */ - void unsubscribe_from_all_events(); + DEPRECATED void unsubscribe_from_all_events(); + + /* + * @brief Unsubscribes the observer from all events + * + */ + void unsubscribe_from_all_hmi_events(); + + // Mobile Events + + /* + * @brief Subscribe to an event + * + * @param event_id The event ID to subscribe for + * @param mobile_correlation_id The event mobile correlation ID. + * If param is omitted, it means subscription for mobile notification + */ + void subscribe_on_event(const MobileEvent::MobileEventID& event_id, + int32_t mobile_correlation_id = 0); + + /* + * @brief Unsubscribes the observer from specific event + * + * @param event_id The event ID to unsubscribe from + */ + void unsubscribe_from_event(const MobileEvent::MobileEventID& event_id); + + /* + * @brief Unsubscribes the observer from all events + * + */ + void unsubscribe_from_all_mobile_events(); private: ObserverID id_; diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager.h b/src/components/application_manager/include/application_manager/help_prompt_manager.h index a0c34e77d7..eb45705d9f 100644 --- a/src/components/application_manager/include/application_manager/help_prompt_manager.h +++ b/src/components/application_manager/include/application_manager/help_prompt_manager.h @@ -28,7 +28,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_H_ diff --git a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h index 81754a60b0..3cd22a6afc 100644 --- a/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h +++ b/src/components/application_manager/include/application_manager/help_prompt_manager_impl.h @@ -28,7 +28,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELP_PROMPT_MANAGER_IMPL_H_ @@ -56,7 +56,7 @@ class HelpPromptManagerImpl : public HelpPromptManager { public: /** * @brief Container for buffering VR help commands - */ + */ typedef std::pair<uint32_t, smart_objects::SmartObjectSPtr> VRCommandPair; typedef std::vector<VRCommandPair> VRCommandPairs; @@ -94,12 +94,12 @@ class HelpPromptManagerImpl : public HelpPromptManager { const bool is_resumption) OVERRIDE; /** - * @brief Stop constructing vrHelp and/or helpPrompt if they are present in - * message - * @param msg containing GlobalProperties - * @param is_response determines is the request or response for the for - * the SetGlobalPropertiesRequest - */ + * @brief Stop constructing vrHelp and/or helpPrompt if they are present in + * message + * @param msg containing GlobalProperties + * @param is_response determines is the request or response for the for + * the SetGlobalPropertiesRequest + */ void OnSetGlobalPropertiesReceived(const smart_objects::SmartObject& msg, const bool is_response) OVERRIDE; diff --git a/src/components/application_manager/include/application_manager/helpers/application_helper.h b/src/components/application_manager/include/application_manager/helpers/application_helper.h index 145bef659e..18267c9e7f 100644 --- a/src/components/application_manager/include/application_manager/helpers/application_helper.h +++ b/src/components/application_manager/include/application_manager/helpers/application_helper.h @@ -57,6 +57,18 @@ ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor, return app; } +template <class UnaryPredicate> +ApplicationSharedPtr FindPendingApp( + DataAccessor<AppsWaitRegistrationSet> accessor, UnaryPredicate finder) { + AppsWaitRegistrationSet::iterator it = std::find_if( + accessor.GetData().begin(), accessor.GetData().end(), finder); + if (accessor.GetData().end() == it) { + return ApplicationSharedPtr(); + } + ApplicationSharedPtr app = *it; + return app; +} + /** * Helper function for lookup through applications list and returning all * applications satisfying predicate logic diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index 9380fb41ac..94fc293c3e 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -28,18 +28,18 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_ #include "application_manager/hmi_capabilities.h" +#include "application_manager/hmi_language_handler.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" #include "json/json.h" -#include "utils/macro.h" -#include "application_manager/hmi_language_handler.h" #include "smart_objects/smart_object.h" +#include "utils/macro.h" namespace resumption { class LastState; diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h index 59ec32694a..5f172b415d 100644 --- a/src/components/application_manager/include/application_manager/hmi_interfaces.h +++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h @@ -60,7 +60,8 @@ class HmiInterfaces { HMI_INTERFACE_Navigation, HMI_INTERFACE_VehicleInfo, HMI_INTERFACE_SDL, - HMI_INTERFACE_RC + HMI_INTERFACE_RC, + HMI_INTERFACE_AppService }; /** diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h index 2b2d1e1361..3202d44e1e 100644 --- a/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_interfaces_impl.h @@ -34,8 +34,8 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_INTERFACES_IMPL_H_ #include <map> #include "application_manager/hmi_interfaces.h" -#include "utils/macro.h" #include "utils/lock.h" +#include "utils/macro.h" /** * @brief The HmiInterfacesImpl class handles * hmi interfaces states diff --git a/src/components/application_manager/include/application_manager/hmi_language_handler.h b/src/components/application_manager/include/application_manager/hmi_language_handler.h index 6158cb4585..edf0759114 100644 --- a/src/components/application_manager/include/application_manager/hmi_language_handler.h +++ b/src/components/application_manager/include/application_manager/hmi_language_handler.h @@ -28,15 +28,15 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_LANGUAGE_HANDLER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_LANGUAGE_HANDLER_H_ #include "application_manager/event_engine/event_observer.h" -#include "utils/lock.h" #include "interfaces/HMI_API.h" #include "smart_objects/smart_object.h" +#include "utils/lock.h" namespace resumption { class LastState; @@ -56,8 +56,8 @@ class HMILanguageHandler : public event_engine::EventObserver { typedef std::map<uint32_t, bool> Apps; /** - * @brief System interfaces - */ + * @brief System interfaces + */ enum Interface { INTERFACE_UI, INTERFACE_VR, INTERFACE_TTS }; /** diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h index 07d9c8dc23..b6a4c180e6 100644 --- a/src/components/application_manager/include/application_manager/hmi_state.h +++ b/src/components/application_manager/include/application_manager/hmi_state.h @@ -48,11 +48,11 @@ class Application; typedef std::shared_ptr<HmiState> HmiStatePtr; /** -* @brief The HmiState class -* Handle Hmi state of application (hmi level, -* audio streaming state, system context) -* -*/ + * @brief The HmiState class + * Handle Hmi state of application (hmi level, + * audio streaming state, system context) + * + */ class HmiState { friend std::ostream& operator<<(std::ostream& os, const HmiState& src); @@ -207,7 +207,7 @@ class HmiState { } protected: - std::shared_ptr<Application> app_; + uint32_t hmi_app_id_; StateID state_id_; const ApplicationManager& app_mngr_; HmiStatePtr parent_; diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 1c319cf204..7525ff1aa3 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -36,9 +36,9 @@ #include <string> #include <vector> +#include "protocol/common.h" #include "protocol/message_priority.h" #include "protocol/rpc_type.h" -#include "protocol/common.h" #include "smart_objects/smart_object.h" namespace application_manager { 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 609b240301..2671278442 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -37,20 +37,20 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_HELPER_H_ #include <map> -#include <vector> #include <string> +#include <vector> -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" -#include "utils/macro.h" -#include "connection_handler/device.h" +#include <application_manager/smart_object_keys.h> #include "application_manager/application.h" +#include "application_manager/policies/policy_handler_interface.h" +#include "connection_handler/device.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "policy/policy_types.h" #include "protocol_handler/session_observer.h" -#include "application_manager/policies/policy_handler_interface.h" #include "smart_objects/smart_object.h" #include "transport_manager/common.h" -#include <application_manager/smart_object_keys.h> +#include "utils/macro.h" namespace policy { class PolicyHandlerInterface; @@ -73,18 +73,18 @@ typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData; class MessageHelper { public: /** - * @brief CreateNotification creates basic mobile notification smart object - * @param function_id Notification function ID - * @param app_id application to send notification - * @return basic mobile notification smart object - */ + * @brief CreateNotification creates basic mobile notification smart object + * @param function_id Notification function ID + * @param app_id application to send notification + * @return basic mobile notification smart object + */ static smart_objects::SmartObjectSPtr CreateNotification( mobile_apis::FunctionID::eType function_id, uint32_t app_id); /** - * @brief CreateHMINotification creates basic hmi notification smart object - * @param function_id Notification function ID - * @return basic hmi notification smart object - */ + * @brief CreateHMINotification creates basic hmi notification smart object + * @param function_id Notification function ID + * @return basic hmi notification smart object + */ static smart_objects::SmartObjectSPtr CreateHMINotification( hmi_apis::FunctionID::eType function_id); @@ -118,18 +118,18 @@ class MessageHelper { static void SendOnLanguageChangeToMobile(uint32_t connection_key); /** - * @brief Sends DecryptCertificate request to HMI - * @param file_name path to file containing encrypted certificate - */ + * @brief Sends DecryptCertificate request to HMI + * @param file_name path to file containing encrypted certificate + */ static void SendDecryptCertificateToHMI(const std::string& file_name, ApplicationManager& app_mngr); /** - * @brief SendGetSystemTimeRequest sends mentioned request to HMI. - * @param correlation_id the message correlation id, required for proper - * response processing. - * @param app_mngr - */ + * @brief SendGetSystemTimeRequest sends mentioned request to HMI. + * @param correlation_id the message correlation id, required for proper + * response processing. + * @param app_mngr + */ static void SendGetSystemTimeRequest(const uint32_t correlation_id, ApplicationManager& app_mngr); @@ -205,17 +205,17 @@ class MessageHelper { const std::string& hmi_level); /* - * @brief Used to obtain string representation of app's - * HMI Level. - * @param hmi_level Desired HMI Level - */ + * @brief Used to obtain string representation of app's + * HMI Level. + * @param hmi_level Desired HMI Level + */ static std::string StringifiedHMILevel( const mobile_apis::HMILevel::eType hmi_level); /* - * @brief Used to obtain function name by its id - * @param function_id Function ID - */ + * @brief Used to obtain function name by its id + * @param function_id Function ID + */ static std::string StringifiedFunctionID( mobile_apis::FunctionID::eType function_id); @@ -348,40 +348,41 @@ class MessageHelper { bool is_unexpected_disconnect, ApplicationManager& app_mngr); - static ns_smart_device_link::ns_smart_objects::SmartObjectSPtr - GetBCActivateAppRequestToHMI( + static smart_objects::SmartObjectSPtr GetBCActivateAppRequestToHMI( ApplicationConstSharedPtr app, - const protocol_handler::SessionObserver& session_observer, const policy::PolicyHandlerInterface& policy_handler, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority, ApplicationManager& app_mngr); + static smart_objects::SmartObjectSPtr GetBCCloseApplicationRequestToHMI( + ApplicationConstSharedPtr app, ApplicationManager& app_mngr); + static void SendOnResumeAudioSourceToHMI(const uint32_t app_id, ApplicationManager& app_mngr); /** - * @brief Send SDL_ActivateApp response to HMI - * @param permissions response parameters - */ + * @brief Send SDL_ActivateApp response to HMI + * @param permissions response parameters + */ static void SendSDLActivateAppResponse(policy::AppPermissions& permissions, uint32_t correlation_id, ApplicationManager& app_mngr); /** - * @brief Send OnSDLConsentNeeded to HMI for device data consent by user - * @param device_info Device info, e.g. mac, handle, name - */ + * @brief Send OnSDLConsentNeeded to HMI for device data consent by user + * @param device_info Device info, e.g. mac, handle, name + */ static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info, ApplicationManager& app_man); /** - * @brief Send request to SyncP process to read file and send - * Policy Table Snapshot using Retry Strategy - * @param file_path Path to file with PTS - * @param timeout Timeout to wait for PTU in seconds - * @param retries Seconds between retries - */ + * @brief Send request to SyncP process to read file and send + * Policy Table Snapshot using Retry Strategy + * @param file_path Path to file with PTS + * @param timeout Timeout to wait for PTU in seconds + * @param retries Seconds between retries + */ static void SendPolicyUpdate(const std::string& file_path, const uint32_t timeout, const std::vector<int>& retries, @@ -445,13 +446,13 @@ class MessageHelper { static void SendNaviStopStream(int32_t app_id, 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 - */ + * @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 + */ static void SendPolicySnapshotNotification( uint32_t connection_key, const std::vector<uint8_t>& policy_data, @@ -485,20 +486,20 @@ class MessageHelper { ApplicationManager& app_man); /* - * @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 - */ + * @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 + */ static void SendOnPermissionsChangeNotification( uint32_t connection_key, const policy::Permissions& permissions, ApplicationManager& app_mngr); /* - * @brief Send notification to HMI on application permissions update - * @param connection_key Id of application to send message to - * @param permissions updated permissions for application - */ + * @brief Send notification to HMI on application permissions update + * @param connection_key Id of application to send message to + * @param permissions updated permissions for application + */ static void SendOnAppPermissionsChangedNotification( uint32_t connection_key, const policy::AppPermissions& permissions, @@ -610,12 +611,12 @@ class MessageHelper { ApplicationManager& app_mngr); /** - * @brief Verify image and add image file full path - * and add path, although the image doesn't exist - * @param SmartObject with image - * @param app current application - * @return verification result - */ + * @brief Verify image and add image file full path + * and add path, although the image doesn't exist + * @param SmartObject with image + * @param app current application + * @return verification result + */ static void ApplyImagePath(smart_objects::SmartObject& image, ApplicationConstSharedPtr app, ApplicationManager& app_mngr); @@ -636,10 +637,10 @@ class MessageHelper { ApplicationManager& app_mngr); /** - * @brief Stores whether each choice in a set has the vrCommands parameter - * MIXED means some choices have vrCommands and others don't - * ALL means all do, NONE means none do - */ + * @brief Stores whether each choice in a set has the vrCommands parameter + * MIXED means some choices have vrCommands and others don't + * ALL means all do, NONE means none do + */ enum ChoiceSetVRCommandsStatus { MIXED, ALL, NONE }; /** @@ -786,6 +787,14 @@ class MessageHelper { static hmi_apis::Common_Language::eType CommonLanguageFromString( const std::string& language); + /** + * @brief CommonLightNameFromString convert string to LightName enum value + * @param lightName string to convert + * @return value LightName enum value + */ + static hmi_apis::Common_LightName::eType CommonLightNameFromString( + const std::string& lightName); + static smart_objects::SmartObjectSPtr GetOnAppInterfaceUnregisteredNotificationToMobile( int32_t connection_key, @@ -878,6 +887,12 @@ class MessageHelper { static smart_objects::SmartObjectSPtr CreateMessageForHMI( hmi_apis::messageType::eType message_type, const uint32_t correlation_id); + static smart_objects::SmartObject CreateAppServiceCapabilities( + std::vector<smart_objects::SmartObject>& all_services); + + static void BroadcastCapabilityUpdate(smart_objects::SmartObject& msg_params, + ApplicationManager& app_mngr); + private: /** * @brief Allows to fill SO according to the current permissions. diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h index b2ad963f46..3b02424e1f 100644 --- a/src/components/application_manager/include/application_manager/mobile_message_handler.h +++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_ -#include "utils/macro.h" -#include "protocol/common.h" #include "application_manager/message.h" +#include "protocol/common.h" +#include "utils/macro.h" namespace application_manager { typedef std::shared_ptr<application_manager::Message> MobileMessage; diff --git a/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h b/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h new file mode 100644 index 0000000000..96a7f27064 --- /dev/null +++ b/src/components/application_manager/include/application_manager/plugin_manager/plugin_keys.h @@ -0,0 +1,48 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_PLUGIN_KEYS_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_PLUGIN_KEYS_H + +namespace application_manager { +namespace plugin_manager { + +namespace plugin_names { +extern const char* vehicle_info_rpc_plugin; +extern const char* app_service_rpc_plugin; +extern const char* rc_rpc_plugin; +extern const char* sdl_rpc_plugin; +} // namespace plugin_names + +} // namespace plugin_manager +} // namespace application_manager +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_PLUGIN_KEYS_H diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h index 09a412b2ac..aea0361f19 100644 --- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h +++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin.h @@ -33,12 +33,12 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_H #include <memory> -#include "utils/macro.h" -#include "application_manager/commands/command.h" #include "application_manager/application.h" -#include "application_manager/rpc_service.h" +#include "application_manager/commands/command.h" #include "application_manager/hmi_capabilities.h" #include "application_manager/policies/policy_handler_interface.h" +#include "application_manager/rpc_service.h" +#include "utils/macro.h" namespace application_manager { class CommandFactory; @@ -68,13 +68,13 @@ class RPCPlugin { virtual ~RPCPlugin() {} /** - * @brief Command initialization function - * @param app_manager ApplicationManager - * @param rpc_service RPCService - * @param hmi_capabilities HMICapabilities - * @param policy_handler PolicyHandlerInterface - * @return true in case initialization was succesful, false otherwise. - **/ + * @brief Command initialization function + * @param app_manager ApplicationManager + * @param rpc_service RPCService + * @param hmi_capabilities HMICapabilities + * @param policy_handler PolicyHandlerInterface + * @return true in case initialization was succesful, false otherwise. + **/ virtual bool Init(ApplicationManager& app_manager, rpc_service::RPCService& rpc_service, HMICapabilities& hmi_capabilities, diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h index 692d296607..b658e40b1c 100644 --- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h +++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager.h @@ -33,10 +33,10 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_H #include <cstdint> -#include <string> +#include <functional> #include <memory> +#include <string> #include <vector> -#include <functional> #include "application_manager/plugin_manager/rpc_plugin.h" #include "utils/optional.h" diff --git a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h index 5f85d45b6e..885181e9c4 100644 --- a/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h +++ b/src/components/application_manager/include/application_manager/plugin_manager/rpc_plugin_manager_impl.h @@ -32,11 +32,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_PLUGIN_MANAGER_RPC_PLUGIN_MANAGER_IMPL_H -#include "application_manager/plugin_manager/rpc_plugin_manager.h" #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" #include "application_manager/hmi_capabilities.h" +#include "application_manager/plugin_manager/rpc_plugin_manager.h" #include "application_manager/policies/policy_handler_interface.h" +#include "application_manager/rpc_service.h" #include "utils/optional.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h index f501598e0f..114b4e2d77 100644 --- a/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h +++ b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h @@ -33,19 +33,19 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_APP_PERMISSION_DELEGATE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_APP_PERMISSION_DELEGATE_H_ +#include "utils/conditional_variable.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/conditional_variable.h" -#include "policy/policy_types.h" #include "application_manager/policies/policy_handler_interface.h" +#include "policy/policy_types.h" namespace policy { class PolicyHandler; /** -*@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent -*in async way. -*/ + *@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent + *in async way. + */ class AppPermissionDelegate : public threads::ThreadDelegate { public: /** diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h index 2fe4265f54..38a60b29c4 100644 --- a/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h +++ b/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h @@ -35,10 +35,10 @@ #include <string> +#include "application_manager/usage_statistics.h" +#include "utils/conditional_variable.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/conditional_variable.h" -#include "application_manager/usage_statistics.h" namespace policy { diff --git a/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h index 8c904bf513..7d71611a3c 100644 --- a/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h +++ b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_ -#include "smart_objects/smart_object.h" #include "application_manager/event_engine/event_observer.h" +#include "smart_objects/smart_object.h" #include "utils/lock.h" namespace policy { @@ -48,6 +48,7 @@ class PolicyEventObserver application_manager::event_engine::EventDispatcher& event_dispatcher); void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler); void on_event(const application_manager::event_engine::Event& event); + void on_event(const application_manager::event_engine::MobileEvent& event); void subscribe_on_event( const application_manager::event_engine::Event::EventID& event_id, int32_t hmi_correlation_id = 0); diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index c8f3bcf888..abffd3eebb 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -33,28 +33,28 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_ -#include <string> +#include <stdint.h> +#include <list> #include <map> #include <set> +#include <string> #include <vector> -#include <list> -#include <stdint.h> -#include "policy/policy_manager.h" #include "application_manager/application.h" -#include "application_manager/policies/policy_handler_interface.h" -#include "application_manager/policies/policy_event_observer.h" #include "application_manager/policies/delegates/statistics_delegate.h" +#include "application_manager/policies/policy_event_observer.h" +#include "application_manager/policies/policy_handler_interface.h" #include "application_manager/policies/policy_handler_observer.h" -#include "utils/logger.h" -#include "utils/threads/thread.h" -#include "utils/threads/thread_delegate.h" +#include "policy/policy_manager.h" +#include "policy/policy_settings.h" +#include "policy/usage_statistics/statistics_manager.h" #include "utils/conditional_variable.h" -#include "utils/rwlock.h" #include "utils/custom_string.h" -#include "policy/usage_statistics/statistics_manager.h" +#include "utils/logger.h" +#include "utils/rwlock.h" #include "utils/threads/async_runner.h" -#include "policy/policy_settings.h" +#include "utils/threads/thread.h" +#include "utils/threads/thread_delegate.h" namespace Json { class Value; @@ -187,6 +187,8 @@ class PolicyHandler : public PolicyHandlerInterface, void GetUpdateUrls(const uint32_t service_type, EndpointUrls& out_end_points) OVERRIDE; virtual std::string GetLockScreenIconUrl() const OVERRIDE; + virtual std::string GetIconUrl( + const std::string& policy_app_id) const OVERRIDE; uint32_t NextRetryTimeout() OVERRIDE; /** @@ -398,6 +400,88 @@ class PolicyHandler : public PolicyHandlerInterface, custom_str::CustomString GetAppName( const std::string& policy_app_id) OVERRIDE; + /** + * @brief Get a list of enabled cloud applications + * @param enabled_apps List filled with the policy app id of each enabled + * cloud application + */ + void GetEnabledCloudApps( + std::vector<std::string>& enabled_apps) const OVERRIDE; + + /** + * @brief Checks if a given application is an enabled cloud application + * @param policy_app_id Unique application id + * @return true, if the application is an enabled cloud application, + * otherwise - false + */ + const bool CheckCloudAppEnabled( + const std::string& policy_app_id) const OVERRIDE; + + /** + * @brief Get cloud app policy information, all fields that aren't set for a + * given app will be filled with empty strings + * @param policy_app_id Unique application id + * @param enabled Whether or not the app is enabled + * @param endpoint Filled with the endpoint used to connect to the cloud + * application + * @param certificate Filled with the certificate used to for creating a + * secure connection to the cloud application + * @param auth_token Filled with the token used for authentication when + * reconnecting to the cloud app + * @param cloud_transport_type Filled with the transport type used by the + * cloud application (ex. "WSS") + * @param hybrid_app_preference Filled with the hybrid app preference for the + * cloud application set by the user + */ + bool GetCloudAppParameters(const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const OVERRIDE; + + /** + * @brief Callback for when a SetCloudAppProperties message is received from a + * mobile app + * @param message The SetCloudAppProperties message + */ + void OnSetCloudAppProperties( + const smart_objects::SmartObject& message) OVERRIDE; + + /** + * @brief Get app service parameters from the policy table + * @param policy_app_id Unique application id + * @param app_service_parameters Pointer to struct containing all app service + * information + */ + void GetAppServiceParameters(const std::string& policy_app_id, + policy_table::AppServiceParameters* + app_service_parameters) const OVERRIDE; + /** + * @brief Check app service parameters from an app against policies + * @param policy_app_id Unique application id + * @param requested_service_name Service name published by app service + * provider + * @param requested_service_type Service type published by app service + * provider + * @param requested_handled_rpcs Vector of requested function ids an app + * service wants to handle from consumers + */ + bool CheckAppServiceParameters( + const std::string& policy_app_id, + const std::string& requested_service_name, + const std::string& requested_service_type, + smart_objects::SmartArray* requested_handled_rpcs) const OVERRIDE; + + /** + * @brief Check if an app can send unknown rpc requests to an app service + * provider + * @param policy_app_id Unique application id + */ + bool UnknownRPCPassthroughAllowed( + const std::string& policy_app_id) const OVERRIDE; + virtual void OnUpdateHMIAppType( std::map<std::string, StringArray> app_hmi_types) OVERRIDE; @@ -406,6 +490,9 @@ class PolicyHandler : public PolicyHandlerInterface, #ifdef EXTERNAL_PROPRIETARY_MODE void OnCertificateDecrypted(bool is_succeeded) OVERRIDE; #endif // EXTERNAL_PROPRIETARY_MODE + void OnAuthTokenUpdated(const std::string& policy_app_id, + const std::string& auth_token); + virtual bool CanUpdate() OVERRIDE; virtual void OnDeviceConsentChanged(const std::string& device_id, @@ -724,10 +811,10 @@ class PolicyHandler : public PolicyHandlerInterface, static const std::string kLibrary; /** - * @brief Collects currently registered applications ids linked to their - * device id - * @param out_links Collection of device_id-to-app_id links - */ + * @brief Collects currently registered applications ids linked to their + * device id + * @param out_links Collection of device_id-to-app_id links + */ void GetRegisteredLinks(std::map<std::string, std::string>& out_links) const; private: diff --git a/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h index 6913f5038e..7e83aefe81 100644 --- a/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h +++ b/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h @@ -33,18 +33,18 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_ +#include "utils/conditional_variable.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/conditional_variable.h" -#include "policy/policy_types.h" #include "application_manager/policies/policy_handler_interface.h" +#include "policy/policy_types.h" namespace policy { /** -*@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent -*in async way. -*/ + *@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent + *in async way. + */ class AppPermissionDelegate : public threads::ThreadDelegate { public: /** diff --git a/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h index 3dc9ad925c..74d88fac69 100644 --- a/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h +++ b/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h @@ -35,10 +35,10 @@ #include <string> +#include "application_manager/usage_statistics.h" +#include "utils/conditional_variable.h" #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" -#include "utils/conditional_variable.h" -#include "application_manager/usage_statistics.h" namespace policy { diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h index f4924111b3..4a104812a4 100644 --- a/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h +++ b/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h @@ -48,6 +48,7 @@ class PolicyEventObserver application_manager::event_engine::EventDispatcher& event_dispatcher); void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler); void on_event(const application_manager::event_engine::Event& event); + void on_event(const application_manager::event_engine::MobileEvent& event); void subscribe_on_event( const application_manager::event_engine::Event::EventID& event_id, int32_t hmi_correlation_id = 0); diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h b/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h index 07d234f036..3c4dce2fbc 100644 --- a/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h +++ b/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_ -#include <vector> -#include <string> #include <map> +#include <string> +#include <vector> namespace policy { @@ -48,6 +48,9 @@ class PolicyHandlerObserver { return false; } + virtual void OnAuthTokenUpdated(const std::string& policy_app_id, + const std::string& auth_token) {} + virtual void OnPTUFinished(const bool ptu_result) {} virtual ~PolicyHandlerObserver() {} diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h index ea8d95a92a..8a3c90061e 100644 --- a/src/components/application_manager/include/application_manager/request_controller.h +++ b/src/components/application_manager/include/application_manager/request_controller.h @@ -34,21 +34,21 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_H_ #include <climits> -#include <vector> #include <list> +#include <vector> #include "utils/lock.h" -#include "utils/threads/thread.h" #include "utils/conditional_variable.h" +#include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" #include "utils/timer.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" -#include "application_manager/request_info.h" #include "application_manager/request_controller_settings.h" +#include "application_manager/request_info.h" #include "application_manager/request_tracker.h" namespace application_manager { @@ -56,14 +56,14 @@ namespace application_manager { namespace request_controller { /** -* @brief RequestController class is used to control currently active mobile -* requests. -*/ + * @brief RequestController class is used to control currently active mobile + * requests. + */ class RequestController { public: /** - * @brief Result code for addRequest - */ + * @brief Result code for addRequest + */ enum TResult { SUCCESS = 0, TOO_MANY_REQUESTS, @@ -73,8 +73,8 @@ class RequestController { }; /** - * @brief Thread pool state - */ + * @brief Thread pool state + */ enum TPoolState { UNDEFINED = 0, STARTED, @@ -84,121 +84,121 @@ class RequestController { // Methods /** - * @brief Class constructor - * - */ + * @brief Class constructor + * + */ RequestController(const RequestControlerSettings& settings); /** - * @brief Class destructor - * - */ + * @brief Class destructor + * + */ virtual ~RequestController(); /** - * @brief Initialize thread pool - * - */ + * @brief Initialize thread pool + * + */ void InitializeThreadpool(); /** - * @brief Destroy thread pool - * - */ + * @brief Destroy thread pool + * + */ void DestroyThreadpool(); /** - * @brief Check if max request amount wasn't exceed and adds request to queue. - * - * @param request Active mobile request - * @param hmi_level Current application hmi_level - * - * @return Result code - * - */ + * @brief Check if max request amount wasn't exceed and adds request to queue. + * + * @param request Active mobile request + * @param hmi_level Current application hmi_level + * + * @return Result code + * + */ TResult addMobileRequest(const RequestPtr request, const mobile_apis::HMILevel::eType& hmi_level); /** - * @brief Store HMI request until response or timeout won't remove it - * - * @param request Active hmi request - * @return Result code - * - */ + * @brief Store HMI request until response or timeout won't remove it + * + * @param request Active hmi request + * @return Result code + * + */ TResult addHMIRequest(const RequestPtr request); /** - * @ Add notification to collection - * - * @param ptr Reference to shared pointer that point on hmi notification - */ + * @ Add notification to collection + * + * @param ptr Reference to shared pointer that point on hmi notification + */ void addNotification(const RequestPtr ptr); /** - * @brief Removes request from queue - * - * @param correlation_id Active request correlation ID, - * @param connection_key Active request connection key (0 for HMI requersts) - * @param function_id Active request function id - * @param force_terminate if true, request controller will terminate - * even if not allowed by request - */ + * @brief Removes request from queue + * + * @param correlation_id Active request correlation ID, + * @param connection_key Active request connection key (0 for HMI requersts) + * @param function_id Active request function id + * @param force_terminate if true, request controller will terminate + * even if not allowed by request + */ void TerminateRequest(const uint32_t correlation_id, const uint32_t connection_key, const int32_t function_id, bool force_terminate = false); /** - * @brief Removes request from queue - * - * @param mobile_correlation_id Active mobile request correlation ID - * - */ + * @brief Removes request from queue + * + * @param mobile_correlation_id Active mobile request correlation ID + * + */ void OnMobileResponse(const uint32_t mobile_correlation_id, const uint32_t connection_key, const int32_t function_id); /** - * @brief Removes request from queue - * - * @param mobile_correlation_id Active mobile request correlation ID - * - */ + * @brief Removes request from queue + * + * @param mobile_correlation_id Active mobile request correlation ID + * + */ void OnHMIResponse(const uint32_t correlation_id, const int32_t function_id); /** - * @ Add notification to collection - * - * @param ptr Reference to shared pointer that point on hmi notification - */ + * @ Add notification to collection + * + * @param ptr Reference to shared pointer that point on hmi notification + */ void removeNotification(const commands::Command* notification); /** - * @brief Removes all requests from queue for specified application - * - * @param app_id Mobile application ID (app_id) - * - */ + * @brief Removes all requests from queue for specified application + * + * @param app_id Mobile application ID (app_id) + * + */ void terminateAppRequests(const uint32_t& app_id); /** - * @brief Terminates all requests from HMI - */ + * @brief Terminates all requests from HMI + */ void terminateAllHMIRequests(); /** - * @brief Terminates all requests from Mobile - */ + * @brief Terminates all requests from Mobile + */ void terminateAllMobileRequests(); /** - * @brief Updates request timeout - * - * @param app_id Connection key of application - * @param mobile_correlation_id Correlation ID of the mobile request - * @param new_timeout_value New timeout to be set in milliseconds - */ + * @brief Updates request timeout + * + * @param app_id Connection key of application + * @param mobile_correlation_id Correlation ID of the mobile request + * @param new_timeout_value New timeout to be set in milliseconds + */ void updateRequestTimeout(const uint32_t& app_id, const uint32_t& mobile_correlation_id, const uint32_t& new_timeout); @@ -217,13 +217,13 @@ class RequestController { protected: /** - * @brief Timer callback which handles all request timeouts - */ + * @brief Timer callback which handles all request timeouts + */ void TimeoutThread(); /** - * @brief Signal timer condition variable - */ + * @brief Signal timer condition variable + */ void NotifyTimer(); void terminateWaitingForExecutionAppRequests(const uint32_t& app_id); @@ -285,8 +285,8 @@ class RequestController { RequestTracker request_tracker_; /** - * @brief Set of HMI notifications with timeout. - */ + * @brief Set of HMI notifications with timeout. + */ std::list<RequestPtr> notification_list_; /** diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h index be28bad63c..1b140e2108 100644 --- a/src/components/application_manager/include/application_manager/request_info.h +++ b/src/components/application_manager/include/application_manager/request_info.h @@ -29,9 +29,9 @@ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_INFO_H_ @@ -268,9 +268,9 @@ class RequestInfoSet { }; /** -* @brief Structure used in std algorithms to determine amount of request -* during time scale -*/ + * @brief Structure used in std algorithms to determine amount of request + * during time scale + */ struct TimeScale { TimeScale(const date_time::TimeDuration& start, const date_time::TimeDuration& end, diff --git a/src/components/application_manager/include/application_manager/request_tracker.h b/src/components/application_manager/include/application_manager/request_tracker.h index b351e716a7..72d04abf4a 100644 --- a/src/components/application_manager/include/application_manager/request_tracker.h +++ b/src/components/application_manager/include/application_manager/request_tracker.h @@ -1,39 +1,39 @@ /* - * Copyright (c) 2017, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TRACKER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TRACKER_H_ -#include <string> #include <map> +#include <string> #include <vector> #include "application_manager/request_controller_settings.h" #include "interfaces/MOBILE_API.h" diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h index f9a60c862b..0b744eec7f 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h @@ -42,7 +42,7 @@ class ApplicationManager; class Application; typedef std::shared_ptr<Application> ApplicationSharedPtr; typedef std::shared_ptr<const Application> ApplicationConstSharedPtr; -} +} // namespace application_manager namespace app_mngr = application_manager; namespace resumption { diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h index e749118140..a70e2453de 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h @@ -36,18 +36,18 @@ #include "application_manager/resumption/resume_ctrl.h" #include <stdint.h> -#include <vector> +#include <list> #include <map> #include <set> -#include <list> +#include <vector> +#include "application_manager/application.h" +#include "application_manager/event_engine/event_observer.h" +#include "application_manager/resumption/resumption_data.h" #include "interfaces/HMI_API.h" #include "interfaces/HMI_API_schema.h" #include "interfaces/MOBILE_API_schema.h" -#include "application_manager/event_engine/event_observer.h" #include "smart_objects/smart_object.h" -#include "application_manager/application.h" -#include "application_manager/resumption/resumption_data.h" #include "utils/timer.h" namespace resumption { @@ -322,10 +322,10 @@ class ResumeCtrlImpl : public ResumeCtrl, #endif // BUILD_TESTS private: /** - * @brief Returns Low Voltage signal timestamp - * @return Low Voltage event timestamp if event LOW VOLTAGE event occures - * otherwise 0 - */ + * @brief Returns Low Voltage signal timestamp + * @return Low Voltage event timestamp if event LOW VOLTAGE event occures + * otherwise 0 + */ time_t LowVoltageTime() const; /** 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 c2634173a5..7db7a09cb4 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 @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_DATA_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_DATA_H_ -#include "smart_objects/smart_object.h" #include "application_manager/application.h" #include "application_manager/application_manager.h" +#include "smart_objects/smart_object.h" #include "utils/macro.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h index cc93e4213c..2909a38cf7 100644 --- a/src/components/application_manager/include/application_manager/rpc_handler_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h @@ -35,18 +35,18 @@ #include "application_manager/application_manager.h" #include "application_manager/message_helper.h" -#include "application_manager/rpc_handler.h" -#include "application_manager/rpc_service.h" #include "application_manager/mobile_message_handler.h" #include "application_manager/policies/policy_handler_observer.h" +#include "application_manager/rpc_handler.h" +#include "application_manager/rpc_service.h" -#include "protocol_handler/protocol_observer.h" #include "hmi_message_handler/hmi_message_observer.h" #include "hmi_message_handler/hmi_message_sender.h" +#include "protocol_handler/protocol_observer.h" -#include "formatters/formatter_json_rpc.h" -#include "formatters/CFormatterJsonSDLRPCv2.h" #include "formatters/CFormatterJsonSDLRPCv1.h" +#include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/formatter_json_rpc.h" #include "interfaces/HMI_API_schema.h" #include "interfaces/MOBILE_API_schema.h" #ifdef TELEMETRY_MONITOR @@ -56,8 +56,8 @@ #include "interfaces/v4_protocol_v1_2_no_extra.h" #include "interfaces/v4_protocol_v1_2_no_extra_schema.h" -#include "utils/threads/message_loop_thread.h" #include "utils/semantic_version.h" +#include "utils/threads/message_loop_thread.h" namespace application_manager { namespace rpc_handler { @@ -87,7 +87,7 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromMobile> > FromMobileQueue; typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageFromHmi> > FromHmiQueue; -} +} // namespace impl class RPCHandlerImpl : public RPCHandler, public impl::FromMobileQueue::Handler, @@ -154,11 +154,18 @@ class RPCHandlerImpl : public RPCHandler, ns_smart_device_link::ns_smart_objects::SmartObject& output, utils::SemanticVersion& message_version); + bool ValidateRpcSO(smart_objects::SmartObject& message, + utils::SemanticVersion& msg_version, + rpc::ValidationReport& report_out, + bool allow_unknown_parameters) OVERRIDE; + private: void ProcessMessageFromMobile(const std::shared_ptr<Message> message); void ProcessMessageFromHMI(const std::shared_ptr<Message> message); bool ConvertMessageToSO(const Message& message, - smart_objects::SmartObject& output); + smart_objects::SmartObject& output, + const bool allow_unknown_parameters = false, + const bool validate_params = true); std::shared_ptr<Message> ConvertRawMsgToMessage( const ::protocol_handler::RawMessagePtr message); hmi_apis::HMI_API& hmi_so_factory(); diff --git a/src/components/application_manager/include/application_manager/rpc_passing_handler.h b/src/components/application_manager/include/application_manager/rpc_passing_handler.h new file mode 100644 index 0000000000..45fe4cad2f --- /dev/null +++ b/src/components/application_manager/include/application_manager/rpc_passing_handler.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_PASSING_HANDLER_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_PASSING_HANDLER_H_ + +#include <deque> +#include "application_manager/application.h" +#include "application_manager/commands/command.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" +#include "utils/timer.h" + +namespace application_manager { + +struct ServiceInfo { + std::string service_id; + uint32_t connection_key; +}; + +typedef std::shared_ptr<timer::Timer> TimerSPtr; + +class AppServiceManager; + +class RPCPassingHandler { + public: + RPCPassingHandler(AppServiceManager& asm_ref, ApplicationManager& am_ref); + + /** + * @brief Class destructor + */ + ~RPCPassingHandler(); + + /** + * @brief Check if function id is in the handled_rpcs list of an active app + * service + * @param function_id RPC function id + * @return true if function id exists in handled_rpcs list of an active app + * service + */ + bool CanHandleFunctionID(int32_t function_id); + + /** + * @brief Check if app services or core is being used to handle the RPC + * @param correlation_id correlation id of RPC response + * @return true if an app service was used to handle the RPC + */ + bool IsPassThroughMessage(uint32_t correlation_id, + commands::Command::CommandSource source, + int32_t message_type); + /** + * @brief Check if passthrough is allowed by policies for a given message + * @param rpc_message RPC message SmartObject + * @return true if the request is allowed to be passed through, false + * otherwise + */ + bool IsPassthroughAllowed(smart_objects::SmartObject rpc_message); + + /** + * @brief Function to handle sending and receiving RPC Passing + * requests/responses + * @param rpc_message RPC message SmartObject + * @return true if the request was handled, false otherwise + */ + bool RPCPassThrough(smart_objects::SmartObject rpc_message); + + private: + bool PerformNextRequest(uint32_t correlation_id); + void OnPassThroughRequestTimeout(); + void AddRequestTimer(uint32_t correlation_id); + void RemoveRequestTimer(uint32_t correlation_id); + void ClearCompletedTimers(); + void ForwardRequestToMobile(uint32_t correlation_id); + void ForwardRequestToCore(uint32_t correlation_id); + void ForwardResponseToMobile(uint32_t correlation_id, + smart_objects::SmartObject response_message); + void PopulateRPCRequestQueue(smart_objects::SmartObject request_message); + bool ExtractRPCParams(const smart_objects::SmartObject& s_map, + const ApplicationSharedPtr app, + const std::string& function_id_str); + + AppServiceManager& app_service_manager_; + ApplicationManager& app_manager_; + sync_primitives::RecursiveLock rpc_request_queue_lock_; + std::map<uint32_t, + std::pair<smart_objects::SmartObject, std::deque<ServiceInfo> > > + rpc_request_queue; + sync_primitives::RecursiveLock timeout_queue_lock_; + std::vector<std::pair<TimerSPtr, uint32_t> > timeout_queue_; +}; + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_PASSING_HANDLER_H_ diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h index 1eaeb46255..ab71729b3f 100644 --- a/src/components/application_manager/include/application_manager/rpc_service_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h @@ -34,24 +34,24 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RPC_SERVICE_IMPL_H #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" -#include "application_manager/request_controller.h" +#include "application_manager/command_holder_impl.h" #include "application_manager/message_helper.h" -#include "application_manager/usage_statistics.h" #include "application_manager/mobile_message_handler.h" -#include "application_manager/command_holder_impl.h" +#include "application_manager/request_controller.h" +#include "application_manager/rpc_service.h" +#include "application_manager/usage_statistics.h" -#include "formatters/formatter_json_rpc.h" -#include "formatters/CFormatterJsonSDLRPCv2.h" #include "formatters/CFormatterJsonSDLRPCv1.h" +#include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/formatter_json_rpc.h" #include "interfaces/HMI_API_schema.h" #include "interfaces/MOBILE_API_schema.h" #include "interfaces/v4_protocol_v1_2_no_extra.h" #include "interfaces/v4_protocol_v1_2_no_extra_schema.h" -#include "utils/threads/message_loop_thread.h" #include "utils/logger.h" +#include "utils/threads/message_loop_thread.h" namespace application_manager { namespace rpc_service { @@ -85,7 +85,7 @@ typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToMobile> > ToMobileQueue; typedef threads::MessageLoopThread<utils::PrioritizedQueue<MessageToHmi> > ToHmiQueue; -} +} // namespace impl class RPCServiceImpl : public RPCService, public impl::ToMobileQueue::Handler, @@ -108,7 +108,9 @@ class RPCServiceImpl : public RPCService, bool ManageMobileCommand(const commands::MessageSharedPtr message, commands::Command::CommandSource source) OVERRIDE; - bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE; + bool ManageHMICommand(const commands::MessageSharedPtr message, + commands::Command::CommandSource source = + commands::Command::SOURCE_HMI) OVERRIDE; // CALLED ON messages_to_hmi_ thread! void Handle(const impl::MessageToHmi message) OVERRIDE; @@ -119,6 +121,9 @@ class RPCServiceImpl : public RPCService, bool final_message = false) OVERRIDE; void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE; + bool IsAppServiceRPC(int32_t function_id, + commands::Command::CommandSource source); + void set_protocol_handler( protocol_handler::ProtocolHandler* handler) OVERRIDE; void set_hmi_message_handler( @@ -126,9 +131,13 @@ class RPCServiceImpl : public RPCService, private: bool ConvertSOtoMessage(const smart_objects::SmartObject& message, - Message& output); + Message& output, + const bool allow_unknown_parameters = false); hmi_apis::HMI_API& hmi_so_factory(); mobile_apis::MOBILE_API& mobile_so_factory(); + void CheckSourceForUnsupportedRequest( + const commands::MessageSharedPtr message, + commands::Command::CommandSource source); ApplicationManager& app_manager_; request_controller::RequestController& request_ctrl_; 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 6e32853a3d..328d7f5e81 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 @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2019, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without @@ -60,6 +60,7 @@ extern const char* app_launch_last_session; extern const char* policy_app_id; extern const char* hmi_app_id; extern const char* device_id; +extern const char* subscribe; extern const char* subscribed_for_way_points; extern const char* url; extern const char* urlScheme; @@ -76,7 +77,7 @@ extern const char* ngn_media_screen_app_name; extern const char* vr_synonyms; extern const char* uses_vehicle_data; extern const char* is_media_application; -extern const char* greyOut; +extern const char* grey_out; extern const char* language_desired; extern const char* auto_activated_id; extern const char* app_type; @@ -178,6 +179,7 @@ extern const char* navigation_capability; extern const char* phone_capability; extern const char* video_streaming_capability; extern const char* rc_capability; +extern const char* app_services_capabilities; extern const char* day_color_scheme; extern const char* night_color_scheme; extern const char* primary_color; @@ -188,10 +190,19 @@ extern const char* green; extern const char* blue; extern const char* display_layout; extern const char* icon_resumed; +extern const char* nicknames; +extern const char* enabled; +extern const char* auth_token; +extern const char* cloud_transport_type; +extern const char* hybrid_app_preference; +extern const char* is_cloud_application; +extern const char* cloud_connection_status; +extern const char* endpoint; // PutFile extern const char* sync_file_name; extern const char* file_name; +extern const char* file_path; extern const char* file_type; extern const char* file_size; extern const char* crc32_check_sum; @@ -205,6 +216,7 @@ extern const char* is_template; extern const char* image; extern const char* type; extern const char* system_file; +extern const char* is_system_file; extern const char* offset; extern const char* length; extern const char* secondary_image; @@ -253,6 +265,7 @@ extern const char* fuel_level; extern const char* fuel_level_state; extern const char* instant_fuel_consumption; extern const char* fuel_range; +extern const char* cloud_app_vehicle_id; extern const char* external_temp; extern const char* turn_signal; extern const char* vin; @@ -293,6 +306,49 @@ extern const char* system_software_version; extern const char* priority; extern const char* engine_oil_life; +// app services +extern const char* app_service_manifest; +extern const char* service_name; +extern const char* service_type; +extern const char* service_icon; +extern const char* allow_app_consumers; +extern const char* rpc_spec_version; +extern const char* handled_rpcs; +extern const char* media_service_manifest; +extern const char* app_service_record; +extern const char* service_id; +extern const char* service_manifest; +extern const char* service_published; +extern const char* service_active; +extern const char* app_service_id; +extern const char* service_data; +extern const char* media_service_data; +extern const char* media_image; +extern const char* weather_service_data; +extern const char* location; +extern const char* current_forecast; +extern const char* minute_forecast; +extern const char* hourly_forecast; +extern const char* multiday_forecast; +extern const char* weather_icon; +extern const char* navigation_service_data; +extern const char* origin; +extern const char* destination; +extern const char* instructions; +extern const char* location_details; +extern const char* request_service_active; +extern const char* app_services; +extern const char* update_reason; +extern const char* updated_app_service_record; +extern const char* service_records; +extern const char* activate; +extern const char* set_as_default; +extern const char* origin_app; + +// sis data +extern const char* station_short_name; +extern const char* station_location; + // resuming extern const char* application_commands; extern const char* application_submenus; @@ -316,8 +372,11 @@ extern const char* global_ign_on_counter; extern const char* connection_info; extern const char* is_download_complete; +extern const char* shifted; +extern const char* altitude; extern const char* longitude_degrees; extern const char* latitude_degrees; + extern const char* address; extern const char* country_name; extern const char* country_code; @@ -359,6 +418,8 @@ extern const char* const keyboard_layout_supported; extern const char* const keypress_mode_supported; extern const char* const limited_characters_list_supported; extern const char* const auto_complete_text_supported; +extern const char* const send_location_enabled; +extern const char* const get_way_points_enabled; extern const char* const entity_type; extern const char* const entity_id; extern const char* const status; @@ -413,7 +474,7 @@ extern const char* instance_follow_redirect; extern const char* charset; extern const char* content_lenght; extern const char* GET; -} // http_request +} // namespace http_request namespace mobile_notification { extern const char* state; diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h index 99113d6d00..77da28cc91 100644 --- a/src/components/application_manager/include/application_manager/state_controller_impl.h +++ b/src/components/application_manager/include/application_manager/state_controller_impl.h @@ -35,15 +35,15 @@ #include <list> #include <map> -#include "application_manager/hmi_state.h" #include "application_manager/application.h" #include "application_manager/application_manager.h" -#include "event_engine/event_observer.h" -#include "application_manager/state_controller.h" +#include "application_manager/hmi_state.h" #include "application_manager/message_helper.h" +#include "application_manager/state_controller.h" +#include "event_engine/event_observer.h" #include "interfaces/MOBILE_API.h" -#include "utils/lock.h" #include "utils/helpers.h" +#include "utils/lock.h" namespace application_manager { @@ -144,6 +144,7 @@ class StateControllerImpl : public event_engine::EventObserver, // EventObserver interface void on_event(const event_engine::Event& event); + void on_event(const event_engine::MobileEvent& event); /** * @brief Sets default application state and apply currently active HMI states @@ -185,9 +186,9 @@ class StateControllerImpl : public event_engine::EventObserver, virtual bool IsStateActive(HmiState::StateID state_id) const; private: - int64_t SendBCActivateApp(ApplicationConstSharedPtr app, - hmi_apis::Common_HMILevel::eType level, - bool send_policy_priority); + int64_t RequestHMIStateChange(ApplicationConstSharedPtr app, + hmi_apis::Common_HMILevel::eType level, + bool send_policy_priority); /** * @brief The HmiLevelConflictResolver struct * Move other application to HmiStates if applied moved to FULL or LIMITED @@ -377,10 +378,11 @@ class StateControllerImpl : public event_engine::EventObserver, const mobile_apis::VideoStreamingState::eType video_state); /** - * @brief OnActivateAppResponse calback for activate app response + * @brief OnHMIResponse callback for activate app or close application + * response * @param message Smart Object */ - void OnActivateAppResponse(const smart_objects::SmartObject& message); + void OnHMIResponse(const smart_objects::SmartObject& message); /** * @brief OnAppDeactivated callback for OnAppDeactivated notification @@ -448,9 +450,9 @@ class StateControllerImpl : public event_engine::EventObserver, typedef std::list<HmiState::StateID> StateIDList; StateIDList active_states_; mutable sync_primitives::Lock active_states_lock_; - std::map<uint32_t, HmiStatePtr> waiting_for_activate_; + std::map<uint32_t, HmiStatePtr> waiting_for_response_; ApplicationManager& app_mngr_; }; -} +} // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_ diff --git a/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h index add440ad80..46aa98e6c1 100644 --- a/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h +++ b/src/components/application_manager/include/application_manager/system_time/system_time_handler_impl.h @@ -36,11 +36,11 @@ #include <time.h> #include <vector> +#include "application_manager/application_manager.h" +#include "application_manager/event_engine/event_observer.h" #include "utils/lock.h" #include "utils/macro.h" #include "utils/system_time_handler.h" -#include "application_manager/application_manager_impl.h" -#include "application_manager/event_engine/event_observer.h" namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h index 49f15165db..afd5397db9 100644 --- a/src/components/application_manager/include/application_manager/telemetry_observer.h +++ b/src/components/application_manager/include/application_manager/telemetry_observer.h @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_ -#include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "json/json.h" +#include "smart_objects/smart_object.h" #include "utils/date_time.h" @@ -53,5 +53,5 @@ class AMTelemetryObserver { virtual void OnMessage(MessageMetricSharedPtr) = 0; virtual ~AMTelemetryObserver() {} }; -} // application_manager +} // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_ diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h index 6d0b5cd6bd..ebd8e4729b 100644 --- a/src/components/application_manager/include/application_manager/usage_statistics.h +++ b/src/components/application_manager/include/application_manager/usage_statistics.h @@ -33,10 +33,10 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_ -#include <string> #include <memory> -#include "policy/usage_statistics/counter.h" +#include <string> #include "policy/usage_statistics/app_stopwatch.h" +#include "policy/usage_statistics/counter.h" #include "utils/macro.h" #include "interfaces/MOBILE_API.h" diff --git a/src/components/application_manager/rpc_plugins/CMakeLists.txt b/src/components/application_manager/rpc_plugins/CMakeLists.txt index c9ef282c12..8884b30532 100644 --- a/src/components/application_manager/rpc_plugins/CMakeLists.txt +++ b/src/components/application_manager/rpc_plugins/CMakeLists.txt @@ -32,3 +32,4 @@ add_subdirectory(vehicle_info_plugin) add_subdirectory(sdl_rpc_plugin) add_subdirectory(rc_rpc_plugin) +add_subdirectory(app_service_rpc_plugin) diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt new file mode 100644 index 0000000000..1e23aac8ee --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/CMakeLists.txt @@ -0,0 +1,84 @@ +# Copyright (c) 2019, Ford Motor Company, Livio +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following +# disclaimer in the documentation and/or other materials provided with the +# distribution. +# +# Neither the name of the copyright holders nor the names of their contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +include_directories( + include + ${COMPONENTS_DIR}/application_manager/rpc_plugins/sdl_rpc_plugin/include + ) + +set (COMMANDS_SOURCE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}/src/commands +) + +set (MOBILE_COMMANDS_SOURCE_DIR + ${COMMANDS_SOURCE_DIR}/mobile +) + +set (HMI_COMMANDS_SOURCE_DIR + ${COMMANDS_SOURCE_DIR}/hmi +) + +collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}") +collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}") +collect_sources(PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src") +collect_sources(COMMANDS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/commands") + +set(LIBRARIES + HMI_API + MOBILE_API + ApplicationManager + v4_protocol_v1_2_no_extra + SmartObjects + Utils + sdl_rpc_plugin +) + +if(ENABLE_LOG) + list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY}) +endif() + +add_library("app_service_rpc_plugin" SHARED ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${COMMANDS_SOURCES}) +target_link_libraries("app_service_rpc_plugin" ${LIBRARIES}) + +add_library("AppServiceRpcPluginStaticLib" ${PLUGIN_SOURCES} ${MOBILE_COMMANDS} ${HMI_COMMANDS}) +target_link_libraries("AppServiceRpcPluginStaticLib" ${LIBRARIES}) + +set(INSTALL_DESTINATION bin) + +install(TARGETS app_service_rpc_plugin + DESTINATION ${INSTALL_DESTINATION} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +) + +if(BUILD_TESTS) + add_subdirectory(test) +endif() diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h new file mode 100644 index 0000000000..b04edbe2f4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_app_extension.h @@ -0,0 +1,131 @@ +/* + Copyright (c) 2018, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_APP_EXTENSION_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_APP_EXTENSION_H + +#include <application_manager/application_manager.h> +#include "application_manager/app_extension.h" + +#include <set> +#include <string> + +namespace app_service_rpc_plugin { +class AppServiceRpcPlugin; + +namespace app_mngr = application_manager; + +typedef int AppExtensionUID; +typedef mobile_apis::VehicleDataType::eType VehicleDataType; +/** + * @brief Defines set of app service types + */ +typedef std::set<std::string> AppServiceSubscriptions; + +class AppServiceAppExtension : public app_mngr::AppExtension { + public: + /** + * @brief AppServiceAppExtension constructor + * @param plugin app service plugin + * @param app application that contains this plugin + */ + AppServiceAppExtension(AppServiceRpcPlugin& plugin, + app_mngr::Application& app); + virtual ~AppServiceAppExtension(); + + /** + * @brief subscribeToAppService add vehicle_data to list of subscriptions of + * application extension + * @param vehicle_data data to subscribe + * @return true in case if subscription is successful + */ + bool SubscribeToAppService(const std::string app_service_type); + + /** + * @brief unsubscribeFromAppService remove vehicle_data from list of + * subscriptions of application extension + * @param vehicle_data data to unsubscribe + * @return true in case if unsubscription is successful + */ + bool UnsubscribeFromAppService(const std::string app_service_type); + /** + * @brief unsubscribeFromAppService unsubscribe from all app service types + */ + void UnsubscribeFromAppService(); + + /** + * @brief isSubscribedToAppService checks if extension is subscribed to + * app service type + * @param app_service_type data type to check subscription + * @return true if extension is subscribed this app_service_type, otherwise + * return false + */ + bool IsSubscribedToAppService(const std::string app_service_type) const; + + /** + * @brief Subscriptions get list of subscriptions for application extension + * @return list of subscriptions for application extension + */ + AppServiceSubscriptions Subscriptions(); + + /** + * @brief SaveResumptionData saves vehicle info data + * @param resumption_data plase to store resumption data + */ + void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject& + resumption_data) OVERRIDE; + + /** + * @brief ProcessResumption load resumtion data back to plugin during + * resumption + * @param resumption_data resumption data + */ + void ProcessResumption( + const smart_objects::SmartObject& resumption_data) OVERRIDE; + + /** + * @brief ExtractVIExtension utility function to extract application extension + * from application + * @param app : applicaiton that contains vehicle info app_extension + * @return application extension extracted from application + */ + static AppServiceAppExtension& ExtractASExtension( + application_manager::Application& app); + + private: + AppServiceSubscriptions subscribed_data_; + AppServiceRpcPlugin& plugin_; + app_mngr::Application& app_; +}; +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_APP_EXTENSION_H diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h new file mode 100644 index 0000000000..193b79e26f --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_command_factory.h @@ -0,0 +1,66 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_SDL_COMMAND_FACTORY_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_SDL_COMMAND_FACTORY_H + +#include "app_service_rpc_plugin/app_service_hmi_command_factory.h" +#include "app_service_rpc_plugin/app_service_mobile_command_factory.h" +#include "application_manager/application_manager.h" + +namespace app_service_rpc_plugin { +namespace commands = application_manager::commands; +namespace app_mngr = application_manager; + +class AppServiceCommandFactory : public app_mngr::CommandFactory { + public: + AppServiceCommandFactory(app_mngr::ApplicationManager& app_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~AppServiceCommandFactory(); + + app_mngr::CommandSharedPtr CreateCommand( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::commands::Command::CommandSource source) OVERRIDE; + + bool IsAbleToProcess( + const int32_t, + const application_manager::commands::Command::CommandSource) + const OVERRIDE; + + private: + std::unique_ptr<AppServiceHmiCommandFactory> hmi_command_factory_; + std::unique_ptr<AppServiceMobileCommandFactory> mobile_command_factory_; +}; +} // namespace app_service_rpc_plugin +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_SDL_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h new file mode 100644 index 0000000000..c42b64f559 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_hmi_command_factory.h @@ -0,0 +1,74 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_HMI_COMMAND_FACTORY_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_HMI_COMMAND_FACTORY_H + +#include "application_manager/application_manager.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +/** + * @brief The vehicle info hmi command factory. + */ +class AppServiceHmiCommandFactory : public app_mngr::CommandFactory { + public: + AppServiceHmiCommandFactory(app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + + app_mngr::CommandSharedPtr CreateCommand( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::commands::Command::CommandSource source) OVERRIDE; + + bool IsAbleToProcess( + const int32_t function_id, + const app_mngr::commands::Command::CommandSource source) const OVERRIDE; + + private: + app_mngr::ApplicationManager& application_manager_; + app_mngr::rpc_service::RPCService& rpc_service_; + app_mngr::HMICapabilities& hmi_capabilities_; + policy::PolicyHandlerInterface& policy_handler_; + + app_mngr::CommandCreator& buildCommandCreator( + const int32_t function_id, + const int32_t message_type, + const app_mngr::commands::Command::CommandSource source) const; + + DISALLOW_COPY_AND_ASSIGN(AppServiceHmiCommandFactory); +}; +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_HMI_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h new file mode 100644 index 0000000000..bd1e10f267 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_mobile_command_factory.h @@ -0,0 +1,75 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_MOBILE_COMMAND_FACTORY_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_MOBILE_COMMAND_FACTORY_H + +#include "application_manager/application_manager.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +/** + * @brief The vehicle info mobile command factory. + */ +class AppServiceMobileCommandFactory : public app_mngr::CommandFactory { + public: + AppServiceMobileCommandFactory( + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + + app_mngr::CommandSharedPtr CreateCommand( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::commands::Command::CommandSource source) OVERRIDE; + + bool IsAbleToProcess( + const int32_t function_id, + const app_mngr::commands::Command::CommandSource source) const OVERRIDE; + + private: + app_mngr::ApplicationManager& application_manager_; + app_mngr::rpc_service::RPCService& rpc_service_; + app_mngr::HMICapabilities& hmi_capabilities_; + policy::PolicyHandlerInterface& policy_handler_; + + app_mngr::CommandCreator& buildCommandCreator( + const int32_t function_id, + const int32_t message_type, + const app_mngr::commands::Command::CommandSource source) const; + + DISALLOW_COPY_AND_ASSIGN(AppServiceMobileCommandFactory); +}; +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_APP_SERVICE_RPC_MOBILE_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h new file mode 100644 index 0000000000..c9cb98cdfb --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/app_service_rpc_plugin.h @@ -0,0 +1,73 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_RPC_PLUGIN_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_RPC_PLUGIN_H + +#include "application_manager/command_factory.h" + +namespace app_service_rpc_plugin { +// class AppServiceAppExtension; +namespace app_mngr = application_manager; +namespace plugins = application_manager::plugin_manager; + +class AppServiceRpcPlugin : public plugins::RPCPlugin { + public: + AppServiceRpcPlugin(); + + bool Init(app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) OVERRIDE; + + bool IsAbleToProcess( + const int32_t function_id, + const app_mngr::commands::Command::CommandSource source) OVERRIDE; + + std::string PluginName() OVERRIDE; + app_mngr::CommandFactory& GetCommandFactory() OVERRIDE; + + void OnPolicyEvent(plugins::PolicyEvent event) OVERRIDE; + void OnApplicationEvent(plugins::ApplicationEvent event, + app_mngr::ApplicationSharedPtr application) OVERRIDE; + + private: + void DeleteSubscriptions(app_mngr::ApplicationSharedPtr app); + + std::unique_ptr<app_mngr::CommandFactory> command_factory_; + app_mngr::ApplicationManager* application_manager_; +}; +} // namespace app_service_rpc_plugin + +extern "C" application_manager::plugin_manager::RPCPlugin* Create(); + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_PLUGIN_INCLUDE_APP_SERVICE_PLUGIN_APP_SERVICE_PLUGIN_H diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h new file mode 100644 index 0000000000..c98979da0f --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/request_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASAppServiceActivationRequest command class + **/ +class ASAppServiceActivationRequest + : public app_mngr::commands::RequestFromHMI { + public: + /** + * @brief ASAppServiceActivationRequest class constructor + * + * @param message Incoming SmartObject message + **/ + ASAppServiceActivationRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASAppServiceActivationRequest class destructor + **/ + virtual ~ASAppServiceActivationRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASAppServiceActivationRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h new file mode 100644 index 0000000000..68b77cb7e3 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_RESPONSE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/response_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASAppServiceActivationResponse command class + **/ +class ASAppServiceActivationResponse + : public app_mngr::commands::ResponseToHMI { + public: + /** + * @brief ASAppServiceActivationResponse class constructor + * + * @param message Incoming SmartObject message + **/ + ASAppServiceActivationResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASAppServiceActivationResponse class destructor + **/ + virtual ~ASAppServiceActivationResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASAppServiceActivationResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_APP_SERVICE_ACTIVATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h new file mode 100644 index 0000000000..2286d4c67c --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/request_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetActiveServiceConsentRequest command class + **/ +class ASGetActiveServiceConsentRequest + : public app_mngr::commands::RequestToHMI { + public: + /** + * @brief ASGetActiveServiceConsentRequest class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetActiveServiceConsentRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetActiveServiceConsentRequest class destructor + **/ + virtual ~ASGetActiveServiceConsentRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetActiveServiceConsentRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h new file mode 100644 index 0000000000..f69152208c --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_RESPONSE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/response_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetActiveServiceConsentResponse command class + **/ +class ASGetActiveServiceConsentResponse + : public app_mngr::commands::ResponseFromHMI { + public: + /** + * @brief ASGetActiveServiceConsentResponse class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetActiveServiceConsentResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetActiveServiceConsentResponse class destructor + **/ + virtual ~ASGetActiveServiceConsentResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetActiveServiceConsentResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_ACTIVE_SERVICE_CONSENT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h new file mode 100644 index 0000000000..d9eb7528e4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h @@ -0,0 +1,106 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_FROM_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_FROM_HMI_H_ + +#include "application_manager/commands/request_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetAppServiceDataRequestFromHMI command class + **/ +class ASGetAppServiceDataRequestFromHMI + : public app_mngr::commands::RequestFromHMI { + public: + /** + * @brief ASGetAppServiceDataRequestFromHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetAppServiceDataRequestFromHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetAppServiceDataRequestFromHMI class destructor + **/ + virtual ~ASGetAppServiceDataRequestFromHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + /** + * @brief onTimeOut from request controller + */ + virtual void onTimeOut(); + + /** + * @brief on_event allows to handle events + * + * @param event event type that current request subscribed on. + */ + void on_event(const app_mngr::event_engine::Event& event) OVERRIDE; + + /** + * @brief on_event allows to handle events + * + * @param event event type that current request subscribed on. + */ + void on_event(const app_mngr::event_engine::MobileEvent& event) OVERRIDE; + + private: + void GetWeatherImagePaths(smart_objects::SmartObject& data, + application_manager::ApplicationSharedPtr app); + void GetNavigationImagePaths(smart_objects::SmartObject& data, + application_manager::ApplicationSharedPtr app); + void GetMediaImagePaths(smart_objects::SmartObject& data, + application_manager::ApplicationSharedPtr app); + bool ValidateResponse(smart_objects::SmartObject& message_params); + + DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataRequestFromHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_FROM_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h new file mode 100644 index 0000000000..c4b3026176 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_TO_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_REQUEST_TO_HMI_H_ + +#include "application_manager/commands/request_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetAppServiceDataRequestToHMI command class + **/ +class ASGetAppServiceDataRequestToHMI + : public app_mngr::commands::RequestToHMI { + public: + /** + * @brief ASGetAppServiceDataRequestToHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetAppServiceDataRequestToHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetAppServiceDataRequestToHMI class destructor + **/ + virtual ~ASGetAppServiceDataRequestToHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataRequestToHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_TO_HMI_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h new file mode 100644 index 0000000000..b46626a56b --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_FROM_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_FROM_HMI_H_ + +#include "application_manager/commands/response_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetAppServiceDataResponseFromHMI command class + **/ +class ASGetAppServiceDataResponseFromHMI + : public app_mngr::commands::ResponseFromHMI { + public: + /** + * @brief ASGetAppServiceDataResponseFromHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetAppServiceDataResponseFromHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetAppServiceDataResponseFromHMI class destructor + **/ + virtual ~ASGetAppServiceDataResponseFromHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataResponseFromHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_FROM_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h new file mode 100644 index 0000000000..e48a9d1429 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_TO_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_TO_HMI_H_ + +#include "application_manager/commands/response_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetAppServiceDataResponseToHMI command class + **/ +class ASGetAppServiceDataResponseToHMI + : public app_mngr::commands::ResponseToHMI { + public: + /** + * @brief ASGetAppServiceDataResponseToHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetAppServiceDataResponseToHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetAppServiceDataResponseToHMI class destructor + **/ + virtual ~ASGetAppServiceDataResponseToHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceDataResponseToHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_DATA_RESPONSE_TO_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h new file mode 100644 index 0000000000..79ea0922a8 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/request_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetAppServiceRecordsRequest command class + **/ +class ASGetAppServiceRecordsRequest + : public app_mngr::commands::RequestFromHMI { + public: + /** + * @brief ASGetAppServiceRecordsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetAppServiceRecordsRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetAppServiceRecordsRequest class destructor + **/ + virtual ~ASGetAppServiceRecordsRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceRecordsRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h new file mode 100644 index 0000000000..6db24132af --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_RESPONSE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/response_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASGetAppServiceRecordsResponse command class + **/ +class ASGetAppServiceRecordsResponse + : public app_mngr::commands::ResponseToHMI { + public: + /** + * @brief ASGetAppServiceRecordsResponse class constructor + * + * @param message Incoming SmartObject message + **/ + ASGetAppServiceRecordsResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASGetAppServiceRecordsResponse class destructor + **/ + virtual ~ASGetAppServiceRecordsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASGetAppServiceRecordsResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_GET_APP_SERVICE_RECORDS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h new file mode 100644 index 0000000000..36acf116f4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h @@ -0,0 +1,99 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_FROM_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_FROM_HMI_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/request_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASPerformAppServiceInteractionRequestFromHMI command class + **/ +class ASPerformAppServiceInteractionRequestFromHMI + : public app_mngr::commands::RequestFromHMI { + public: + /** + * @brief ASPerformAppServiceInteractionRequestFromHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASPerformAppServiceInteractionRequestFromHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASPerformAppServiceInteractionRequestFromHMI class destructor + **/ + virtual ~ASPerformAppServiceInteractionRequestFromHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + /** + * @brief on_event allows to handle events + * + * @param event event type that current request subscribed on. + */ + void on_event(const app_mngr::event_engine::Event& event) OVERRIDE; + + /** + * @brief on_event allows to handle events + * + * @param event event type that current request subscribed on. + */ + void on_event(const app_mngr::event_engine::MobileEvent& event) OVERRIDE; + + /** + * @brief onTimeOut from request controller + */ + virtual void onTimeOut(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionRequestFromHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_FROM_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h new file mode 100644 index 0000000000..0b67dd5624 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_HMI_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/request_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASPerformAppServiceInteractionRequestToHMI command class + **/ +class ASPerformAppServiceInteractionRequestToHMI + : public app_mngr::commands::RequestToHMI { + public: + /** + * @brief ASPerformAppServiceInteractionRequestToHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASPerformAppServiceInteractionRequestToHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASPerformAppServiceInteractionRequestToHMI class destructor + **/ + virtual ~ASPerformAppServiceInteractionRequestToHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionRequestToHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h new file mode 100644 index 0000000000..f807348833 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_HMI_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/response_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASPerformAppServiceInteractionResponseFromHMI command class + **/ +class ASPerformAppServiceInteractionResponseFromHMI + : public app_mngr::commands::ResponseFromHMI { + public: + /** + * @brief ASPerformAppServiceInteractionResponseFromHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASPerformAppServiceInteractionResponseFromHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASPerformAppServiceInteractionResponseFromHMI class destructor + **/ + virtual ~ASPerformAppServiceInteractionResponseFromHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionResponseFromHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h new file mode 100644 index 0000000000..7ce05bdba1 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_TO_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_TO_HMI_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/response_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASPerformAppServiceInteractionResponseToHMI command class + **/ +class ASPerformAppServiceInteractionResponseToHMI + : public app_mngr::commands::ResponseToHMI { + public: + /** + * @brief ASPerformAppServiceInteractionResponseToHMI class constructor + * + * @param message Incoming SmartObject message + **/ + ASPerformAppServiceInteractionResponseToHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASPerformAppServiceInteractionResponseToHMI class destructor + **/ + virtual ~ASPerformAppServiceInteractionResponseToHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASPerformAppServiceInteractionResponseToHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_TO_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h new file mode 100644 index 0000000000..4433444602 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/request_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASPublishAppServiceRequest command class + **/ +class ASPublishAppServiceRequest : public app_mngr::commands::RequestFromHMI { + public: + /** + * @brief ASPublishAppServiceRequest class constructor + * + * @param message Incoming SmartObject message + **/ + ASPublishAppServiceRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASPublishAppServiceRequest class destructor + **/ + virtual ~ASPublishAppServiceRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASPublishAppServiceRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h new file mode 100644 index 0000000000..519d57c609 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_RESPONSE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/response_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief ASPublishAppServiceResponse command class + **/ +class ASPublishAppServiceResponse : public app_mngr::commands::ResponseToHMI { + public: + /** + * @brief ASPublishAppServiceResponse class constructor + * + * @param message Incoming SmartObject message + **/ + ASPublishAppServiceResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief ASPublishAppServiceResponse class destructor + **/ + virtual ~ASPublishAppServiceResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(ASPublishAppServiceResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_AS_PUBLISH_APP_SERVICE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h new file mode 100644 index 0000000000..2dcd5ec251 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h @@ -0,0 +1,88 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/notification_to_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief OnASAppServiceDataNotification command class + **/ +class OnASAppServiceDataNotification + : public app_mngr::commands::NotificationToHMI { + public: + /** + * @brief OnASAppServiceDataNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnASAppServiceDataNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief OnASAppServiceDataNotification class destructor + **/ + virtual ~OnASAppServiceDataNotification(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + void GetMediaImagePaths(smart_objects::SmartObject& data, + application_manager::ApplicationSharedPtr app); + void GetWeatherImagePaths(smart_objects::SmartObject& data, + application_manager::ApplicationSharedPtr app); + void GetNavigationImagePaths(smart_objects::SmartObject& data, + application_manager::ApplicationSharedPtr app); + bool ValidateParams(smart_objects::SmartObject& message_params); + + DISALLOW_COPY_AND_ASSIGN(OnASAppServiceDataNotification); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h new file mode 100644 index 0000000000..5a23e35df0 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_FROM_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_FROM_HMI_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/notification_from_hmi.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief OnASAppServiceDataNotificationFromHMI command class + **/ +class OnASAppServiceDataNotificationFromHMI + : public app_mngr::commands::NotificationFromHMI { + public: + /** + * @brief OnASAppServiceDataNotificationFromHMI class constructor + * + * @param message Incoming SmartObject message + **/ + OnASAppServiceDataNotificationFromHMI( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief OnASAppServiceDataNotificationFromHMI class destructor + **/ + virtual ~OnASAppServiceDataNotificationFromHMI(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(OnASAppServiceDataNotificationFromHMI); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_HMI_ON_AS_APP_SERVICE_DATA_NOTIFICATION_FROM_HMI_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h new file mode 100644 index 0000000000..7c80ec5e03 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h @@ -0,0 +1,89 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_request_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief GetAppServiceDataRequest command class + **/ +class GetAppServiceDataRequest : public app_mngr::commands::CommandRequestImpl { + public: + /** + * @brief GetAppServiceDataRequest class constructor + * + * @param message Incoming SmartObject message + **/ + GetAppServiceDataRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief GetAppServiceDataRequest class destructor + **/ + virtual ~GetAppServiceDataRequest(); + + /** + * @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 app_mngr::event_engine::Event& event); + + virtual void on_event(const app_mngr::event_engine::MobileEvent& event); + + private: + void HandleSubscribe(); + + DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h new file mode 100644 index 0000000000..279cf15055 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_TO_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_TO_MOBILE_H_ + +#include "application_manager/commands/command_request_to_mobile.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief GetAppServiceDataRequestToMobile command class + **/ +class GetAppServiceDataRequestToMobile + : public app_mngr::commands::CommandRequestToMobile { + public: + /** + * @brief GetAppServiceDataRequestToMobile class constructor + * + * @param message Incoming SmartObject message + **/ + GetAppServiceDataRequestToMobile( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief GetAppServiceDataRequestToMobile class destructor + **/ + virtual ~GetAppServiceDataRequestToMobile(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataRequestToMobile); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_REQUEST_TO_MOBILE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h new file mode 100644 index 0000000000..f5758e1c39 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h @@ -0,0 +1,78 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief GetAppServiceDataResponse command class + **/ +class GetAppServiceDataResponse + : public app_mngr::commands::CommandResponseImpl { + public: + /** + * @brief GetAppServiceDataResponse class constructor + * + * @param message Incoming SmartObject message + **/ + GetAppServiceDataResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief GetAppServiceDataResponse class destructor + **/ + virtual ~GetAppServiceDataResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h new file mode 100644 index 0000000000..7e2b26d8fb --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_FROM_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_FROM_MOBILE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_response_from_mobile.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief GetAppServiceDataResponseFromMobile command class + **/ +class GetAppServiceDataResponseFromMobile + : public app_mngr::commands::CommandResponseFromMobile { + public: + /** + * @brief GetAppServiceDataResponseFromMobile class constructor + * + * @param message Incoming SmartObject message + **/ + GetAppServiceDataResponseFromMobile( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief GetAppServiceDataResponseFromMobile class destructor + **/ + virtual ~GetAppServiceDataResponseFromMobile(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(GetAppServiceDataResponseFromMobile); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_GET_APP_SERVICE_DATA_RESPONSE_FROM_MOBILE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h new file mode 100644 index 0000000000..719f5ebf5b --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_notification_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief OnAppServiceDataNotification command class + **/ +class OnAppServiceDataNotification + : public app_mngr::commands::CommandNotificationImpl { + public: + /** + * @brief OnAppServiceDataNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnAppServiceDataNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief OnAppServiceDataNotification class destructor + **/ + virtual ~OnAppServiceDataNotification(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(OnAppServiceDataNotification); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h new file mode 100644 index 0000000000..c41fabf7b1 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_FROM_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_FROM_MOBILE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_notification_from_mobile_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief OnAppServiceDataNotificationFromMobile command class + **/ +class OnAppServiceDataNotificationFromMobile + : public app_mngr::commands::CommandNotificationFromMobileImpl { + public: + /** + * @brief OnAppServiceDataNotificationFromMobile class constructor + * + * @param message Incoming SmartObject message + **/ + OnAppServiceDataNotificationFromMobile( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief OnAppServiceDataNotificationFromMobile class destructor + **/ + virtual ~OnAppServiceDataNotificationFromMobile(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(OnAppServiceDataNotificationFromMobile); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_SERVICE_DATA_NOTIFICATION_FROM_MOBILE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h new file mode 100644 index 0000000000..854ed3c6aa --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h @@ -0,0 +1,89 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_request_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief PerformAppServiceInteractionRequest command class + **/ +class PerformAppServiceInteractionRequest + : public app_mngr::commands::CommandRequestImpl { + public: + /** + * @brief PerformAppServiceInteractionRequest class constructor + * + * @param message Incoming SmartObject message + **/ + PerformAppServiceInteractionRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief PerformAppServiceInteractionRequest class destructor + **/ + virtual ~PerformAppServiceInteractionRequest(); + + /** + * @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 app_mngr::event_engine::Event& event); + + virtual void on_event(const app_mngr::event_engine::MobileEvent& event); + + private: + DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h new file mode 100644 index 0000000000..5c38e6a71e --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_MOBILE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_request_to_mobile.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief PerformAppServiceInteractionRequestToMobile command class + **/ +class PerformAppServiceInteractionRequestToMobile + : public app_mngr::commands::CommandRequestToMobile { + public: + /** + * @brief PerformAppServiceInteractionRequestToMobile class constructor + * + * @param message Incoming SmartObject message + **/ + PerformAppServiceInteractionRequestToMobile( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief PerformAppServiceInteractionRequestToMobile class destructor + **/ + virtual ~PerformAppServiceInteractionRequestToMobile(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionRequestToMobile); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_REQUEST_TO_MOBILE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h new file mode 100644 index 0000000000..b4c422fac6 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_response_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief PerformAppServiceInteractionResponse command class + **/ +class PerformAppServiceInteractionResponse + : public app_mngr::commands::CommandResponseImpl { + public: + /** + * @brief PerformAppServiceInteractionResponse class constructor + * + * @param message Incoming SmartObject message + **/ + PerformAppServiceInteractionResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief PerformAppServiceInteractionResponse class destructor + **/ + virtual ~PerformAppServiceInteractionResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h new file mode 100644 index 0000000000..4530cb2dfd --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_MOBILE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_MOBILE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_response_from_mobile.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief PerformAppServiceInteractionResponseFromMobile command class + **/ +class PerformAppServiceInteractionResponseFromMobile + : public app_mngr::commands::CommandResponseFromMobile { + public: + /** + * @brief PerformAppServiceInteractionResponseFromMobile class constructor + * + * @param message Incoming SmartObject message + **/ + PerformAppServiceInteractionResponseFromMobile( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief PerformAppServiceInteractionResponseFromMobile class destructor + **/ + virtual ~PerformAppServiceInteractionResponseFromMobile(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(PerformAppServiceInteractionResponseFromMobile); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_APP_SERVICE_INTERACTION_RESPONSE_FROM_MOBILE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h new file mode 100644 index 0000000000..d70f279658 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_request.h @@ -0,0 +1,78 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_REQUEST_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_request_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief PublishAppServiceRequest command class + **/ +class PublishAppServiceRequest : public app_mngr::commands::CommandRequestImpl { + public: + /** + * @brief PublishAppServiceRequest class constructor + * + * @param message Incoming SmartObject message + **/ + PublishAppServiceRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief PublishAppServiceRequest class destructor + **/ + virtual ~PublishAppServiceRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(PublishAppServiceRequest); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h new file mode 100644 index 0000000000..9275f9e468 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/mobile/publish_app_service_response.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_RESPONSE_H_ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/commands/command_response_impl.h" + +namespace app_service_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief PublishAppServiceResponse command class + **/ +class PublishAppServiceResponse + : public app_mngr::commands::CommandResponseImpl { + public: + /** + * @brief PublishAppServiceResponse class constructor + * + * @param message Incoming SmartObject message + **/ + PublishAppServiceResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief PublishAppServiceResponse class destructor + **/ + virtual ~PublishAppServiceResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(PublishAppServiceResponse); +}; + +} // namespace commands + +} // namespace app_service_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_APP_SERVICE_RPC_PLUGIN_INCLUDE_APP_SERVICE_RPC_PLUGIN_COMMANDS_MOBILE_PUBLISH_APP_SERVICE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc new file mode 100644 index 0000000000..91d57cb952 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_app_extension.cc @@ -0,0 +1,122 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/app_service_app_extension.h" +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") + +namespace app_service_rpc_plugin { + +const AppExtensionUID AppServiceAppExtensionUID = 455; + +AppServiceAppExtension::AppServiceAppExtension( + AppServiceRpcPlugin& plugin, application_manager::Application& app) + : app_mngr::AppExtension(AppServiceAppExtensionUID) + , plugin_(plugin) + , app_(app) { + LOG4CXX_AUTO_TRACE(logger_); +} + +AppServiceAppExtension::~AppServiceAppExtension() { + LOG4CXX_AUTO_TRACE(logger_); +} + +bool AppServiceAppExtension::SubscribeToAppService( + const std::string app_service_type) { + LOG4CXX_DEBUG(logger_, "Subscribe to app service: " << app_service_type); + return subscribed_data_.insert(app_service_type).second; +} + +bool AppServiceAppExtension::UnsubscribeFromAppService( + const std::string app_service_type) { + LOG4CXX_DEBUG(logger_, app_service_type); + auto it = subscribed_data_.find(app_service_type); + if (it != subscribed_data_.end()) { + subscribed_data_.erase(it); + return true; + } + return false; +} + +void AppServiceAppExtension::UnsubscribeFromAppService() { + LOG4CXX_AUTO_TRACE(logger_); + subscribed_data_.clear(); +} + +bool AppServiceAppExtension::IsSubscribedToAppService( + const std::string app_service_type) const { + LOG4CXX_DEBUG(logger_, + "isSubscribedToAppService for type: " << app_service_type); + return subscribed_data_.find(app_service_type) != subscribed_data_.end(); +} + +AppServiceSubscriptions AppServiceAppExtension::Subscriptions() { + return subscribed_data_; +} + +void AppServiceAppExtension::SaveResumptionData( + smart_objects::SmartObject& resumption_data) { + const char* app_service_info = "appService"; + resumption_data[app_service_info] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + int i = 0; + for (const auto& subscription : subscribed_data_) { + resumption_data[app_service_info][i] = subscription; + i++; + } +} + +void AppServiceAppExtension::ProcessResumption( + const smart_objects::SmartObject& resumption_data) { + const char* app_service_info = "appService"; + if (resumption_data.keyExists(app_service_info)) { + const smart_objects::SmartObject& subscriptions_app_services = + resumption_data[app_service_info]; + for (size_t i = 0; i < subscriptions_app_services.length(); ++i) { + std::string service_type = resumption_data[i].asString(); + SubscribeToAppService(service_type); + } + } +} + +AppServiceAppExtension& AppServiceAppExtension::ExtractASExtension( + application_manager::Application& app) { + auto ext_ptr = app.QueryInterface(AppServiceAppExtensionUID); + DCHECK(ext_ptr); + DCHECK(dynamic_cast<AppServiceAppExtension*>(ext_ptr.get())); + auto vi_app_extension = + std::static_pointer_cast<AppServiceAppExtension>(ext_ptr); + DCHECK(vi_app_extension); + return *vi_app_extension; +} +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc new file mode 100644 index 0000000000..8ce4d10b6e --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_command_factory.cc @@ -0,0 +1,77 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/app_service_command_factory.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") + +namespace app_service_rpc_plugin { + +AppServiceCommandFactory::AppServiceCommandFactory( + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : hmi_command_factory_(new AppServiceHmiCommandFactory( + application_manager, rpc_service, hmi_capabilities, policy_handler)) + , mobile_command_factory_(new AppServiceMobileCommandFactory( + application_manager, rpc_service, hmi_capabilities, policy_handler)) { + LOG4CXX_AUTO_TRACE(logger_); +} + +AppServiceCommandFactory::~AppServiceCommandFactory() { + LOG4CXX_AUTO_TRACE(logger_); +} + +app_mngr::CommandSharedPtr AppServiceCommandFactory::CreateCommand( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::commands::Command::CommandSource source) { + if (app_mngr::commands::Command::SOURCE_HMI == source || + app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) { + return hmi_command_factory_->CreateCommand(message, source); + } else { + return mobile_command_factory_->CreateCommand(message, source); + } +} + +bool AppServiceCommandFactory::IsAbleToProcess( + const int32_t function_id, + const commands::Command::CommandSource source) const { + LOG4CXX_DEBUG(logger_, + "AppServiceCommandFactory::IsAbleToProcess" << function_id + << " " << source); + return (commands::Command::SOURCE_HMI == source || + commands::Command::SOURCE_SDL_TO_HMI == source) + ? hmi_command_factory_->IsAbleToProcess(function_id, source) + : mobile_command_factory_->IsAbleToProcess(function_id, source); +} +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc new file mode 100644 index 0000000000..1cec2ccdce --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_hmi_command_factory.cc @@ -0,0 +1,191 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/app_service_hmi_command_factory.h" +#include "application_manager/message.h" +#include "interfaces/HMI_API.h" + +#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h" +#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h" +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h" +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h" +#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h" +#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h" +#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h" +#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") + +namespace app_service_rpc_plugin { +namespace strings = app_mngr::strings; + +AppServiceHmiCommandFactory::AppServiceHmiCommandFactory( + application_manager::ApplicationManager& application_manager, + application_manager::rpc_service::RPCService& rpc_service, + application_manager::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : application_manager_(application_manager) + , rpc_service_(rpc_service) + , hmi_capabilities_(hmi_capabilities) + , policy_handler_(policy_handler) { + LOG4CXX_AUTO_TRACE(logger_); +} + +app_mngr::CommandSharedPtr AppServiceHmiCommandFactory::CreateCommand( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::commands::Command::CommandSource source) { + UNUSED(source); + + const hmi_apis::FunctionID::eType function_id = + static_cast<hmi_apis::FunctionID::eType>( + (*message)[strings::params][strings::function_id].asInt()); + + const hmi_apis::messageType::eType message_type = + static_cast<hmi_apis::messageType::eType>( + (*message)[strings::params][strings::message_type].asInt()); + + auto message_type_str = "request"; + if (hmi_apis::messageType::response == message_type) { + message_type_str = "response"; + } else if (hmi_apis::messageType::error_response == message_type) { + message_type_str = "error response"; + } else if (hmi_apis::messageType::notification == message_type) { + message_type_str = "notification"; + } + + UNUSED(message_type_str); + LOG4CXX_DEBUG(logger_, + "HMICommandFactory::CreateCommand function_id: " + << function_id << ", message type: " << message_type_str); + + return buildCommandCreator(function_id, message_type, source).create(message); +} + +bool AppServiceHmiCommandFactory::IsAbleToProcess( + const int32_t function_id, + const app_mngr::commands::Command::CommandSource source) const { + LOG4CXX_DEBUG(logger_, + "HMI App Service Plugin IsAbleToProcess: " << function_id); + UNUSED(source); + return buildCommandCreator( + function_id, hmi_apis::messageType::INVALID_ENUM, source) + .CanBeCreated(); +} + +app_mngr::CommandCreator& AppServiceHmiCommandFactory::buildCommandCreator( + const int32_t function_id, + const int32_t message_type, + const app_mngr::commands::Command::CommandSource source) const { + auto factory = app_mngr::CommandCreatorFactory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + + LOG4CXX_DEBUG(logger_, + "buildCommandCreator: " << function_id << " " << source); + + switch (function_id) { + case hmi_apis::FunctionID::AppService_PublishAppService: + return hmi_apis::messageType::request == message_type + ? factory.GetCreator<commands::ASPublishAppServiceRequest>() + : factory.GetCreator<commands::ASPublishAppServiceResponse>(); + case hmi_apis::FunctionID::AppService_OnAppServiceData: + return app_mngr::commands::Command::CommandSource::SOURCE_HMI == source + ? factory.GetCreator< + commands::OnASAppServiceDataNotificationFromHMI>() + : factory + .GetCreator<commands::OnASAppServiceDataNotification>(); + case hmi_apis::FunctionID::AppService_GetAppServiceData: + if (app_mngr::commands::Command::CommandSource::SOURCE_HMI == source) { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands::ASGetAppServiceDataRequestFromHMI>() + : factory.GetCreator< + commands::ASGetAppServiceDataResponseFromHMI>(); + } else if (app_mngr::commands::Command::CommandSource:: + SOURCE_SDL_TO_HMI == source) { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands::ASGetAppServiceDataRequestToHMI>() + : factory.GetCreator< + commands::ASGetAppServiceDataResponseToHMI>(); + } + break; + case hmi_apis::FunctionID::AppService_GetAppServiceRecords: + return hmi_apis::messageType::request == message_type + ? factory.GetCreator<commands::ASGetAppServiceRecordsRequest>() + : factory + .GetCreator<commands::ASGetAppServiceRecordsResponse>(); + case hmi_apis::FunctionID::AppService_AppServiceActivation: + return hmi_apis::messageType::request == message_type + ? factory.GetCreator<commands::ASAppServiceActivationRequest>() + : factory + .GetCreator<commands::ASAppServiceActivationResponse>(); + case hmi_apis::FunctionID::AppService_PerformAppServiceInteraction: + if (app_mngr::commands::Command::CommandSource::SOURCE_HMI == source) { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands:: + ASPerformAppServiceInteractionRequestFromHMI>() + : factory.GetCreator< + commands:: + ASPerformAppServiceInteractionResponseFromHMI>(); + } else if (app_mngr::commands::Command::CommandSource:: + SOURCE_SDL_TO_HMI == source) { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands::ASPerformAppServiceInteractionRequestToHMI>() + : factory.GetCreator< + commands:: + ASPerformAppServiceInteractionResponseToHMI>(); + } + break; + case hmi_apis::FunctionID::AppService_GetActiveServiceConsent: + return hmi_apis::messageType::request == message_type + ? factory + .GetCreator<commands::ASGetActiveServiceConsentRequest>() + : factory.GetCreator< + commands::ASGetActiveServiceConsentResponse>(); + default: + LOG4CXX_WARN(logger_, "Unsupported HMI function_id: " << function_id); + } + return factory.GetCreator<app_mngr::InvalidCommand>(); +} +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc new file mode 100644 index 0000000000..76be96cf8f --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_mobile_command_factory.cc @@ -0,0 +1,165 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/app_service_mobile_command_factory.h" + +#include "application_manager/message.h" +#include "interfaces/MOBILE_API.h" + +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h" +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h" +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h" +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h" +#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h" +#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h" +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h" +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h" +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h" +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h" +#include "app_service_rpc_plugin/commands/mobile/publish_app_service_request.h" +#include "app_service_rpc_plugin/commands/mobile/publish_app_service_response.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") + +namespace app_service_rpc_plugin { +namespace strings = app_mngr::strings; + +AppServiceMobileCommandFactory::AppServiceMobileCommandFactory( + application_manager::ApplicationManager& application_manager, + application_manager::rpc_service::RPCService& rpc_service, + application_manager::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : application_manager_(application_manager) + , rpc_service_(rpc_service) + , hmi_capabilities_(hmi_capabilities) + , policy_handler_(policy_handler) { + LOG4CXX_AUTO_TRACE(logger_); +} + +app_mngr::CommandSharedPtr AppServiceMobileCommandFactory::CreateCommand( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::commands::Command::CommandSource source) { + UNUSED(source); + + const mobile_apis::FunctionID::eType function_id = + static_cast<mobile_apis::FunctionID::eType>( + (*message)[strings::params][strings::function_id].asInt()); + + const mobile_apis::messageType::eType message_type = + static_cast<mobile_apis::messageType::eType>( + (*message)[strings::params][strings::message_type].asInt()); + + auto message_type_str = "request"; + if (mobile_apis::messageType::response == message_type) { + message_type_str = "response"; + } else if (mobile_apis::messageType::notification == message_type) { + message_type_str = "notification"; + } + + UNUSED(message_type_str); + LOG4CXX_DEBUG(logger_, + "HMICommandFactory::CreateCommand function_id: " + << function_id << ", message type: " << message_type_str); + + return buildCommandCreator(function_id, message_type, source).create(message); +} + +bool AppServiceMobileCommandFactory::IsAbleToProcess( + const int32_t function_id, + const app_mngr::commands::Command::CommandSource source) const { + UNUSED(source); + return buildCommandCreator( + function_id, mobile_apis::messageType::INVALID_ENUM, source) + .CanBeCreated(); +} + +app_mngr::CommandCreator& AppServiceMobileCommandFactory::buildCommandCreator( + const int32_t function_id, + const int32_t message_type, + const app_mngr::commands::Command::CommandSource source) const { + auto factory = app_mngr::CommandCreatorFactory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + + switch (function_id) { + case mobile_apis::FunctionID::PublishAppServiceID: + if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source && + mobile_apis::messageType::response != message_type) { + return factory.GetCreator<commands::PublishAppServiceRequest>(); + } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == + source && + mobile_apis::messageType::request != message_type) { + return factory.GetCreator<commands::PublishAppServiceResponse>(); + } + break; + case mobile_apis::FunctionID::OnAppServiceDataID: + return app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source + ? factory.GetCreator< + commands::OnAppServiceDataNotificationFromMobile>() + : factory.GetCreator<commands::OnAppServiceDataNotification>(); + case mobile_apis::FunctionID::GetAppServiceDataID: + if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) { + return mobile_apis::messageType::request == message_type + ? factory.GetCreator<commands::GetAppServiceDataRequest>() + : factory.GetCreator< + commands::GetAppServiceDataResponseFromMobile>(); + } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == + source) { + return mobile_apis::messageType::request == message_type + ? factory.GetCreator< + commands::GetAppServiceDataRequestToMobile>() + : factory.GetCreator<commands::GetAppServiceDataResponse>(); + } + break; + case mobile_apis::FunctionID::PerformAppServiceInteractionID: + if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) { + return mobile_apis::messageType::request == message_type + ? factory.GetCreator< + commands::PerformAppServiceInteractionRequest>() + : factory.GetCreator< + commands:: + PerformAppServiceInteractionResponseFromMobile>(); + } else if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == + source) { + return mobile_apis::messageType::request == message_type + ? factory.GetCreator< + commands:: + PerformAppServiceInteractionRequestToMobile>() + : factory.GetCreator< + commands::PerformAppServiceInteractionResponse>(); + } + break; + default: + LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id); + } + return factory.GetCreator<app_mngr::InvalidCommand>(); +} +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc new file mode 100644 index 0000000000..3b1b0715d4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc @@ -0,0 +1,98 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "app_service_rpc_plugin/app_service_app_extension.h" +#include "app_service_rpc_plugin/app_service_command_factory.h" +#include "application_manager/message_helper.h" +#include "application_manager/plugin_manager/plugin_keys.h" +#include "application_manager/smart_object_keys.h" + +namespace app_service_rpc_plugin { +CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceRpcPlugin") + +namespace strings = application_manager::strings; +namespace plugins = application_manager::plugin_manager; + +AppServiceRpcPlugin::AppServiceRpcPlugin() : application_manager_(nullptr) {} + +bool AppServiceRpcPlugin::Init( + application_manager::ApplicationManager& app_manager, + application_manager::rpc_service::RPCService& rpc_service, + application_manager::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) { + application_manager_ = &app_manager; + command_factory_.reset(new app_service_rpc_plugin::AppServiceCommandFactory( + app_manager, rpc_service, hmi_capabilities, policy_handler)); + return true; +} + +bool AppServiceRpcPlugin::IsAbleToProcess( + const int32_t function_id, const commands::Command::CommandSource source) { + return command_factory_->IsAbleToProcess(function_id, source); +} + +std::string AppServiceRpcPlugin::PluginName() { + return plugins::plugin_names::app_service_rpc_plugin; +} + +app_mngr::CommandFactory& AppServiceRpcPlugin::GetCommandFactory() { + return *command_factory_; +} + +void AppServiceRpcPlugin::OnPolicyEvent(plugins::PolicyEvent event) {} + +void AppServiceRpcPlugin::OnApplicationEvent( + plugins::ApplicationEvent event, + app_mngr::ApplicationSharedPtr application) { + if (plugins::ApplicationEvent::kApplicationRegistered == event) { + application->AddExtension( + std::make_shared<AppServiceAppExtension>(*this, *application)); + } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) { + DeleteSubscriptions(application); + } +} + +void AppServiceRpcPlugin::DeleteSubscriptions( + application_manager::ApplicationSharedPtr app) { + auto& ext = AppServiceAppExtension::ExtractASExtension(*app); + auto subscriptions = ext.Subscriptions(); + for (auto& service_type : subscriptions) { + ext.UnsubscribeFromAppService(service_type); + } +} + +} // namespace app_service_rpc_plugin + +extern "C" application_manager::plugin_manager::RPCPlugin* Create() { + return new app_service_rpc_plugin::AppServiceRpcPlugin(); +} diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc new file mode 100644 index 0000000000..fd7312ca98 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_request.cc @@ -0,0 +1,89 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_request.h" + +#include "application_manager/app_service_manager.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASAppServiceActivationRequest::ASAppServiceActivationRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASAppServiceActivationRequest::~ASAppServiceActivationRequest() {} + +void ASAppServiceActivationRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + AppServiceManager& service_manager = + application_manager_.GetAppServiceManager(); + smart_objects::SmartObject params = (*message_)[strings::msg_params]; + smart_objects::SmartObject response_params(smart_objects::SmartType_Map); + std::string service_id = params[strings::service_id].asString(); + response_params[strings::service_id] = service_id; + if (params[strings::activate].asBool()) { + response_params[strings::activate] = + service_manager.ActivateAppService(service_id); + } else { + service_manager.DeactivateAppService(service_id); + response_params[strings::activate] = false; + } + + if (params.keyExists(strings::set_as_default)) { + if (params[strings::set_as_default].asBool()) { + response_params[strings::set_as_default] = + service_manager.SetDefaultService(service_id); + } else { + service_manager.RemoveDefaultService(service_id); + response_params[strings::set_as_default] = false; + } + } + + SendResponse(true, + (*message_)[strings::params][strings::correlation_id].asUInt(), + hmi_apis::FunctionID::AppService_AppServiceActivation, + hmi_apis::Common_Result::SUCCESS, + &response_params); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc new file mode 100644 index 0000000000..c77d3ed381 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_app_service_activation_response.cc @@ -0,0 +1,59 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_app_service_activation_response.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASAppServiceActivationResponse::ASAppServiceActivationResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASAppServiceActivationResponse::~ASAppServiceActivationResponse() {} + +void ASAppServiceActivationResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToHMI(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc new file mode 100644 index 0000000000..b1f3d6fdbf --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_request.cc @@ -0,0 +1,59 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_request.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetActiveServiceConsentRequest::ASGetActiveServiceConsentRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetActiveServiceConsentRequest::~ASGetActiveServiceConsentRequest() {} + +void ASGetActiveServiceConsentRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc new file mode 100644 index 0000000000..038c2922ad --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_active_service_consent_response.cc @@ -0,0 +1,62 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_active_service_consent_response.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetActiveServiceConsentResponse::ASGetActiveServiceConsentResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetActiveServiceConsentResponse::~ASGetActiveServiceConsentResponse() {} + +void ASGetActiveServiceConsentResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + event_engine::Event event( + hmi_apis::FunctionID::AppService_GetActiveServiceConsent); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc new file mode 100644 index 0000000000..e03c0ad15a --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_from_hmi.cc @@ -0,0 +1,289 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_from_hmi.h" +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/enum_schema_item.h" + +#include "application_manager/message_helper.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetAppServiceDataRequestFromHMI::ASGetAppServiceDataRequestFromHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetAppServiceDataRequestFromHMI::~ASGetAppServiceDataRequestFromHMI() {} + +void ASGetAppServiceDataRequestFromHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + std::string service_type = + (*message_)[strings::msg_params][strings::service_type].asString(); + + LOG4CXX_DEBUG(logger_, "Get Service Type: " << service_type); + + SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID, + hmi_apis::FunctionID::AppService_GetAppServiceData, + &(*message_), + true); +} + +void ASGetAppServiceDataRequestFromHMI::GetWeatherImagePaths( + smart_objects::SmartObject& data, ApplicationSharedPtr app) { + if (data[strings::location].keyExists(strings::location_image)) { + MessageHelper::VerifyImage(data[strings::location][strings::location_image], + app, + application_manager_); + } + + if (data.keyExists(strings::current_forecast) && + data[strings::current_forecast].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage( + data[strings::current_forecast][strings::weather_icon], + app, + application_manager_); + } + + if (data.keyExists(strings::minute_forecast)) { + smart_objects::SmartObject& minute_forecast = + data[strings::minute_forecast]; + for (size_t i = 0; i < minute_forecast.length(); i++) { + if (minute_forecast[i].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage(minute_forecast[i][strings::weather_icon], + app, + application_manager_); + } + } + } + + if (data.keyExists(strings::hourly_forecast)) { + smart_objects::SmartObject& hourly_forecast = + data[strings::hourly_forecast]; + for (size_t i = 0; i < hourly_forecast.length(); i++) { + if (hourly_forecast[i].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage(hourly_forecast[i][strings::weather_icon], + app, + application_manager_); + } + } + } + + if (data.keyExists(strings::multiday_forecast)) { + smart_objects::SmartObject& multiday_forecast = + data[strings::multiday_forecast]; + for (size_t i = 0; i < multiday_forecast.length(); i++) { + if (multiday_forecast[i].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage(multiday_forecast[i][strings::weather_icon], + app, + application_manager_); + } + } + } +} + +void ASGetAppServiceDataRequestFromHMI::GetNavigationImagePaths( + smart_objects::SmartObject& data, ApplicationSharedPtr app) { + if (data.keyExists(strings::origin) && + data[strings::origin].keyExists(strings::location_image)) { + MessageHelper::VerifyImage(data[strings::origin][strings::location_image], + app, + application_manager_); + } + + if (data.keyExists(strings::destination) && + data[strings::destination].keyExists(strings::location_image)) { + MessageHelper::VerifyImage( + data[strings::destination][strings::location_image], + app, + application_manager_); + } + + if (data.keyExists(strings::instructions)) { + smart_objects::SmartObject& instructions = data[strings::instructions]; + for (size_t i = 0; i < instructions.length(); i++) { + if (instructions[i].keyExists(strings::image)) { + MessageHelper::VerifyImage( + instructions[i][strings::image], app, application_manager_); + } + + if (instructions[i].keyExists(strings::location_details) && + instructions[i][strings::location_details].keyExists( + strings::location_image)) { + MessageHelper::VerifyImage( + instructions[i][strings::location_details][strings::location_image], + app, + application_manager_); + } + } + } +} + +void ASGetAppServiceDataRequestFromHMI::GetMediaImagePaths( + smart_objects::SmartObject& data, ApplicationSharedPtr app) { + if (data.keyExists(strings::media_image)) { + MessageHelper::VerifyImage( + data[strings::media_image], app, application_manager_); + } +} + +bool ASGetAppServiceDataRequestFromHMI::ValidateResponse( + smart_objects::SmartObject& message_params) { + if (!message_params.keyExists(strings::service_data)) { + LOG4CXX_DEBUG( + logger_, + "GASD response received without any service data, passing through"); + return true; + } + smart_objects::SmartObject& service_data = + message_params[strings::service_data]; + std::string service_type = service_data[strings::service_type].asString(); + mobile_apis::AppServiceType::eType service_type_value; + const std::string& service_id = service_data[strings::service_id].asString(); + auto service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (!service) { + LOG4CXX_ERROR(logger_, + "GASD response received with an unpublished service ID"); + SendErrorResponse( + correlation_id(), + hmi_apis::FunctionID::AppService_GetAppServiceData, + hmi_apis::Common_Result::GENERIC_ERROR, + "The provider responded with incorrect data", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + return false; + } + + using namespace ns_smart_device_link::ns_smart_objects; + if (service && service->mobile_service && + EnumConversionHelper<mobile_apis::AppServiceType::eType>::StringToEnum( + service_type, &service_type_value)) { + auto app = application_manager_.application(service->connection_key); + if (!app) { + LOG4CXX_ERROR(logger_, + "Failed to find service provider for GASD response"); + SendErrorResponse( + correlation_id(), + hmi_apis::FunctionID::AppService_GetAppServiceData, + hmi_apis::Common_Result::GENERIC_ERROR, + "The provider responded with incorrect data", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + return false; + } + + if (service_type_value == mobile_apis::AppServiceType::WEATHER && + service_data.keyExists(strings::weather_service_data)) { + GetWeatherImagePaths(service_data[strings::weather_service_data], app); + } + + if (service_type_value == mobile_apis::AppServiceType::NAVIGATION && + service_data.keyExists(strings::navigation_service_data)) { + GetNavigationImagePaths(service_data[strings::navigation_service_data], + app); + } + + if (service_type_value == mobile_apis::AppServiceType::MEDIA && + service_data.keyExists(strings::media_service_data)) { + GetMediaImagePaths(service_data[strings::media_service_data], app); + } + } + return true; +} + +void ASGetAppServiceDataRequestFromHMI::on_event( + const event_engine::Event& event) { + smart_objects::SmartObject event_message(event.smart_object()); + + auto& msg_params = event_message[strings::msg_params]; + + hmi_apis::Common_Result::eType result = + static_cast<hmi_apis::Common_Result::eType>( + event_message[strings::params][hmi_response::code].asInt()); + bool success = + IsHMIResultSuccess(result, HmiInterfaces::HMI_INTERFACE_AppService); + if (ValidateResponse(msg_params)) { + SendResponse(success, + correlation_id(), + hmi_apis::FunctionID::AppService_GetAppServiceData, + result, + &msg_params, + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + } +} + +void ASGetAppServiceDataRequestFromHMI::on_event( + const event_engine::MobileEvent& event) { + smart_objects::SmartObject event_message(event.smart_object()); + + auto& msg_params = event_message[strings::msg_params]; + + mobile_apis::Result::eType mobile_result = + static_cast<mobile_apis::Result::eType>( + msg_params[strings::result_code].asInt()); + hmi_apis::Common_Result::eType result = + MessageHelper::MobileToHMIResult(mobile_result); + bool success = IsMobileResultSuccess(mobile_result); + + if (ValidateResponse(msg_params)) { + SendResponse(success, + correlation_id(), + hmi_apis::FunctionID::AppService_GetAppServiceData, + result, + &msg_params, + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + } +} + +void ASGetAppServiceDataRequestFromHMI::onTimeOut() { + LOG4CXX_AUTO_TRACE(logger_); + SendErrorResponse(correlation_id(), + hmi_apis::FunctionID::AppService_GetAppServiceData, + hmi_apis::Common_Result::GENERIC_ERROR, + "The provider did not respond to the request", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc new file mode 100644 index 0000000000..635cd7319a --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_request_to_hmi.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_request_to_hmi.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetAppServiceDataRequestToHMI::ASGetAppServiceDataRequestToHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetAppServiceDataRequestToHMI::~ASGetAppServiceDataRequestToHMI() {} + +void ASGetAppServiceDataRequestToHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc new file mode 100644 index 0000000000..c0b1b274fb --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_from_hmi.cc @@ -0,0 +1,67 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_from_hmi.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" +#include "interfaces/HMI_API.h" + +#include "application_manager/message_helper.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetAppServiceDataResponseFromHMI::ASGetAppServiceDataResponseFromHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetAppServiceDataResponseFromHMI::~ASGetAppServiceDataResponseFromHMI() {} + +void ASGetAppServiceDataResponseFromHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + event_engine::Event event(hmi_apis::FunctionID::AppService_GetAppServiceData); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc new file mode 100644 index 0000000000..b489ec4765 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_data_response_to_hmi.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_data_response_to_hmi.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetAppServiceDataResponseToHMI::ASGetAppServiceDataResponseToHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetAppServiceDataResponseToHMI::~ASGetAppServiceDataResponseToHMI() {} + +void ASGetAppServiceDataResponseToHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToHMI(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc new file mode 100644 index 0000000000..fa704c1995 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_request.cc @@ -0,0 +1,90 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_request.h" + +#include "application_manager/app_service_manager.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetAppServiceRecordsRequest::ASGetAppServiceRecordsRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetAppServiceRecordsRequest::~ASGetAppServiceRecordsRequest() {} + +void ASGetAppServiceRecordsRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + std::string type; + if ((*message_)[strings::msg_params].keyExists(strings::service_type)) { + type = (*message_)[strings::msg_params][strings::service_type].asString(); + } + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject records = + smart_objects::SmartObject(smart_objects::SmartType_Array); + std::vector<smart_objects::SmartObject> service_records = + application_manager_.GetAppServiceManager().GetAllServiceRecords(); + + int index = 0; + for (auto& record : service_records) { + if (!type.empty() && + record[strings::service_manifest][strings::service_type].asString() != + type) { + continue; + } + records[index] = record; + index++; + } + + if (!records.empty()) { + response_params[strings::service_records] = records; + } + SendResponse(true, + (*message_)[strings::params][strings::correlation_id].asUInt(), + hmi_apis::FunctionID::AppService_GetAppServiceRecords, + hmi_apis::Common_Result::SUCCESS, + &response_params); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc new file mode 100644 index 0000000000..0479aa8d31 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_get_app_service_records_response.cc @@ -0,0 +1,59 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_get_app_service_records_response.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASGetAppServiceRecordsResponse::ASGetAppServiceRecordsResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASGetAppServiceRecordsResponse::~ASGetAppServiceRecordsResponse() {} + +void ASGetAppServiceRecordsResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToHMI(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc new file mode 100644 index 0000000000..6499b08c28 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_from_hmi.cc @@ -0,0 +1,164 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_from_hmi.h" + +#include "application_manager/app_service_manager.h" +#include "application_manager/message_helper.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASPerformAppServiceInteractionRequestFromHMI:: + ASPerformAppServiceInteractionRequestFromHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASPerformAppServiceInteractionRequestFromHMI:: + ~ASPerformAppServiceInteractionRequestFromHMI() {} + +void ASPerformAppServiceInteractionRequestFromHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + std::string hmi_origin_id = + application_manager_.get_settings().hmi_origin_id(); + if (!msg_params.keyExists(strings::origin_app)) { + if (hmi_origin_id.empty()) { + SendErrorResponse( + correlation_id(), + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + hmi_apis::Common_Result::INVALID_DATA, + "No HMI origin ID to use for interaction passthrough", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + return; + } + msg_params[strings::origin_app] = hmi_origin_id; + } + + std::string service_id = msg_params[strings::service_id].asString(); + auto service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (!service) { + SendErrorResponse( + correlation_id(), + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + hmi_apis::Common_Result::INVALID_ID, + "The requested service ID does not exist", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + return; + } + + bool request_service_active = false; + if (msg_params.keyExists(strings::request_service_active)) { + request_service_active = + msg_params[strings::request_service_active].asBool(); + msg_params.erase(strings::request_service_active); + } + + // Only activate service if it is not already active + bool activate_service = request_service_active && + !service->record[strings::service_active].asBool(); + if (activate_service) { + application_manager_.GetAppServiceManager().ActivateAppService(service_id); + } + + SendProviderRequest( + mobile_apis::FunctionID::PerformAppServiceInteractionID, + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + &(*message_), + true); +} + +void ASPerformAppServiceInteractionRequestFromHMI::on_event( + const event_engine::Event& event) { + const smart_objects::SmartObject& event_message = event.smart_object(); + + auto msg_params = event_message[strings::msg_params]; + + hmi_apis::Common_Result::eType result = + static_cast<hmi_apis::Common_Result::eType>( + event_message[strings::params][hmi_response::code].asInt()); + bool success = + IsHMIResultSuccess(result, HmiInterfaces::HMI_INTERFACE_AppService); + SendResponse(success, + correlation_id(), + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + result, + &msg_params, + application_manager::commands::Command::SOURCE_SDL_TO_HMI); +} + +void ASPerformAppServiceInteractionRequestFromHMI::on_event( + const event_engine::MobileEvent& event) { + const smart_objects::SmartObject& event_message = event.smart_object(); + + auto msg_params = event_message[strings::msg_params]; + + mobile_apis::Result::eType mobile_result = + static_cast<mobile_apis::Result::eType>( + msg_params[strings::result_code].asInt()); + hmi_apis::Common_Result::eType result = + MessageHelper::MobileToHMIResult(mobile_result); + bool success = IsMobileResultSuccess(mobile_result); + SendResponse(success, + correlation_id(), + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + result, + &msg_params, + application_manager::commands::Command::SOURCE_SDL_TO_HMI); +} + +void ASPerformAppServiceInteractionRequestFromHMI::onTimeOut() { + LOG4CXX_AUTO_TRACE(logger_); + smart_objects::SmartObject response_params; + response_params[strings::info] = + "The provider did not respond to the request"; + SendErrorResponse( + correlation_id(), + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + hmi_apis::Common_Result::GENERIC_ERROR, + "The provider did not respond to the request", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc new file mode 100644 index 0000000000..22876328de --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_request_to_hmi.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_request_to_hmi.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASPerformAppServiceInteractionRequestToHMI:: + ASPerformAppServiceInteractionRequestToHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASPerformAppServiceInteractionRequestToHMI:: + ~ASPerformAppServiceInteractionRequestToHMI() {} + +void ASPerformAppServiceInteractionRequestToHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc new file mode 100644 index 0000000000..a2ffa65a73 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_from_hmi.cc @@ -0,0 +1,64 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_from_hmi.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASPerformAppServiceInteractionResponseFromHMI:: + ASPerformAppServiceInteractionResponseFromHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASPerformAppServiceInteractionResponseFromHMI:: + ~ASPerformAppServiceInteractionResponseFromHMI() {} + +void ASPerformAppServiceInteractionResponseFromHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + event_engine::Event event( + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc new file mode 100644 index 0000000000..5ddef55c2a --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_perform_app_service_interaction_response_to_hmi.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_perform_app_service_interaction_response_to_hmi.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASPerformAppServiceInteractionResponseToHMI:: + ASPerformAppServiceInteractionResponseToHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASPerformAppServiceInteractionResponseToHMI:: + ~ASPerformAppServiceInteractionResponseToHMI() {} + +void ASPerformAppServiceInteractionResponseToHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToHMI(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc new file mode 100644 index 0000000000..35a3e8a6b3 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_request.cc @@ -0,0 +1,86 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_request.h" + +#include "application_manager/app_service_manager.h" +#include "application_manager/message_helper.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASPublishAppServiceRequest::ASPublishAppServiceRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASPublishAppServiceRequest::~ASPublishAppServiceRequest() {} + +void ASPublishAppServiceRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Received a PublishAppService request from HMI"); + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject manifest = + (*message_)[strings::msg_params][strings::app_service_manifest]; + smart_objects::SmartObject service_record = + application_manager_.GetAppServiceManager().PublishAppService(manifest, + false); + if (service_record.empty()) { + SendErrorResponse( + (*message_)[strings::params][strings::correlation_id].asUInt(), + hmi_apis::FunctionID::AppService_PublishAppService, + hmi_apis::Common_Result::REJECTED, + "Failed to publish service", + application_manager::commands::Command::SOURCE_SDL_TO_HMI); + return; + } + + response_params[strings::app_service_record] = service_record; + SendResponse(true, + (*message_)[strings::params][strings::correlation_id].asUInt(), + hmi_apis::FunctionID::AppService_PublishAppService, + hmi_apis::Common_Result::SUCCESS, + &response_params, + application_manager::commands::Command::SOURCE_SDL_TO_HMI); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc new file mode 100644 index 0000000000..c143315b8c --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/as_publish_app_service_response.cc @@ -0,0 +1,60 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/as_publish_app_service_response.h" +#include "application_manager/message_helper.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +ASPublishAppServiceResponse::ASPublishAppServiceResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +ASPublishAppServiceResponse::~ASPublishAppServiceResponse() {} + +void ASPublishAppServiceResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToHMI(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc new file mode 100644 index 0000000000..db1716ecb8 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification.cc @@ -0,0 +1,215 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification.h" +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/enum_schema_item.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +OnASAppServiceDataNotification::OnASAppServiceDataNotification( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : NotificationToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +OnASAppServiceDataNotification::~OnASAppServiceDataNotification() {} + +void OnASAppServiceDataNotification::GetMediaImagePaths( + smart_objects::SmartObject& data, ApplicationSharedPtr app) { + if (data.keyExists(strings::media_image)) { + MessageHelper::VerifyImage( + data[strings::media_image], app, application_manager_); + } +} + +void OnASAppServiceDataNotification::GetWeatherImagePaths( + smart_objects::SmartObject& data, ApplicationSharedPtr app) { + if (data[strings::location].keyExists(strings::location_image)) { + MessageHelper::VerifyImage(data[strings::location][strings::location_image], + app, + application_manager_); + } + + if (data.keyExists(strings::current_forecast) && + data[strings::current_forecast].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage( + data[strings::current_forecast][strings::weather_icon], + app, + application_manager_); + } + + if (data.keyExists(strings::minute_forecast)) { + smart_objects::SmartObject& minute_forecast = + data[strings::minute_forecast]; + for (size_t i = 0; i < minute_forecast.length(); i++) { + if (minute_forecast[i].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage(minute_forecast[i][strings::weather_icon], + app, + application_manager_); + } + } + } + + if (data.keyExists(strings::hourly_forecast)) { + smart_objects::SmartObject& hourly_forecast = + data[strings::hourly_forecast]; + for (size_t i = 0; i < hourly_forecast.length(); i++) { + if (hourly_forecast[i].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage(hourly_forecast[i][strings::weather_icon], + app, + application_manager_); + } + } + } + + if (data.keyExists(strings::multiday_forecast)) { + smart_objects::SmartObject& multiday_forecast = + data[strings::multiday_forecast]; + for (size_t i = 0; i < multiday_forecast.length(); i++) { + if (multiday_forecast[i].keyExists(strings::weather_icon)) { + MessageHelper::VerifyImage(multiday_forecast[i][strings::weather_icon], + app, + application_manager_); + } + } + } +} + +void OnASAppServiceDataNotification::GetNavigationImagePaths( + smart_objects::SmartObject& data, ApplicationSharedPtr app) { + if (data.keyExists(strings::origin) && + data[strings::origin].keyExists(strings::location_image)) { + MessageHelper::VerifyImage(data[strings::origin][strings::location_image], + app, + application_manager_); + } + + if (data.keyExists(strings::destination) && + data[strings::destination].keyExists(strings::location_image)) { + MessageHelper::VerifyImage( + data[strings::destination][strings::location_image], + app, + application_manager_); + } + + if (data.keyExists(strings::instructions)) { + smart_objects::SmartObject& instructions = data[strings::instructions]; + for (size_t i = 0; i < instructions.length(); i++) { + if (instructions[i].keyExists(strings::image)) { + MessageHelper::VerifyImage( + instructions[i][strings::image], app, application_manager_); + } + + if (instructions[i].keyExists(strings::location_details) && + instructions[i][strings::location_details].keyExists( + strings::location_image)) { + MessageHelper::VerifyImage( + instructions[i][strings::location_details][strings::location_image], + app, + application_manager_); + } + } + } +} + +bool OnASAppServiceDataNotification::ValidateParams( + smart_objects::SmartObject& message_params) { + if (!message_params.keyExists(strings::service_data)) { + LOG4CXX_DEBUG(logger_, + "OASD notification received without any service data"); + return false; + } + smart_objects::SmartObject& service_data = + message_params[strings::service_data]; + std::string service_type = service_data[strings::service_type].asString(); + mobile_apis::AppServiceType::eType service_type_value; + const std::string& service_id = service_data[strings::service_id].asString(); + auto service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (!service) { + LOG4CXX_ERROR(logger_, + "OASD notification received with an unpublished service ID"); + return false; + } + + using namespace ns_smart_device_link::ns_smart_objects; + if (service && service->mobile_service && + EnumConversionHelper<mobile_apis::AppServiceType::eType>::StringToEnum( + service_type, &service_type_value)) { + auto app = application_manager_.application(service->connection_key); + if (!app) { + LOG4CXX_ERROR(logger_, + "Failed to find service provider for OASD message"); + return false; + } + + if (service_type_value == mobile_apis::AppServiceType::WEATHER && + service_data.keyExists(strings::weather_service_data)) { + GetWeatherImagePaths(service_data[strings::weather_service_data], app); + } + + if (service_type_value == mobile_apis::AppServiceType::NAVIGATION && + service_data.keyExists(strings::navigation_service_data)) { + GetNavigationImagePaths(service_data[strings::navigation_service_data], + app); + } + + if (service_type_value == mobile_apis::AppServiceType::MEDIA && + service_data.keyExists(strings::media_service_data)) { + GetMediaImagePaths(service_data[strings::media_service_data], app); + } + } + return true; +} + +void OnASAppServiceDataNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Sending AS data to HMI"); + if (ValidateParams((*message_)[strings::msg_params])) { + SendNotification(); + } +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc new file mode 100644 index 0000000000..1c73fc73f4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/hmi/on_as_app_service_data_notification_from_hmi.cc @@ -0,0 +1,99 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/hmi/on_as_app_service_data_notification_from_hmi.h" + +#include "application_manager/app_service_manager.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +OnASAppServiceDataNotificationFromHMI::OnASAppServiceDataNotificationFromHMI( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : NotificationFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +OnASAppServiceDataNotificationFromHMI:: + ~OnASAppServiceDataNotificationFromHMI() {} + +void OnASAppServiceDataNotificationFromHMI::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData from HMI"); + + std::string service_id = + (*message_)[strings::msg_params][strings::service_data] + [strings::service_id] + .asString(); + AppService* service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (!service) { + LOG4CXX_ERROR( + logger_, "No published services exist with service ID: " << service_id); + return; + } else if (service->mobile_service) { + LOG4CXX_ERROR(logger_, "Service was not published by the HMI"); + return; + } else if (!service->record[strings::service_active].asBool()) { + LOG4CXX_ERROR(logger_, "Service is not active"); + return; + } + + std::string service_type = + (*message_)[strings::msg_params][strings::service_data] + [strings::service_type] + .asString(); + std::string published_service_type = + service->record[strings::service_manifest][strings::service_type] + .asString(); + if (published_service_type != service_type) { + LOG4CXX_ERROR(logger_, + "Service type mismatch, expected " + << service_type + << ", but service was published with type " + << published_service_type); + return; + } + + SendNotificationToConsumers( + mobile_apis::FunctionID::eType::OnAppServiceDataID); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc new file mode 100644 index 0000000000..7c2e62abe2 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request.cc @@ -0,0 +1,129 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request.h" +#include "app_service_rpc_plugin/app_service_app_extension.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/enum_schema_item.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +GetAppServiceDataRequest::GetAppServiceDataRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetAppServiceDataRequest::~GetAppServiceDataRequest() {} + +void GetAppServiceDataRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + SendProviderRequest(mobile_apis::FunctionID::GetAppServiceDataID, + hmi_apis::FunctionID::AppService_GetAppServiceData, + &(*message_), + true); +} + +void GetAppServiceDataRequest::HandleSubscribe() { + std::string service_type = + (*message_)[strings::msg_params][strings::service_type].asString(); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + if (app && (*message_)[strings::msg_params].keyExists(strings::subscribe)) { + bool subscribe = + (*message_)[strings::msg_params][strings::subscribe].asBool(); + auto& ext = AppServiceAppExtension::ExtractASExtension(*app); + if (subscribe) { + ext.SubscribeToAppService(service_type); + } else { + ext.UnsubscribeFromAppService(service_type); + } + } +} + +void GetAppServiceDataRequest::on_event( + const event_engine::MobileEvent& event) { + const smart_objects::SmartObject& event_message = event.smart_object(); + + auto msg_params = event_message[strings::msg_params]; + + mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>( + msg_params[strings::result_code].asInt()); + bool success = IsMobileResultSuccess(result); + if (success) { + HandleSubscribe(); + } + + const char* info = msg_params.keyExists(strings::info) + ? msg_params[strings::info].asCharArray() + : NULL; + + SendResponse(success, result, info, &msg_params); +} + +void GetAppServiceDataRequest::on_event(const event_engine::Event& event) { + const smart_objects::SmartObject& event_message = event.smart_object(); + + auto msg_params = event_message[strings::msg_params]; + + hmi_apis::Common_Result::eType hmi_result = + static_cast<hmi_apis::Common_Result::eType>( + event_message[strings::params][hmi_response::code].asInt()); + + mobile_apis::Result::eType result = + MessageHelper::HMIToMobileResult(hmi_result); + bool success = PrepareResultForMobileResponse( + hmi_result, HmiInterfaces::HMI_INTERFACE_AppService); + if (success) { + HandleSubscribe(); + } + + const char* info = msg_params.keyExists(strings::info) + ? msg_params[strings::info].asCharArray() + : NULL; + + SendResponse(success, result, info, &msg_params); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc new file mode 100644 index 0000000000..0af1a5436b --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_request_to_mobile.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_request_to_mobile.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +GetAppServiceDataRequestToMobile::GetAppServiceDataRequestToMobile( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestToMobile(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetAppServiceDataRequestToMobile::~GetAppServiceDataRequestToMobile() {} + +void GetAppServiceDataRequestToMobile::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc new file mode 100644 index 0000000000..32ad8e014d --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +GetAppServiceDataResponse::GetAppServiceDataResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetAppServiceDataResponse::~GetAppServiceDataResponse() {} + +void GetAppServiceDataResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc new file mode 100644 index 0000000000..90fca04eb2 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/get_app_service_data_response_from_mobile.cc @@ -0,0 +1,66 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/get_app_service_data_response_from_mobile.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +GetAppServiceDataResponseFromMobile::GetAppServiceDataResponseFromMobile( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseFromMobile(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetAppServiceDataResponseFromMobile::~GetAppServiceDataResponseFromMobile() {} + +void GetAppServiceDataResponseFromMobile::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + event_engine::MobileEvent event(mobile_apis::FunctionID::GetAppServiceDataID); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc new file mode 100644 index 0000000000..1ffe99462d --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification.cc @@ -0,0 +1,123 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h" + +#include "app_service_rpc_plugin/app_service_app_extension.h" +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/helpers/application_helper.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" + +#include "smart_objects/enum_schema_item.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +OnAppServiceDataNotification::OnAppServiceDataNotification( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandNotificationImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +OnAppServiceDataNotification::~OnAppServiceDataNotification() {} + +void OnAppServiceDataNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Sending OnAppServiceData to consumer"); + + std::string service_id = + (*message_)[strings::msg_params][strings::service_data] + [strings::service_id] + .asString(); + auto service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + + if (!service) { + LOG4CXX_ERROR(logger_, "Service sending OnAppServiceData is not published"); + return; + } else if (!service + ->record[strings::service_manifest] + [strings::allow_app_consumers] + .asBool()) { + LOG4CXX_ERROR(logger_, + "Service does not allow for app consumers, skipping mobile " + "OnAppServiceData notification"); + return; + } + + std::string service_type = + (*message_)[strings::msg_params][strings::service_data] + [strings::service_type] + .asString(); + + auto subscribed_to_app_service_predicate = + [service_type](const ApplicationSharedPtr app) { + DCHECK_OR_RETURN(app, false); + auto& ext = AppServiceAppExtension::ExtractASExtension(*app); + LOG4CXX_DEBUG(logger_, "Check subscription for type: " << service_type); + return ext.IsSubscribedToAppService(service_type); + }; + + const std::vector<ApplicationSharedPtr>& applications = + application_manager::FindAllApps(application_manager_.applications(), + subscribed_to_app_service_predicate); + + std::vector<ApplicationSharedPtr>::const_iterator app_it = + applications.begin(); + + for (; applications.end() != app_it; ++app_it) { + const ApplicationSharedPtr app = *app_it; + if (!app) { + LOG4CXX_ERROR(logger_, "NULL pointer"); + continue; + } + LOG4CXX_DEBUG(logger_, + "Sending OnAppServiceDataNotification to mobile connection: " + << app->app_id()); + (*message_)[app_mngr::strings::params][app_mngr::strings::connection_key] = + app->app_id(); + SendNotification(); + } +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc new file mode 100644 index 0000000000..5caacc9801 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/on_app_service_data_notification_from_mobile.cc @@ -0,0 +1,119 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification_from_mobile.h" +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +OnAppServiceDataNotificationFromMobile::OnAppServiceDataNotificationFromMobile( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandNotificationFromMobileImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +OnAppServiceDataNotificationFromMobile:: + ~OnAppServiceDataNotificationFromMobile() {} + +void OnAppServiceDataNotificationFromMobile::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Received an OnAppServiceData"); + MessageHelper::PrintSmartObject(*message_); + + uint32_t app_connection_key = connection_key(); + std::string service_type = + (*message_)[strings::msg_params][strings::service_data] + [strings::service_type] + .asString(); + + ApplicationSharedPtr app = + application_manager_.application(app_connection_key); + + bool result = policy_handler_.CheckAppServiceParameters( + app->policy_app_id(), std::string(), service_type, NULL); + + if (!result) { + LOG4CXX_DEBUG(logger_, + "Incorrect service type received in " + "OnAppServiceDataNotificationFromMobile"); + return; + } + + std::string service_id = + (*message_)[strings::msg_params][strings::service_data] + [strings::service_id] + .asString(); + AppService* service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (!service) { + LOG4CXX_ERROR( + logger_, "No published services exist with service ID: " << service_id); + return; + } else if (!service->mobile_service || + service->connection_key != app_connection_key) { + LOG4CXX_ERROR(logger_, "Service was not published by this application"); + return; + } else if (!service->record[strings::service_active].asBool()) { + LOG4CXX_ERROR(logger_, "Service is not active"); + return; + } + + std::string published_service_type = + service->record[strings::service_manifest][strings::service_type] + .asString(); + if (published_service_type != service_type) { + LOG4CXX_ERROR(logger_, + "Service type mismatch, expected " + << service_type + << ", but service was published with type " + << published_service_type); + return; + } + + SendNotificationToConsumers( + hmi_apis::FunctionID::eType::AppService_OnAppServiceData); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc new file mode 100644 index 0000000000..63b6e47d8e --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request.cc @@ -0,0 +1,188 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request.h" + +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "interfaces/MOBILE_API.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +PerformAppServiceInteractionRequest::PerformAppServiceInteractionRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +PerformAppServiceInteractionRequest::~PerformAppServiceInteractionRequest() {} + +void PerformAppServiceInteractionRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + auto app = application_manager_.application(connection_key()); + if (!app) { + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + std::string service_id = msg_params[strings::service_id].asString(); + auto service = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (!service) { + SendResponse(false, + mobile_apis::Result::INVALID_ID, + "The requested service ID does not exist"); + return; + } + + if (!service->record[strings::service_manifest][strings::allow_app_consumers] + .asBool()) { + SendResponse( + false, + mobile_apis::Result::REJECTED, + "The requested service ID does not allow mobile app consumers"); + return; + } + + bool request_service_active = false; + if (msg_params.keyExists(strings::request_service_active)) { + request_service_active = + msg_params[strings::request_service_active].asBool(); + msg_params.erase(strings::request_service_active); + } + + // Only activate service if it is not already active + bool activate_service = request_service_active && + !service->record[strings::service_active].asBool(); + if (activate_service) { + if (app->IsFullscreen()) { + // App is in foreground, we can just activate the service + application_manager_.GetAppServiceManager().ActivateAppService( + service_id); + } else { + // App is not in foreground, we need to prompt the user to activate the + // service + smart_objects::SmartObject request_params; + request_params[strings::service_id] = service_id; + application_manager_.IncreaseForwardedRequestTimeout(connection_key(), + correlation_id()); + SendHMIRequest(hmi_apis::FunctionID::AppService_GetActiveServiceConsent, + &request_params, + true); + return; + } + } + + SendProviderRequest( + mobile_apis::FunctionID::PerformAppServiceInteractionID, + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + &(*message_), + true); +} + +void PerformAppServiceInteractionRequest::on_event( + const event_engine::Event& event) { + LOG4CXX_DEBUG(logger_, "HMI PerformAppServiceInteraction on_event"); + const smart_objects::SmartObject& event_message = event.smart_object(); + + auto msg_params = event_message[strings::msg_params]; + + const char* info = msg_params.keyExists(strings::info) + ? msg_params[strings::info].asCharArray() + : NULL; + hmi_apis::Common_Result::eType hmi_result = + static_cast<hmi_apis::Common_Result::eType>( + event_message[strings::params][hmi_response::code].asInt()); + mobile_apis::Result::eType result = + MessageHelper::HMIToMobileResult(hmi_result); + bool success = PrepareResultForMobileResponse( + hmi_result, HmiInterfaces::HMI_INTERFACE_AppService); + + switch (event.id()) { + case hmi_apis::FunctionID::AppService_PerformAppServiceInteraction: + SendResponse(success, result, info, &msg_params); + break; + case hmi_apis::FunctionID::AppService_GetActiveServiceConsent: + if (msg_params[strings::activate].asBool()) { + // User agreed to activate service, we can now send the provider request + application_manager_.GetAppServiceManager().ActivateAppService( + (*message_)[strings::msg_params][strings::service_id].asString()); + SendProviderRequest( + mobile_apis::FunctionID::PerformAppServiceInteractionID, + hmi_apis::FunctionID::AppService_PerformAppServiceInteraction, + &(*message_), + true); + } else if (mobile_apis::Result::SUCCESS == result) { + // Request was successful, but user denied the request to activate the + // service + SendResponse(false, + mobile_apis::Result::USER_DISALLOWED, + "Request to activate service was denied by driver"); + } else { + SendResponse(success, result, info); + } + break; + default: + break; + } +} + +void PerformAppServiceInteractionRequest::on_event( + const event_engine::MobileEvent& event) { + LOG4CXX_DEBUG(logger_, "Mobile PerformAppServiceInteraction on_event"); + const smart_objects::SmartObject& event_message = event.smart_object(); + + auto msg_params = event_message[strings::msg_params]; + + const char* info = msg_params.keyExists(strings::info) + ? msg_params[strings::info].asCharArray() + : NULL; + mobile_apis::Result::eType result = static_cast<mobile_apis::Result::eType>( + msg_params[strings::result_code].asInt()); + bool success = IsMobileResultSuccess(result); + + SendResponse(success, result, info, &msg_params); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc new file mode 100644 index 0000000000..2a7b644cb3 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_request_to_mobile.cc @@ -0,0 +1,62 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_request_to_mobile.h" +#include "application_manager/application_impl.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +PerformAppServiceInteractionRequestToMobile:: + PerformAppServiceInteractionRequestToMobile( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestToMobile(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +PerformAppServiceInteractionRequestToMobile:: + ~PerformAppServiceInteractionRequestToMobile() {} + +void PerformAppServiceInteractionRequestToMobile::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc new file mode 100644 index 0000000000..5e84f42c34 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response.cc @@ -0,0 +1,60 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response.h" +#include "application_manager/application_impl.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +PerformAppServiceInteractionResponse::PerformAppServiceInteractionResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +PerformAppServiceInteractionResponse::~PerformAppServiceInteractionResponse() {} + +void PerformAppServiceInteractionResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc new file mode 100644 index 0000000000..9912df84ce --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/perform_app_service_interaction_response_from_mobile.cc @@ -0,0 +1,66 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/perform_app_service_interaction_response_from_mobile.h" +#include "application_manager/application_impl.h" +#include "interfaces/MOBILE_API.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +PerformAppServiceInteractionResponseFromMobile:: + PerformAppServiceInteractionResponseFromMobile( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseFromMobile(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +PerformAppServiceInteractionResponseFromMobile:: + ~PerformAppServiceInteractionResponseFromMobile() {} + +void PerformAppServiceInteractionResponseFromMobile::Run() { + LOG4CXX_AUTO_TRACE(logger_); + event_engine::MobileEvent event( + mobile_apis::FunctionID::PerformAppServiceInteractionID); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc new file mode 100644 index 0000000000..c168b4bf2f --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_request.cc @@ -0,0 +1,135 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/publish_app_service_request.h" + +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" +#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +PublishAppServiceRequest::PublishAppServiceRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +PublishAppServiceRequest::~PublishAppServiceRequest() {} + +void PublishAppServiceRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Received a PublishAppService " << connection_key()); + MessageHelper::PrintSmartObject(*message_); + + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject manifest = + (*message_)[strings::msg_params][strings::app_service_manifest]; + + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + std::string requested_service_name = ""; + + if ((*message_)[strings::msg_params][strings::app_service_manifest].keyExists( + strings::service_name)) { + requested_service_name = + (*message_)[strings::msg_params][strings::app_service_manifest] + [strings::service_name] + .asString(); + } + + std::string requested_service_type = + (*message_)[strings::msg_params][strings::app_service_manifest] + [strings::service_type] + .asString(); + + smart_objects::SmartArray* requested_handled_rpcs = NULL; + if ((*message_)[strings::msg_params][strings::app_service_manifest].keyExists( + strings::handled_rpcs)) { + requested_handled_rpcs = + (*message_)[strings::msg_params][strings::app_service_manifest] + [strings::handled_rpcs] + .asArray(); + } + + bool result = + policy_handler_.CheckAppServiceParameters(app->policy_app_id(), + requested_service_name, + requested_service_type, + requested_handled_rpcs); + + if (!result) { + SendResponse(false, + mobile_apis::Result::DISALLOWED, + "Service disallowed by policies"); + return; + } + + auto& ext = + sdl_rpc_plugin::SystemCapabilityAppExtension::ExtractExtension(*app); + ext.SubscribeTo(mobile_apis::SystemCapabilityType::APP_SERVICES); + + smart_objects::SmartObject service_record = + application_manager_.GetAppServiceManager().PublishAppService( + manifest, true, connection_key()); + + if (service_record.empty()) { + SendResponse( + false, mobile_apis::Result::REJECTED, "Failed to publish service"); + return; + } + + if (app->IsFullscreen()) { + // Service should be activated if app is in the foreground + application_manager_.GetAppServiceManager().ActivateAppService( + service_record[strings::service_id].asString()); + } + + response_params[strings::app_service_record] = service_record; + + SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc new file mode 100644 index 0000000000..d1bfc6e154 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/commands/mobile/publish_app_service_response.cc @@ -0,0 +1,62 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/publish_app_service_response.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" + +namespace app_service_rpc_plugin { +using namespace application_manager; +namespace commands { + +PublishAppServiceResponse::PublishAppServiceResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +PublishAppServiceResponse::~PublishAppServiceResponse() {} + +void PublishAppServiceResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace app_service_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt new file mode 100644 index 0000000000..0b56ddb7e9 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/CMakeLists.txt @@ -0,0 +1,40 @@ +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) + +include_directories( + ${GMOCK_INCLUDE_DIRECTORY} + ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include + ${COMPONENTS_DIR}/application_manager/rpc_plugins/app_service_rpc_plugin/include/app_service_rpc_plugin/commands/ + ${COMPONENTS_DIR}/application_manager/test/include/ + ${POLICY_MOCK_INCLUDE_PATH}/ + ${CMAKE_SOURCE_DIR}/src + ${COMPONENTS_DIR}/resumption/include +) + + +set(COMMANDS_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/commands) + +file(GLOB SOURCES + ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc + ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc + ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc + ${COMMANDS_TEST_DIR}/hmi/* + ${COMMANDS_TEST_DIR}/mobile/* + ${COMPONENTS_DIR}/application_manager/src/message.cc + ${COMPONENTS_DIR}/application_manager/src/event_engine/* +) + +set(LIBRARIES + gmock + Utils + SmartObjects + HMI_API + MOBILE_API + connectionHandler + app_service_rpc_plugin + sdl_rpc_plugin + jsoncpp + Policy + Resumption +) + +create_cotired_test("app_services_commands_test" "${SOURCES}" "${LIBRARIES}" ) diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc new file mode 100644 index 0000000000..f64f353767 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/command_request_test.h" + +#include <stdint.h> +#include <string> +#include <vector> +#include "gtest/gtest.h" + +#include "hmi/as_app_service_activation_request.h" +#include "hmi/as_app_service_activation_response.h" +#include "hmi/as_get_active_service_consent_request.h" +#include "hmi/as_get_active_service_consent_response.h" +#include "hmi/as_get_app_service_data_request_from_hmi.h" +#include "hmi/as_get_app_service_data_request_to_hmi.h" +#include "hmi/as_get_app_service_data_response_from_hmi.h" +#include "hmi/as_get_app_service_data_response_to_hmi.h" +#include "hmi/as_get_app_service_records_request.h" +#include "hmi/as_get_app_service_records_response.h" +#include "hmi/as_perform_app_service_interaction_request_from_hmi.h" +#include "hmi/as_perform_app_service_interaction_request_to_hmi.h" +#include "hmi/as_perform_app_service_interaction_response_from_hmi.h" +#include "hmi/as_perform_app_service_interaction_response_to_hmi.h" +#include "hmi/as_publish_app_service_request.h" +#include "hmi/as_publish_app_service_response.h" +#include "hmi/on_as_app_service_data_notification.h" +#include "hmi/on_as_app_service_data_notification_from_hmi.h" + +#include "application_manager/commands/commands_test.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/mock_event_dispatcher.h" + +namespace am = application_manager; + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace dummy_hmi_commands_test { + +namespace commands = app_service_rpc_plugin::commands; + +using ::application_manager::ApplicationSharedPtr; +using application_manager::commands::MessageSharedPtr; +using ::test::components::application_manager_test::MockApplication; +using ::test::components::application_manager_test::MockApplicationManager; +using ::test::components::application_manager_test:: + MockApplicationManagerSettings; +using ::test::components::event_engine_test::MockEventDispatcher; +using ::testing::_; +using ::testing::NotNull; +using ::testing::Types; + +template <class Command> +class HMICommandsTest : public components::commands_test::CommandRequestTest< + CommandsTestMocks::kIsNice> { + public: + typedef Command CommandType; + + void InitCommand(const uint32_t& timeout) OVERRIDE { + stream_retry_.first = 0; + stream_retry_.second = 0; + EXPECT_CALL(app_mngr_settings_, default_timeout()) + .WillOnce(ReturnRef(timeout)); + ON_CALL(app_mngr_, event_dispatcher()) + .WillByDefault(ReturnRef(event_dispatcher_)); + ON_CALL(app_mngr_, get_settings()) + .WillByDefault(ReturnRef(app_mngr_settings_)); + ON_CALL(app_mngr_settings_, start_stream_retry_amount()) + .WillByDefault(ReturnRef(stream_retry_)); + } + + protected: + std::pair<uint32_t, int32_t> stream_retry_; +}; + +template <class Command> +class HMICommandsTestFirst : public HMICommandsTest<Command> { + public: + using typename HMICommandsTest<Command>::CommandType; +}; + +/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few + * TYPED_TEST_CASE for HMI and mobile commands + */ + +typedef Types<commands::ASAppServiceActivationRequest, + commands::ASAppServiceActivationResponse, + commands::ASGetActiveServiceConsentRequest, + commands::ASGetActiveServiceConsentResponse, + commands::ASPerformAppServiceInteractionRequestFromHMI, + commands::ASGetAppServiceDataRequestToHMI, + commands::ASGetAppServiceDataResponseFromHMI, + commands::ASGetAppServiceDataResponseToHMI, + commands::ASGetAppServiceRecordsRequest, + commands::ASGetAppServiceRecordsResponse, + commands::ASPerformAppServiceInteractionRequestFromHMI, + commands::ASPerformAppServiceInteractionRequestToHMI, + commands::ASPerformAppServiceInteractionResponseFromHMI, + commands::ASPerformAppServiceInteractionResponseToHMI, + commands::ASPublishAppServiceRequest, + commands::ASPublishAppServiceResponse, + commands::OnASAppServiceDataNotification, + commands::OnASAppServiceDataNotificationFromHMI> + HMICommandsListFirst; + +TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst); + +TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) { + std::shared_ptr<typename TestFixture::CommandType> command = + this->template CreateCommand<typename TestFixture::CommandType>(); + EXPECT_NE(command.use_count(), 0); +} + +} // namespace dummy_hmi_commands_test +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc new file mode 100644 index 0000000000..e77b21ca6d --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/command_request_test.h" + +#include <stdint.h> +#include <string> +#include <vector> +#include "gtest/gtest.h" + +#include "mobile/get_app_service_data_request.h" +#include "mobile/get_app_service_data_request_to_mobile.h" +#include "mobile/get_app_service_data_response.h" +#include "mobile/get_app_service_data_response_from_mobile.h" +#include "mobile/on_app_service_data_notification.h" +#include "mobile/on_app_service_data_notification_from_mobile.h" +#include "mobile/perform_app_service_interaction_request.h" +#include "mobile/perform_app_service_interaction_request_to_mobile.h" +#include "mobile/perform_app_service_interaction_response.h" +#include "mobile/perform_app_service_interaction_response_from_mobile.h" +#include "mobile/publish_app_service_request.h" +#include "mobile/publish_app_service_response.h" + +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_event_dispatcher.h" +#include "test/application_manager/mock_application_manager_settings.h" + +namespace am = application_manager; + +namespace test { +namespace components { +namespace commands_test { +namespace mobile_commands_test { +namespace dummy_mobile_commands_test { + +namespace commands = app_service_rpc_plugin::commands; +using am::commands::MessageSharedPtr; +using ::application_manager::ApplicationSharedPtr; +using ::test::components::application_manager_test::MockApplication; +using ::test::components::application_manager_test::MockApplicationManager; +using ::test::components::application_manager_test:: + MockApplicationManagerSettings; +using ::test::components::event_engine_test::MockEventDispatcher; +using ::testing::_; +using ::testing::NotNull; +using ::testing::Types; + +namespace { +const std::string kEmptyString_ = ""; +} // namespace + +template <class Command> +class MobileCommandsTest : public components::commands_test::CommandRequestTest< + CommandsTestMocks::kIsNice> { + public: + typedef Command CommandType; + + void InitCommand(const uint32_t& timeout) OVERRIDE { + EXPECT_CALL(app_mngr_settings_, default_timeout()) + .WillOnce(ReturnRef(timeout)); + ON_CALL(app_mngr_, event_dispatcher()) + .WillByDefault(ReturnRef(event_dispatcher_)); + ON_CALL(app_mngr_, get_settings()) + .WillByDefault(ReturnRef(app_mngr_settings_)); + ON_CALL(app_mngr_settings_, app_icons_folder()) + .WillByDefault(ReturnRef(kEmptyString_)); + } +}; + +template <class Command> +class MobileCommandsTestFirst : public MobileCommandsTest<Command> { + public: + using typename MobileCommandsTest<Command>::CommandType; +}; + +/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few + * TYPED_TEST_CASE for HMI and mobile commands + */ + +typedef Types<commands::GetAppServiceDataRequest, + commands::GetAppServiceDataRequestToMobile, + commands::GetAppServiceDataResponse, + commands::GetAppServiceDataResponseFromMobile, + commands::OnAppServiceDataNotification, + commands::OnAppServiceDataNotificationFromMobile, + commands::PerformAppServiceInteractionRequest, + commands::PerformAppServiceInteractionRequestToMobile, + commands::PerformAppServiceInteractionResponse, + commands::PerformAppServiceInteractionResponseFromMobile, + commands::PublishAppServiceRequest, + commands::PublishAppServiceResponse> + MobileCommandsListFirst; + +TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst); + +TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) { + std::shared_ptr<typename TestFixture::CommandType> command = + this->template CreateCommand<typename TestFixture::CommandType>(); + EXPECT_NE(command.use_count(), 0); +} + +} // namespace dummy_mobile_commands_test +} // namespace mobile_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc new file mode 100644 index 0000000000..3e88d4eaf3 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "app_service_rpc_plugin/commands/mobile/on_app_service_data_notification.h" +#include "app_service_rpc_plugin/app_service_app_extension.h" +#include "app_service_rpc_plugin/app_service_rpc_plugin.h" +#include "application_manager/application.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/mock_app_service_manager.h" +#include "application_manager/mock_application.h" +#include "gtest/gtest.h" +#include "interfaces/MOBILE_API.h" +#include "resumption/last_state_impl.h" + +namespace am = application_manager; +using am::ApplicationSet; +using am::commands::MessageSharedPtr; +using app_service_rpc_plugin::commands::OnAppServiceDataNotification; +using test::components::application_manager_test::MockApplication; +using test::components::application_manager_test::MockApplicationManager; +using test::components::application_manager_test::MockAppServiceManager; +using test::components::commands_test::CommandsTest; +using test::components::commands_test::CommandsTestMocks; +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnNull; +using ::testing::ReturnRef; +using ::testing::SaveArg; + +namespace { +const uint32_t kAppId = 0u; +const uint32_t kConnectionKey = 1u; +const std::string kPolicyAppId = "Test"; +const int kModuleId = 153u; +} // namespace + +namespace app_service_plugin_test { +using namespace app_service_rpc_plugin; +using application_manager::ApplicationSet; + +class OnAppServiceDataNotificationTest + : public CommandsTest<CommandsTestMocks::kIsNice> { + public: + OnAppServiceDataNotificationTest() + : mock_app_(std::make_shared<NiceMock<MockApplication> >()) + , app_service_app_extension_( + std::make_shared<app_service_rpc_plugin::AppServiceAppExtension>( + app_service_plugin_, *mock_app_)) + , apps_lock_(std::make_shared<sync_primitives::Lock>()) + , apps_da_(apps_, apps_lock_) + , last_state_("app_storage_folder", "app_info_storage") + , app_service_manager_(app_mngr_, last_state_) { + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId)); + ON_CALL(*mock_app_, is_remote_control_supported()) + .WillByDefault(Return(true)); + ON_CALL(*mock_app_, QueryInterface(_)) + .WillByDefault(Return(app_service_app_extension_)); + } + + MessageSharedPtr CreateBasicMessage() { + MessageSharedPtr message = CreateMessage(); + (*message)[application_manager::strings::params] + [application_manager::strings::function_id] = + mobile_apis::FunctionID::OnAppServiceDataID; + (*message)[application_manager::strings::params] + [application_manager::strings::connection_key] = kConnectionKey; + (*message)[application_manager::strings::params] + [application_manager::strings::app_id] = kAppId; + + return message; + } + + protected: + std::shared_ptr<MockApplication> mock_app_; + std::shared_ptr<AppServiceAppExtension> app_service_app_extension_; + app_service_rpc_plugin::AppServiceRpcPlugin app_service_plugin_; + application_manager::ApplicationSet apps_; + const std::shared_ptr<sync_primitives::Lock> apps_lock_; + DataAccessor<application_manager::ApplicationSet> apps_da_; + resumption::LastStateImpl last_state_; + MockAppServiceManager app_service_manager_; +}; + +TEST_F(OnAppServiceDataNotificationTest, Run_SendMessageToMobile_Notification) { + MessageSharedPtr mobile_message = CreateBasicMessage(); + + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + [am::strings::service_type] = "MEDIA"; + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + [am::strings::service_id] = "mediaid1234"; + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + ["mediaServiceData"]["mediaTitle"] = "media title"; + + apps_.insert(mock_app_); + app_service_app_extension_->SubscribeToAppService("MEDIA"); + ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_)); + + am::AppService service; + service.connection_key = 1; + service.mobile_service = true; + service + .record[am::strings::service_manifest][am::strings::allow_app_consumers] = + true; + EXPECT_CALL(app_service_manager_, FindServiceByID(_)) + .WillOnce(Return(&service)); + + EXPECT_CALL(app_mngr_, GetAppServiceManager()) + .WillRepeatedly(ReturnRef(app_service_manager_)); + + std::shared_ptr<OnAppServiceDataNotification> command = + CreateCommand<OnAppServiceDataNotification>(mobile_message); + + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)) + .WillOnce(SaveArg<0>(&mobile_message)); + // Act + command->Run(); + + // Assertions + ASSERT_TRUE(mobile_message.get()); + Mock::VerifyAndClearExpectations(&app_mngr_); +} + +TEST_F(OnAppServiceDataNotificationTest, Run_NoService) { + MessageSharedPtr mobile_message = CreateBasicMessage(); + + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + [am::strings::service_type] = "MEDIA"; + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + [am::strings::service_id] = "mediaid1234"; + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + ["mediaServiceData"]["mediaTitle"] = "media title"; + + apps_.insert(mock_app_); + app_service_app_extension_->SubscribeToAppService("MEDIA"); + ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_)); + + EXPECT_CALL(app_service_manager_, FindServiceByID(_)).WillOnce(ReturnNull()); + + EXPECT_CALL(app_mngr_, GetAppServiceManager()) + .WillRepeatedly(ReturnRef(app_service_manager_)); + + std::shared_ptr<OnAppServiceDataNotification> command = + CreateCommand<OnAppServiceDataNotification>(mobile_message); + + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)).Times(0); + command->Run(); + + Mock::VerifyAndClearExpectations(&app_mngr_); +} + +TEST_F(OnAppServiceDataNotificationTest, Run_NoSubscribedApps) { + MessageSharedPtr mobile_message = CreateBasicMessage(); + + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + [am::strings::service_type] = "MEDIA"; + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + [am::strings::service_id] = "mediaid1234"; + (*mobile_message)[am::strings::msg_params][am::strings::service_data] + ["mediaServiceData"]["mediaTitle"] = "media title"; + + apps_.insert(mock_app_); + ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_)); + + am::AppService service; + service.connection_key = 1; + service.mobile_service = true; + service + .record[am::strings::service_manifest][am::strings::allow_app_consumers] = + true; + EXPECT_CALL(app_service_manager_, FindServiceByID(_)) + .WillOnce(Return(&service)); + + EXPECT_CALL(app_mngr_, GetAppServiceManager()) + .WillRepeatedly(ReturnRef(app_service_manager_)); + + std::shared_ptr<OnAppServiceDataNotification> command = + CreateCommand<OnAppServiceDataNotification>(mobile_message); + + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)).Times(0); + command->Run(); + + Mock::VerifyAndClearExpectations(&app_mngr_); +} + +} // namespace app_service_plugin_test diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h index 3bc34be8d1..08082d98bb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_request.h @@ -35,8 +35,8 @@ #include "application_manager/commands/request_to_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h index 939d5fa468..5ed2236d9c 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_button_press_response.h @@ -35,8 +35,8 @@ #include "application_manager/commands/response_from_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h index 97df5e8390..9a6cf9e290 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h @@ -1,42 +1,42 @@ /* -* Copyright (c) 2018, Ford Motor Company -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* Redistributions of source code must retain the above copyright notice, this -* list of conditions and the following disclaimer. -* -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following -* disclaimer in the documentation and/or other materials provided with the -* distribution. -* -* Neither the name of the Ford Motor Company nor the names of its contributors -* may be used to endorse or promote products derived from this software -* without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_HMI_RC_GET_INTERIOR_VEHICLE_DATA_CONSENT_REQUEST_H_ #include "application_manager/commands/request_to_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h index 46232987a5..677e3ad1f0 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h @@ -35,8 +35,8 @@ #include "application_manager/commands/response_from_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h index a88a39aa7a..a75020956c 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h @@ -35,8 +35,8 @@ #include "application_manager/commands/request_to_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h index c9e5d39d1d..059164dc9f 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h @@ -35,8 +35,8 @@ #include "application_manager/commands/response_from_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h index aeb0a06d22..2a15f3816a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h @@ -35,8 +35,8 @@ #include "application_manager/commands/notification_from_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h index 69b48bfecf..aeba2f1440 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h @@ -35,8 +35,8 @@ #include "application_manager/commands/request_to_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h index 8a63503220..8369941c30 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h @@ -35,8 +35,8 @@ #include "application_manager/commands/response_from_hmi.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h index 0f3964494e..69122c19f3 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/button_press_response.h @@ -34,9 +34,9 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_BUTTON_PRESS_RESPONSE_H_ #include "application_manager/commands/command_response_impl.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/commands/rc_command_request.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h index 01588cc6b7..cfb5e72c95 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_ -#include "rc_rpc_plugin/commands/rc_command_request.h" #include <string> +#include "rc_rpc_plugin/commands/rc_command_request.h" namespace rc_rpc_plugin { namespace app_mngr = application_manager; @@ -76,9 +76,9 @@ class GetInteriorVehicleDataRequest : public RCCommandRequest { bool HasRequestExcessiveSubscription(); /** - * @brief Handle subscription to vehicle data - * @param hmi_response json message with response from HMI - */ + * @brief Handle subscription to vehicle data + * @param hmi_response json message with response from HMI + */ void ProccessSubscription(const smart_objects::SmartObject& hmi_response); /** diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h index bf8208edc2..58dac85633 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h @@ -35,8 +35,8 @@ #include "application_manager/commands/command_response_impl.h" #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h index 931e79366c..2a7362510d 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h @@ -35,9 +35,9 @@ #include <string> #include "application_manager/commands/command_notification_impl.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" -#include "rc_rpc_plugin/interior_data_cache.h" #include "rc_rpc_plugin/commands/rc_command_request.h" +#include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h index 1ab5ccc6bc..f54418fc08 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h @@ -34,9 +34,9 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_MOBILE_SET_INTERIOR_VEHICLE_DATA_RESPONSE_H_ #include "application_manager/commands/command_response_impl.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" -#include "rc_rpc_plugin/interior_data_cache.h" #include "rc_rpc_plugin/commands/rc_command_request.h" +#include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h index 8e7ed9c667..0ca7789791 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_params.h @@ -39,7 +39,7 @@ namespace rpc_service { class RPCService; } class HMICapabilities; -} +} // namespace application_manager namespace policy { class PolicyHandlerInterface; @@ -60,5 +60,5 @@ struct RCCommandParams { rc_rpc_plugin::InteriorDataCache& interior_data_cache_; rc_rpc_plugin::InteriorDataManager& interior_data_manager_; }; -} +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_PARAMS_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h index ce95617b6c..b4e34c083e 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/commands/rc_command_request.h @@ -33,11 +33,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_ -#include "rc_rpc_plugin/resource_allocation_manager.h" -#include "rc_rpc_plugin/rc_app_extension.h" #include "application_manager/commands/command_request_impl.h" -#include "rc_rpc_plugin/interior_data_cache.h" #include "rc_rpc_plugin/commands/rc_command_params.h" +#include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/rc_app_extension.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" namespace rc_rpc_plugin { namespace app_mngr = application_manager; @@ -166,7 +166,7 @@ class RCCommandRequest : public app_mngr::commands::CommandRequestImpl { std::string disallowed_info_; }; -} -} +} // namespace commands +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_COMMANDS_RC_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h index bb45247fae..c7dda761bf 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache.h @@ -81,6 +81,6 @@ class InteriorDataCache { */ virtual void Clear() = 0; }; -} // rc_rpc_plugin +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h index f2971e3d72..b40ce4eb4b 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_cache_impl.h @@ -35,9 +35,9 @@ #include <map> -#include "utils/macro.h" -#include "utils/lock.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "utils/lock.h" +#include "utils/macro.h" namespace rc_rpc_plugin { class InteriorDataCacheImpl : public InteriorDataCache { @@ -59,6 +59,6 @@ class InteriorDataCacheImpl : public InteriorDataCache { mutable sync_primitives::Lock cached_data_lock_; }; -} // rc_rpc_plugin +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_INTERIOR_DATA_CACHE_IMPL_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h index f28c388055..157e031869 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager.h @@ -50,10 +50,10 @@ class InteriorDataManager { virtual void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) = 0; /** - * @brief OnApplicationEvent Notifies modules on certain application events - * @param event Event - * @param application Pointer to application struct - */ + * @brief OnApplicationEvent Notifies modules on certain application events + * @param event Event + * @param application Pointer to application struct + */ virtual void OnApplicationEvent( plugins::ApplicationEvent event, app_mngr::ApplicationSharedPtr application) = 0; @@ -71,13 +71,13 @@ class InteriorDataManager { virtual void StoreRequestToHMITime(const std::string& module_type) = 0; /** - * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed of - * bounce during current time frame. - * calculate amount of requests per module type in time frame and checks if it - * bigger then allowed by ini file - * @param module_type moduletype to calculate frequency on - * @return true if amount of requests was not exceeded, otherwise return false. - */ + * @brief CheckRequestsToHMIFrequency check that rate limits are not allowed + * of bounce during current time frame. calculate amount of requests per + * module type in time frame and checks if it bigger then allowed by ini file + * @param module_type moduletype to calculate frequency on + * @return true if amount of requests was not exceeded, otherwise return + * false. + */ virtual bool CheckRequestsToHMIFrequency(const std::string& module_type) = 0; }; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h index 9b16a2c4da..b98ba596fb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/interior_data_manager_impl.h @@ -40,7 +40,7 @@ class ApplicationManager; namespace rpc_service { class RPCService; } -} +} // namespace application_manager namespace rc_rpc_plugin { class InteriorDataCache; @@ -94,7 +94,8 @@ class InteriorDataManagerImpl : public InteriorDataManager { * @brief AppsModules mapping from applications to list of modules */ typedef std::map<application_manager::ApplicationSharedPtr, - std::vector<std::string> > AppsModules; + std::vector<std::string> > + AppsModules; /** * @brief AppsSubscribedModules get mapping of application to list of diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h index e36968fc4b..36fe9f5bdb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h @@ -33,11 +33,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_APP_EXTENSION_H_ -#include <string> -#include <set> #include <memory> -#include "utils/macro.h" +#include <set> +#include <string> #include "application_manager/app_extension.h" +#include "utils/macro.h" namespace rc_rpc_plugin { class RCAppExtension : public application_manager::AppExtension { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h index 56be342b56..aa01b608b4 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_command_factory.h @@ -34,15 +34,14 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_COMMAND_FACTORY_H_ #include <memory> -#include "application_manager/command_factory.h" #include "application_manager/application_manager.h" #include "application_manager/command_factory.h" -#include "application_manager/rpc_service.h" #include "application_manager/hmi_capabilities.h" #include "application_manager/policies/policy_handler_interface.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" -#include "rc_rpc_plugin/interior_data_cache.h" +#include "application_manager/rpc_service.h" #include "rc_rpc_plugin/commands/rc_command_params.h" +#include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/macro.h" namespace rc_rpc_plugin { @@ -64,10 +63,10 @@ class RCCommandFactory : public application_manager::CommandFactory { app_mngr::commands::Command::CommandSource source) OVERRIDE; /** - * @param int32_t command id - * @param CommandSource source - * @return return true if command can be create, else return false - **/ + * @param int32_t command id + * @param CommandSource source + * @return return true if command can be create, else return false + **/ virtual bool IsAbleToProcess( const int32_t, const application_manager::commands::Command::CommandSource) @@ -75,12 +74,18 @@ class RCCommandFactory : public application_manager::CommandFactory { private: app_mngr::CommandCreator& get_mobile_creator_factory( - mobile_apis::FunctionID::eType id, - mobile_apis::messageType::eType message_type) const; + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type, + const app_mngr::commands::Command::CommandSource source) const; + app_mngr::CommandCreator& get_mobile_command_creator( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type) const; + app_mngr::CommandCreator& get_mobile_notification_creator( + const mobile_apis::FunctionID::eType id) const; app_mngr::CommandCreator& get_hmi_creator_factory( - hmi_apis::FunctionID::eType id, - hmi_apis::messageType::eType message_type) const; + const hmi_apis::FunctionID::eType id, + const hmi_apis::messageType::eType message_type) const; RCCommandParams params_; }; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h index cf3c6cd5e4..e85ab758ad 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_helpers.h @@ -49,18 +49,18 @@ class RCRPCPlugin; class RCHelpers { public: /** - * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to - * actual module data filed name - * @return module mapping from enum naming to filed name - */ + * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to + * actual module data filed name + * @return module mapping from enum naming to filed name + */ static const std::function<std::string(const std::string& module_type)> GetModuleTypeToDataMapping(); /** - * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to - * actual module capabilities key - * @return module mapping from enum naming to capabilities key - */ + * @brief GetModuleTypeToDataMapping get mapping of module type enum naming to + * actual module capabilities key + * @return module mapping from enum naming to capabilities key + */ static const std::function<std::string(const std::string& module_type)> GetModuleTypeToCapabilitiesMapping(); @@ -87,10 +87,20 @@ class RCHelpers { const std::string& module_type); typedef std::map<application_manager::ApplicationSharedPtr, - std::vector<std::string> > AppsModules; + std::vector<std::string> > + AppsModules; static AppsModules GetApplicationsAllowedModules( application_manager::ApplicationManager& app_mngr); + + /** + * @brief RemoveRedundantGPSDataFromVIDataMsg removes redundant GPS data + * params from interior vehicle data response message if one contains radio + * station location data + * @param msg_params Params of the interior vehicle data response message + */ + static void RemoveRedundantGPSDataFromIVDataMsg( + smart_objects::SmartObject& msg_params); }; -} // rc_rpc_plugin +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_HELPERS_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h index 18014e6270..b9f922a1be 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_module_constants.h @@ -58,7 +58,7 @@ const char kRGBColorSpaceAvailable[] = "rgbColorSpaceAvailable"; // RadioControlCapabilities const char kSiriusxmRadioAvailable[] = "siriusxmRadioAvailable"; -} // strings +} // namespace strings namespace result_codes { const char kSuccess[] = "SUCCESS"; @@ -84,7 +84,7 @@ const char kWrongLanguage[] = "WRONG_LANGUAGE"; const char kGenericError[] = "GENERIC_ERROR"; const char kUserDisallowed[] = "USER_DISALLOWED"; const char kReadOnly[] = "READ_ONLY"; -} // result_codes +} // namespace result_codes namespace json_keys { const char kParams[] = "params"; @@ -100,7 +100,7 @@ const char kMessage[] = "message"; const char kData[] = "data"; const char kAppId[] = "appID"; const char kCode[] = "code"; -} // json_keys +} // namespace json_keys namespace message_params { const char kName[] = "name"; @@ -152,6 +152,7 @@ const char kBand[] = "band"; const char kRdsData[] = "rdsData"; const char kHdRadioEnable[] = "hdRadioEnable"; const char kAvailableHDs[] = "availableHDs"; +const char kAvailableHdChannels[] = "availableHdChannels"; const char kHdChannel[] = "hdChannel"; const char kSignalStrength[] = "signalStrength"; const char kSignalChangeThreshold[] = "signalChangeThreshold"; @@ -176,6 +177,8 @@ const char kHeatedSteeringWheelEnable[] = "heatedSteeringWheelEnable"; const char kHeatedWindshieldEnable[] = "heatedWindshieldEnable"; const char kHeatedRearWindowEnable[] = "heatedRearWindowEnable"; const char kHeatedMirrorsEnable[] = "heatedMirrorsEnable"; +const char kClimateEnable[] = "climateEnable"; +const char kClimateEnableAvailable[] = "climateEnableAvailable"; // ClimateControlData struct // LightControlData @@ -274,6 +277,6 @@ const char kAskDriver[] = "ASK_DRIVER"; } // namespace enums_value -} // namespace remote_control +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RC_MODULE_CONSTANTS_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h index ae88ed9cc0..303b31f857 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_rpc_plugin.h @@ -35,11 +35,11 @@ #include <memory> -#include "application_manager/plugin_manager/rpc_plugin.h" #include "application_manager/command_factory.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" +#include "application_manager/plugin_manager/rpc_plugin.h" #include "rc_rpc_plugin/interior_data_cache.h" #include "rc_rpc_plugin/interior_data_manager.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" namespace rc_rpc_plugin { namespace plugins = application_manager::plugin_manager; @@ -48,22 +48,22 @@ namespace app_mngr = application_manager; class RCRPCPlugin : public plugins::RPCPlugin { public: /** - * @brief Command initialization function - * @param app_manager ApplicationManager - * @param rpc_service RPCService - * @param hmi_capabilities HMICapabilities - * @param policy_handler PolicyHandlerInterface - * @return true in case initialization was succesful, false otherwise. - **/ + * @brief Command initialization function + * @param app_manager ApplicationManager + * @param rpc_service RPCService + * @param hmi_capabilities HMICapabilities + * @param policy_handler PolicyHandlerInterface + * @return true in case initialization was succesful, false otherwise. + **/ bool Init(app_mngr::ApplicationManager& app_manager, app_mngr::rpc_service::RPCService& rpc_service, app_mngr::HMICapabilities& hmi_capabilities, policy::PolicyHandlerInterface& policy_handler) OVERRIDE; /** - * @param int32_t command id - * @param CommandSource source - * @return return true if command can be create, else return false - **/ + * @param int32_t command id + * @param CommandSource source + * @return return true if command can be create, else return false + **/ bool IsAbleToProcess( const int32_t function_id, const app_mngr::commands::Command::CommandSource message_source) OVERRIDE; @@ -85,10 +85,10 @@ class RCRPCPlugin : public plugins::RPCPlugin { */ void OnPolicyEvent(app_mngr::plugin_manager::PolicyEvent event) OVERRIDE; /** - * @brief OnApplicationEvent Notifies modules on certain application events - * @param event Event - * @param application Pointer to application struct - */ + * @brief OnApplicationEvent Notifies modules on certain application events + * @param event Event + * @param application Pointer to application struct + */ void OnApplicationEvent(plugins::ApplicationEvent event, app_mngr::ApplicationSharedPtr application) OVERRIDE; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h index 67598b667b..6dfc794648 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h @@ -35,8 +35,8 @@ #include <string> #include "utils/macro.h" -#include "interfaces/HMI_API.h" #include "application_manager/plugin_manager/rpc_plugin.h" +#include "interfaces/HMI_API.h" #include "rc_rpc_plugin/rc_app_extension.h" namespace rc_rpc_plugin { @@ -66,7 +66,7 @@ namespace NotificationTrigger { * MODULE_ALLOCATION module allocation/deallocation event */ enum eType { APP_REGISTRATION = 0, MODULE_ALLOCATION, RC_STATE_CHANGING }; -} +} // namespace NotificationTrigger /** * @brief Resources defines list of resources diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h index b359ee4d29..c0ef971235 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager_impl.h @@ -32,11 +32,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_ -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "application_manager/application_impl.h" #include "rc_rpc_plugin/rc_app_extension.h" -#include "utils/macro.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" #include "utils/lock.h" +#include "utils/macro.h" namespace rc_rpc_plugin { @@ -67,12 +67,12 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager { const uint32_t app_id) FINAL; /** - * @brief SetResourceState changes resource state. Resource must be acquired - * beforehand. - * @param module_type Resource to change its state - * @param app_id Application aquired resource before - * @param state State to set for resource - */ + * @brief SetResourceState changes resource state. Resource must be acquired + * beforehand. + * @param module_type Resource to change its state + * @param app_id Application aquired resource before + * @param state State to set for resource + */ void SetResourceState(const std::string& module_type, const uint32_t app_id, const ResourceState::eType state) FINAL; @@ -219,6 +219,6 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager { application_manager::rpc_service::RPCService& rpc_service_; bool is_rc_enabled_; }; -} // rc_rpc_plugin +} // namespace rc_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_INCLUDE_RC_RPC_PLUGIN_RESOURCE_ALLOCATION_MANAGER_IMPL_H_ diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc index e56f9088bc..a366aa65fa 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_get_interior_vehicle_data_response.cc @@ -31,8 +31,8 @@ */ #include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h" -#include "rc_rpc_plugin/rc_module_constants.h" #include "application_manager/event_engine/event.h" +#include "rc_rpc_plugin/rc_module_constants.h" namespace rc_rpc_plugin { namespace commands { @@ -53,8 +53,9 @@ void RCGetInteriorVehicleDataResponse::Run() { app_mngr::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); - smart_objects::SmartObject& module_data = (*message_) - [application_manager::strings::msg_params][message_params::kModuleData]; + smart_objects::SmartObject& module_data = + (*message_)[application_manager::strings::msg_params] + [message_params::kModuleData]; if (module_data.keyExists(message_params::kAudioControlData)) { smart_objects::SmartObject& audio_control_data = module_data[message_params::kAudioControlData]; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc index 0117003f11..c6cf1b0d5a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_interior_vehicle_data_notification.cc @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include "rc_rpc_plugin/rc_module_constants.h" #include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h" +#include "rc_rpc_plugin/rc_module_constants.h" #include "utils/macro.h" namespace rc_rpc_plugin { @@ -54,8 +54,9 @@ void RCOnInteriorVehicleDataNotification::Run() { (*message_)[app_mngr::strings::params][app_mngr::strings::function_id] = static_cast<int>(mobile_apis::FunctionID::eType::OnInteriorVehicleDataID); - smart_objects::SmartObject& module_data = (*message_) - [application_manager::strings::msg_params][message_params::kModuleData]; + smart_objects::SmartObject& module_data = + (*message_)[application_manager::strings::msg_params] + [message_params::kModuleData]; if (module_data.keyExists(rc_rpc_plugin::message_params::kAudioControlData)) { smart_objects::SmartObject& audio_control_data = module_data[message_params::kAudioControlData]; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc index 91cb6cb7ee..643e98213c 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc @@ -31,10 +31,10 @@ */ #include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" #include "rc_rpc_plugin/interior_data_manager.h" -#include "rc_rpc_plugin/rc_module_constants.h" #include "rc_rpc_plugin/rc_helpers.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" #include "utils/macro.h" namespace rc_rpc_plugin { @@ -115,7 +115,8 @@ void RCOnRemoteControlSettingsNotification::Run() { message_params::kAccessMode)) { access_mode = static_cast<hmi_apis::Common_RCAccessMode::eType>( (*message_)[app_mngr::strings::msg_params] - [message_params::kAccessMode].asUInt()); + [message_params::kAccessMode] + .asUInt()); LOG4CXX_DEBUG( logger_, "Setting up access mode : " << AccessModeToString(access_mode)); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc index 5ce047071c..b85f092252 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/button_press_request.cc @@ -31,12 +31,12 @@ */ #include "rc_rpc_plugin/commands/mobile/button_press_request.h" +#include "interfaces/MOBILE_API.h" +#include "json/json.h" #include "rc_rpc_plugin/rc_module_constants.h" #include "smart_objects/enum_schema_item.h" -#include "utils/macro.h" -#include "json/json.h" #include "utils/helpers.h" -#include "interfaces/MOBILE_API.h" +#include "utils/macro.h" namespace rc_rpc_plugin { namespace commands { @@ -130,9 +130,9 @@ bool CheckIfButtonExistInRCCaps( const mobile_apis::ButtonName::eType current_button = static_cast<mobile_apis::ButtonName::eType>(current_id); if (current_button == button) { - LOG4CXX_TRACE(logger_, - "Button id " << current_button - << " exist in capabilities"); + LOG4CXX_TRACE( + logger_, + "Button id " << current_button << " exist in capabilities"); return true; } } @@ -177,7 +177,8 @@ void ButtonPressRequest::Execute() { EnumConversionHelper<mobile_apis::ButtonName::eType>::EnumToCString( static_cast<mobile_apis::ButtonName::eType>( (*message_)[app_mngr::strings::msg_params] - [message_params::kButtonName].asUInt()), + [message_params::kButtonName] + .asUInt()), &button_name); const std::string module_type = ModuleType(); @@ -276,10 +277,11 @@ void ButtonPressRequest::on_event(const app_mngr::event_engine::Event& event) { } std::string ButtonPressRequest::ModuleType() { - mobile_apis::ModuleType::eType module_type = static_cast< - mobile_apis::ModuleType::eType>( - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] - .asUInt()); + mobile_apis::ModuleType::eType module_type = + static_cast<mobile_apis::ModuleType::eType>( + (*message_)[app_mngr::strings::msg_params] + [message_params::kModuleType] + .asUInt()); const char* str; const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper< mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc index 4d12b4f375..ded96461f5 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_request.cc @@ -31,12 +31,12 @@ */ #include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h" -#include "rc_rpc_plugin/rc_module_constants.h" +#include "interfaces/MOBILE_API.h" #include "rc_rpc_plugin/rc_helpers.h" +#include "rc_rpc_plugin/rc_module_constants.h" #include "rc_rpc_plugin/rc_rpc_plugin.h" #include "smart_objects/enum_schema_item.h" #include "utils/macro.h" -#include "interfaces/MOBILE_API.h" namespace rc_rpc_plugin { namespace commands { @@ -109,6 +109,7 @@ void GetInteriorVehicleDataRequest::FilterDisabledModuleData( module_data[message_params::kHdRadioEnable].asBool() == false) { module_data.erase(message_params::kHdChannel); module_data.erase(message_params::kAvailableHDs); + module_data.erase(message_params::kAvailableHdChannels); module_data.erase(message_params::kSisData); } } @@ -297,7 +298,8 @@ void GetInteriorVehicleDataRequest::ProccessSubscription( static_cast<mobile_apis::ModuleType::eType>( hmi_response[app_mngr::strings::msg_params] [message_params::kModuleData] - [message_params::kModuleType].asUInt()), + [message_params::kModuleType] + .asUInt()), &module_type); if (excessive_subscription_occured_) { is_subscribed = extension->IsSubscibedToInteriorVehicleData(module_type); @@ -390,10 +392,11 @@ void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription() { } std::string GetInteriorVehicleDataRequest::ModuleType() { - mobile_apis::ModuleType::eType module_type = static_cast< - mobile_apis::ModuleType::eType>( - (*message_)[app_mngr::strings::msg_params][message_params::kModuleType] - .asUInt()); + mobile_apis::ModuleType::eType module_type = + static_cast<mobile_apis::ModuleType::eType>( + (*message_)[app_mngr::strings::msg_params] + [message_params::kModuleType] + .asUInt()); const char* str; const bool ok = ns_smart_device_link::ns_smart_objects::EnumConversionHelper< mobile_apis::ModuleType::eType>::EnumToCString(module_type, &str); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc index a7572f1d62..b1fa8d6ea0 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/get_interior_vehicle_data_response.cc @@ -31,6 +31,7 @@ */ #include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h" +#include "rc_rpc_plugin/rc_helpers.h" #include "utils/macro.h" namespace rc_rpc_plugin { @@ -49,6 +50,9 @@ GetInteriorVehicleDataResponse::~GetInteriorVehicleDataResponse() {} void GetInteriorVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); + + RCHelpers::RemoveRedundantGPSDataFromIVDataMsg( + (*message_)[app_mngr::strings::msg_params]); application_manager_.GetRPCService().SendMessageToMobile(message_); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc index 37890b7979..06b5218bb3 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc @@ -31,9 +31,9 @@ */ #include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" #include "rc_rpc_plugin/rc_helpers.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" #include "smart_objects/enum_schema_item.h" #include "utils/macro.h" @@ -75,6 +75,8 @@ void OnInteriorVehicleDataNotification::Run() { typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs; AppPtrs apps = RCRPCPlugin::GetRCApplications(application_manager_); + RCHelpers::RemoveRedundantGPSDataFromIVDataMsg( + (*message_)[app_mngr::strings::msg_params]); for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) { DCHECK(*it); application_manager::Application& app = **it; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc index edc45670ce..44d302276d 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc @@ -31,14 +31,14 @@ */ #include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h" +#include "interfaces/MOBILE_API.h" +#include "json/json.h" +#include "rc_rpc_plugin/rc_helpers.h" #include "rc_rpc_plugin/rc_module_constants.h" #include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_helpers.h" #include "smart_objects/enum_schema_item.h" -#include "utils/macro.h" -#include "json/json.h" #include "utils/helpers.h" -#include "interfaces/MOBILE_API.h" +#include "utils/macro.h" namespace rc_rpc_plugin { namespace commands { @@ -55,6 +55,7 @@ std::vector<std::string> GetModuleReadOnlyParams( } else if (enums_value::kRadio == module_type) { module_ro_params.push_back(kRdsData); module_ro_params.push_back(kAvailableHDs); + module_ro_params.push_back(kAvailableHdChannels); module_ro_params.push_back(kSignalStrength); module_ro_params.push_back(kSignalChangeThreshold); module_ro_params.push_back(kState); @@ -92,6 +93,8 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() { mapping["heatedWindshieldEnable"] = "heatedWindshieldAvailable"; mapping["heatedMirrorsEnable"] = "heatedMirrorsAvailable"; mapping["heatedRearWindowEnable"] = "heatedRearWindowAvailable"; + mapping["climateEnable"] = "climateEnableAvailable"; + mapping["climateEnableAvailable"] = "climateEnableAvailable"; // radio mapping["band"] = "radioBandAvailable"; @@ -99,7 +102,8 @@ const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() { mapping["frequencyFraction"] = "radioFrequencyAvailable"; mapping["rdsData"] = "rdsDataAvailable"; mapping["availableHDs"] = "availableHDsAvailable"; - mapping["hdChannel"] = "availableHDsAvailable"; + mapping["availableHdChannels"] = "availableHdChannelsAvailable"; + mapping["hdChannel"] = "availableHdChannelsAvailable"; mapping["hdRadioEnable"] = "hdRadioEnableAvailable"; mapping["signalStrength"] = "signalStrengthAvailable"; mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable"; @@ -175,9 +179,9 @@ capabilitiesStatus GetItemCapability( const auto it = mapping.find(request_parameter); if (it == mapping.end()) { - LOG4CXX_DEBUG(logger_, - "Parameter " << request_parameter - << " doesn't exist in capabilities."); + LOG4CXX_DEBUG( + logger_, + "Parameter " << request_parameter << " doesn't exist in capabilities."); return capabilitiesStatus::missedParam; } @@ -525,9 +529,9 @@ void SetInteriorVehicleDataRequest::Execute() { return; } else if (module_data[message_params::kAudioControlData].keyExists( message_params::kKeepContext)) { - app->set_keep_context( - module_data[message_params::kAudioControlData] - [message_params::kKeepContext].asBool()); + app->set_keep_context(module_data[message_params::kAudioControlData] + [message_params::kKeepContext] + .asBool()); } } @@ -716,21 +720,6 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams( const smart_objects::SmartObject& module_type_params = ControlData(module_data); const std::string module_type = ModuleType(); - std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type); - - for (auto& it : ro_params) { - if (module_type_params.keyExists(it)) { - if (enums_value::kClimate == module_type) { - module_data[message_params::kClimateControlData].erase(it); - } else if (enums_value::kRadio == module_type) { - module_data[message_params::kRadioControlData].erase(it); - } else { - continue; - } - - LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << it); - } - } if (enums_value::kAudio == module_type) { auto& equalizer_settings = module_data[message_params::kAudioControlData] @@ -745,6 +734,15 @@ void SetInteriorVehicleDataRequest::CutOffReadOnlyParams( } } } + + std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type); + const auto& data_mapping = RCHelpers::GetModuleTypeToDataMapping(); + for (const auto& param : ro_params) { + if (module_type_params.keyExists(param)) { + module_data[data_mapping(module_type)].erase(param); + LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << param); + } + } } std::string SetInteriorVehicleDataRequest::ModuleType() { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc index c24529d720..065425dd02 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc @@ -31,11 +31,11 @@ */ #include "rc_rpc_plugin/commands/rc_command_request.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "application_manager/message_helper.h" #include "application_manager/hmi_interfaces.h" -#include "smart_objects/enum_schema_item.h" +#include "application_manager/message_helper.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "smart_objects/enum_schema_item.h" CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") @@ -264,5 +264,5 @@ void RCCommandRequest::SendGetUserConsent(const std::string& module_type) { &msg_params, true); } -} -} +} // namespace commands +} // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc index 780aab537b..2c8683f84a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_cache_impl.cc @@ -30,10 +30,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "rc_rpc_plugin/interior_data_cache_impl.h" +#include <chrono> #include <iostream> #include <thread> -#include <chrono> -#include "rc_rpc_plugin/interior_data_cache_impl.h" #include "application_manager/smart_object_keys.h" #include "utils/date_time.h" #include "utils/logger.h" @@ -110,17 +110,16 @@ smart_objects::SmartObject MergeArray(const smart_objects::SmartObject& data1, smart_objects::SmartArray* result_array = result.asArray(); smart_objects::SmartArray* data_array = data2.asArray(); auto data_it = data_array->begin(); - auto find_by_id = - [](smart_objects::SmartArray* array, const smart_objects::SmartObject& id) - -> smart_objects::SmartArray::iterator { - auto it = std::find_if( - array->begin(), - array->end(), - [&id](smart_objects::SmartObject& obj) -> bool { - return obj[application_manager::strings::id] == id; - }); - return it; - }; + auto find_by_id = [](smart_objects::SmartArray* array, + const smart_objects::SmartObject& id) + -> smart_objects::SmartArray::iterator { + auto it = std::find_if(array->begin(), + array->end(), + [&id](smart_objects::SmartObject& obj) -> bool { + return obj[application_manager::strings::id] == id; + }); + return it; + }; for (; data_it != data_array->end(); ++data_it) { const smart_objects::SmartObject element_id = @@ -167,9 +166,9 @@ bool InteriorDataCacheImpl::Contains(const std::string& module_type) const { sync_primitives::AutoLock autolock(cached_data_lock_); auto it = cached_data_.find(module_type); const bool contains = it != cached_data_.end(); - LOG4CXX_TRACE(logger_, - "module_type : " << module_type << " " - << (contains ? "true" : "false")); + LOG4CXX_TRACE( + logger_, + "module_type : " << module_type << " " << (contains ? "true" : "false")); return contains; } @@ -189,4 +188,4 @@ void InteriorDataCacheImpl::Clear() { sync_primitives::AutoLock autolock(cached_data_lock_); cached_data_.clear(); } -} +} // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc index 0c42f6e3de..cb800a6081 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/interior_data_manager_impl.cc @@ -1,8 +1,8 @@ #include "rc_rpc_plugin/interior_data_manager_impl.h" -#include "rc_rpc_plugin/rc_helpers.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" +#include "rc_rpc_plugin/rc_helpers.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" namespace rc_rpc_plugin { CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc index ecfc1dcda4..93c230dfc3 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc @@ -31,36 +31,36 @@ */ #include <iostream> -#include "rc_rpc_plugin/rc_command_factory.h" -#include "rc_rpc_plugin/commands/mobile/button_press_request.h" -#include "rc_rpc_plugin/commands/mobile/button_press_response.h" -#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h" -#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h" -#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h" -#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h" -#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h" -#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h" -#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h" #include "rc_rpc_plugin/commands/hmi/rc_button_press_request.h" #include "rc_rpc_plugin/commands/hmi/rc_button_press_response.h" +#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h" +#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h" #include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_request.h" #include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_response.h" #include "rc_rpc_plugin/commands/hmi/rc_on_interior_vehicle_data_notification.h" #include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h" #include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_request.h" #include "rc_rpc_plugin/commands/hmi/rc_set_interior_vehicle_data_response.h" +#include "rc_rpc_plugin/commands/mobile/button_press_request.h" +#include "rc_rpc_plugin/commands/mobile/button_press_response.h" +#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h" +#include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_response.h" +#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h" +#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h" +#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_response.h" +#include "rc_rpc_plugin/rc_command_factory.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" -#include "rc_rpc_plugin/resource_allocation_manager.h" #include "rc_rpc_plugin/interior_data_cache.h" +#include "rc_rpc_plugin/resource_allocation_manager.h" CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") namespace application_manager { -using rc_rpc_plugin::ResourceAllocationManager; using rc_rpc_plugin::InteriorDataCache; using rc_rpc_plugin::RCCommandParams; +using rc_rpc_plugin::ResourceAllocationManager; template <typename RCCommandType> class RCCommandCreator : public CommandCreator { @@ -113,7 +113,7 @@ struct RCCommandCreatorFactory { } const RCCommandParams params_; }; -} +} // namespace application_manager namespace rc_rpc_plugin { using namespace application_manager; @@ -124,7 +124,8 @@ RCCommandFactory::RCCommandFactory(const RCCommandParams& params) CommandSharedPtr RCCommandFactory::CreateCommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { - if (app_mngr::commands::Command::SOURCE_HMI == source) { + if (app_mngr::commands::Command::SOURCE_HMI == source || + app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) { hmi_apis::messageType::eType message_type = static_cast<hmi_apis::messageType::eType>( (*message)[strings::params][strings::message_type].asInt()); @@ -143,7 +144,7 @@ CommandSharedPtr RCCommandFactory::CreateCommand( static_cast<mobile_apis::FunctionID::eType>( (*message)[strings::params][strings::function_id].asInt()); - return get_mobile_creator_factory(function_id, message_type) + return get_mobile_creator_factory(function_id, message_type, source) .create(message); } } @@ -153,56 +154,98 @@ bool RCCommandFactory::IsAbleToProcess( const application_manager::commands::Command::CommandSource message_source) const { using app_mngr::commands::Command; - if (Command::SOURCE_HMI == message_source) { + if (Command::SOURCE_HMI == message_source || + Command::SOURCE_SDL_TO_HMI == message_source) { return get_hmi_creator_factory( static_cast<hmi_apis::FunctionID::eType>(function_id), - hmi_apis::messageType::INVALID_ENUM).CanBeCreated(); + hmi_apis::messageType::INVALID_ENUM) + .CanBeCreated(); } else { - return get_mobile_creator_factory( - static_cast<mobile_api::FunctionID::eType>(function_id), - mobile_api::messageType::INVALID_ENUM).CanBeCreated(); + auto id = static_cast<mobile_apis::FunctionID::eType>(function_id); + return get_mobile_command_creator(id, + mobile_apis::messageType::INVALID_ENUM) + .CanBeCreated() || + get_mobile_notification_creator(id).CanBeCreated(); } } -CommandCreator& RCCommandFactory::get_mobile_creator_factory( - mobile_api::FunctionID::eType id, - mobile_api::messageType::eType message_type) const { +CommandCreator& RCCommandFactory::get_mobile_command_creator( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type) const { LOG4CXX_DEBUG(logger_, - "CreateMobileCommand function_id: " << id << " message_type: " - << message_type); + "get_mobile_command_creator function_id: " + << id << " message_type: " << message_type); RCCommandCreatorFactory rc_factory(params_); - switch (id) { case mobile_apis::FunctionID::ButtonPressID: { - return mobile_api::messageType::request == message_type + return mobile_apis::messageType::request == message_type ? rc_factory.GetCreator<commands::ButtonPressRequest>() : rc_factory.GetCreator<commands::ButtonPressResponse>(); } case mobile_apis::FunctionID::GetInteriorVehicleDataID: { - return mobile_api::messageType::request == message_type + return mobile_apis::messageType::request == message_type ? rc_factory .GetCreator<commands::GetInteriorVehicleDataRequest>() : rc_factory .GetCreator<commands::GetInteriorVehicleDataResponse>(); } case mobile_apis::FunctionID::SetInteriorVehicleDataID: { - return mobile_api::messageType::request == message_type + return mobile_apis::messageType::request == message_type ? rc_factory .GetCreator<commands::SetInteriorVehicleDataRequest>() : rc_factory .GetCreator<commands::SetInteriorVehicleDataResponse>(); } + default: {} + } + return rc_factory.GetCreator<RCInvalidCommand>(); +} + +CommandCreator& RCCommandFactory::get_mobile_notification_creator( + const mobile_apis::FunctionID::eType id) const { + RCCommandCreatorFactory rc_factory(params_); + switch (id) { case mobile_apis::FunctionID::OnInteriorVehicleDataID: { return rc_factory .GetCreator<commands::OnInteriorVehicleDataNotification>(); } - default: { return rc_factory.GetCreator<RCInvalidCommand>(); } + default: {} } + return rc_factory.GetCreator<RCInvalidCommand>(); +} + +CommandCreator& RCCommandFactory::get_mobile_creator_factory( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type, + const app_mngr::commands::Command::CommandSource source) const { + RCCommandCreatorFactory rc_factory(params_); + switch (message_type) { + case mobile_apis::messageType::request: { + if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) { + return get_mobile_command_creator(id, message_type); + } + break; + } + case mobile_apis::messageType::response: { + if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) { + return get_mobile_command_creator(id, message_type); + } + break; + } + case mobile_apis::messageType::notification: { + if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) { + return get_mobile_notification_creator(id); + } + break; + } + default: {} + } + return rc_factory.GetCreator<RCInvalidCommand>(); } CommandCreator& RCCommandFactory::get_hmi_creator_factory( - hmi_apis::FunctionID::eType id, - hmi_apis::messageType::eType message_type) const { + const hmi_apis::FunctionID::eType id, + const hmi_apis::messageType::eType message_type) const { LOG4CXX_DEBUG(logger_, "CreateHMICommand function_id: " << id << " message_type: " << message_type); @@ -247,4 +290,4 @@ CommandCreator& RCCommandFactory::get_hmi_creator_factory( default: { return rc_factory.GetCreator<RCInvalidCommand>(); } } } -} +} // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc index 0bdec55733..5785e58e5b 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_helpers.cc @@ -1,9 +1,9 @@ #include "rc_rpc_plugin/rc_helpers.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_impl.h" #include "application_manager/message.h" +#include "application_manager/smart_object_keys.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" namespace rc_rpc_plugin { CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); @@ -115,4 +115,30 @@ RCHelpers::AppsModules RCHelpers::GetApplicationsAllowedModules( } return result; } + +void RCHelpers::RemoveRedundantGPSDataFromIVDataMsg( + smart_objects::SmartObject& msg_params) { + using namespace message_params; + using namespace application_manager::strings; + + LOG4CXX_AUTO_TRACE(logger_); + auto& module_data = msg_params[kModuleData]; + if (!module_data.keyExists(kRadioControlData) || + !module_data[kRadioControlData].keyExists(kSisData) || + !module_data[kRadioControlData][kSisData].keyExists(station_location)) { + return; + } + + auto& location_data = + module_data[kRadioControlData][kSisData][station_location]; + auto new_location_data = + smart_objects::SmartObject(smart_objects::SmartType_Map); + new_location_data[latitude_degrees] = location_data[latitude_degrees]; + new_location_data[longitude_degrees] = location_data[longitude_degrees]; + if (location_data.keyExists(altitude)) { + new_location_data[altitude] = location_data[altitude]; + + location_data = new_location_data; + } } +} // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc index fd6b4e86ac..026e03eeff 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc @@ -29,16 +29,16 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_command_factory.h" -#include "rc_rpc_plugin/rc_app_extension.h" -#include "rc_rpc_plugin/resource_allocation_manager_impl.h" +#include <memory> +#include "application_manager/plugin_manager/plugin_keys.h" #include "rc_rpc_plugin/interior_data_cache_impl.h" #include "rc_rpc_plugin/interior_data_manager_impl.h" +#include "rc_rpc_plugin/rc_app_extension.h" +#include "rc_rpc_plugin/rc_command_factory.h" #include "rc_rpc_plugin/rc_helpers.h" +#include "rc_rpc_plugin/resource_allocation_manager_impl.h" #include "utils/helpers.h" -#include <memory> namespace rc_rpc_plugin { CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule"); @@ -77,7 +77,7 @@ bool RCRPCPlugin::IsAbleToProcess( } std::string RCRPCPlugin::PluginName() { - return "RC RPC Plugin"; + return plugins::plugin_names::rc_rpc_plugin; } application_manager::CommandFactory& RCRPCPlugin::GetCommandFactory() { @@ -121,8 +121,8 @@ void RCRPCPlugin::OnApplicationEvent( RCRPCPlugin::Apps RCRPCPlugin::GetRCApplications( application_manager::ApplicationManager& app_mngr) { - using application_manager::ApplicationSharedPtr; using application_manager::ApplicationSet; + using application_manager::ApplicationSharedPtr; ApplicationSet accessor = app_mngr.applications().GetData(); std::vector<ApplicationSharedPtr> result; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc index ecd263b77a..cf1df2cb68 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc @@ -33,14 +33,14 @@ #include "rc_rpc_plugin/resource_allocation_manager_impl.h" #include "application_manager/application.h" #include "application_manager/application_manager.h" +#include "application_manager/message_helper.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" -#include "smart_objects/enum_schema_item.h" -#include "application_manager/message_helper.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/rc_helpers.h" #include "json/json.h" +#include "rc_rpc_plugin/rc_helpers.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" +#include "smart_objects/enum_schema_item.h" #include "utils/helpers.h" namespace rc_rpc_plugin { @@ -80,16 +80,16 @@ AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( } if (app_id == allocated_resources_[module_type]) { - LOG4CXX_DEBUG(logger_, - "App: " << app_id << " is already acquired resource " - << module_type); + LOG4CXX_DEBUG( + logger_, + "App: " << app_id << " is already acquired resource " << module_type); return AcquireResult::ALLOWED; } if (IsModuleTypeRejected(module_type, app_id)) { - LOG4CXX_DEBUG(logger_, - "Driver disallowed app: " << app_id << " to acquire " - << module_type); + LOG4CXX_DEBUG( + logger_, + "Driver disallowed app: " << app_id << " to acquire " << module_type); return AcquireResult::REJECTED; } @@ -196,8 +196,8 @@ void ConstructOnRCStatusNotificationParams( namespace strings = application_manager::strings; namespace message_params = rc_rpc_plugin::message_params; using smart_objects::SmartObject; - using smart_objects::SmartType_Map; using smart_objects::SmartType_Array; + using smart_objects::SmartType_Map; LOG4CXX_AUTO_TRACE(logger_); auto modules_inserter = [](SmartObject& result_modules) { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc index 59d038a790..f2b86f43da 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc @@ -30,22 +30,26 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "rc_rpc_plugin/commands/mobile/button_press_request.h" -#include "rc_rpc_plugin/rc_command_factory.h" -#include "rc_rpc_plugin/rc_app_extension.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" -#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" -#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "gtest/gtest.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" +#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" +#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" +#include "rc_rpc_plugin/rc_app_extension.h" +#include "rc_rpc_plugin/rc_command_factory.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" +using ::application_manager::Message; +using ::application_manager::MessageType; +using application_manager::commands::MessageSharedPtr; +using ::protocol_handler::MessagePriority; using test::components::application_manager_test::MockApplication; using test::components::commands_test::CommandRequestTest; using test::components::commands_test::CommandsTestMocks; @@ -57,17 +61,13 @@ using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; using ::testing::SaveArg; -using ::application_manager::Message; -using ::application_manager::MessageType; -using application_manager::commands::MessageSharedPtr; -using ::protocol_handler::MessagePriority; namespace { const int kModuleId = 153u; const uint32_t kConnectionKey = 1u; const uint32_t kAppId = 0u; const std::string kPolicyAppId = "Test"; -} +} // namespace namespace rc_rpc_plugin_test { @@ -129,7 +129,8 @@ class ButtonPressRequestTest ON_CALL(mock_policy_handler_, CheckHMIType(kPolicyAppId, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, - nullptr)).WillByDefault(Return(true)); + nullptr)) + .WillByDefault(Return(true)); ON_CALL(mock_allocation_manager_, is_rc_enabled()) .WillByDefault(Return(true)); } @@ -194,9 +195,10 @@ TEST_F(ButtonPressRequestTest, EXPECT_CALL( mock_allocation_manager_, SetResourceState(resource, kAppId, rc_rpc_plugin::ResourceState::BUSY)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress), _)) .WillOnce(Return(true)); // Act @@ -229,9 +231,11 @@ TEST_F( EXPECT_CALL(mock_allocation_manager_, SetResourceState(resource, kAppId, _)) .Times(2); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Buttons_ButtonPress))).Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_ButtonPress), _)) + .Times(0); MessageSharedPtr command_result; EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc index 25dad2dc04..123c22b944 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Ford Motor Company + * Copyright (c) 2019, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,42 +31,43 @@ */ #include "rc_rpc_plugin/commands/mobile/get_interior_vehicle_data_request.h" -#include "gtest/gtest.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event_dispatcher.h" +#include "application_manager/message_helper.h" #include "application_manager/mock_application.h" +#include "gtest/gtest.h" +#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" +#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" #include "rc_rpc_plugin/rc_app_extension.h" +#include "rc_rpc_plugin/rc_command_factory.h" #include "rc_rpc_plugin/rc_module_constants.h" #include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "application_manager/message_helper.h" -#include "rc_rpc_plugin/rc_command_factory.h" -#include "application_manager/event_engine/event_dispatcher.h" -#include "application_manager/commands/command_request_test.h" -#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" -#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" -#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" -#include <thread> +#include <stdint.h> #include <chrono> +#include <thread> -using ::testing::_; -using ::testing::Mock; -using ::testing::NiceMock; -using ::testing::StrictMock; -using ::testing::Return; -using ::testing::ReturnRef; -using ::testing::SaveArg; +using application_manager::ApplicationSet; +using ::application_manager::ApplicationSharedPtr; using ::application_manager::Message; using ::application_manager::MessageType; -using application_manager::ApplicationSet; using application_manager::commands::MessageSharedPtr; -using ::application_manager::ApplicationSharedPtr; using ::protocol_handler::MessagePriority; using test::components::application_manager_test::MockApplication; using test::components::application_manager_test::MockApplicationManager; -using test::components::commands_test::MockApplicationManager; using test::components::commands_test::CommandRequestTest; using test::components::commands_test::CommandsTestMocks; using test::components::commands_test::HMIResultCodeIs; using test::components::commands_test::MobileResultCodeIs; +using test::components::commands_test::MockApplicationManager; +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; +using ::testing::StrictMock; namespace { const int32_t kConnectionKey = 5u; @@ -76,7 +77,7 @@ const int kModuleId = 153u; const auto module_type = mobile_apis::ModuleType::RADIO; const int32_t time_frame_of_allowed_requests = 1; const uint32_t max_request_in_time_frame = 5u; -} +} // namespace namespace rc_rpc_plugin_test { @@ -193,17 +194,20 @@ TEST_F(GetInteriorVehicleDataRequestTest, .WillByDefault(Return(false)); ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_)) .WillByDefault(Return(true)); - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); // Expectations - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _)) .WillOnce(Return(true)); // Act + + ASSERT_TRUE(command->Init()); command->Run(); } @@ -219,17 +223,19 @@ TEST_F(GetInteriorVehicleDataRequestTest, .WillByDefault(Return(false)); ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_)) .WillByDefault(Return(true)); - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); // Expectations - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _)) .WillOnce(Return(true)); // Act + ASSERT_TRUE(command->Init()); command->Run(); } @@ -242,10 +248,22 @@ TEST_F( (*mobile_message)[application_manager::strings::msg_params] [message_params::kModuleType] = module_type; smart_objects::SmartObject radio_data; + smart_objects::SmartObject sis_data; + smart_objects::SmartObject gps_data; + + gps_data[application_manager::strings::longitude_degrees] = 1.0; + gps_data[application_manager::strings::latitude_degrees] = 1.0; + + sis_data[application_manager::strings::station_short_name] = + "dummy_short_name"; + sis_data[application_manager::strings::station_location] = gps_data; + radio_data[message_params::kBand] = enums_value::kAM; - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + radio_data[message_params::kSisData] = sis_data; + + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); // Expectations @@ -253,7 +271,7 @@ TEST_F( .WillOnce(Return(true)); EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio)) .WillOnce(Return(radio_data)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); MessageSharedPtr command_result; EXPECT_CALL( mock_rpc_service_, @@ -261,6 +279,7 @@ TEST_F( .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); // Act + ASSERT_TRUE(command->Init()); command->Run(); // Assert @@ -295,9 +314,10 @@ TEST_F( .WillByDefault(Return(true)); // Expectations - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _)) .WillOnce(Return(true)); EXPECT_CALL( mock_rpc_service_, @@ -307,10 +327,11 @@ TEST_F( EXPECT_CALL(mock_interior_data_cache_, Remove(enums_value::kRadio)); // Act - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); + ASSERT_TRUE(command->Init()); command->Run(); application_manager::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); @@ -336,9 +357,9 @@ TEST_F(GetInteriorVehicleDataRequestTest, radio_data[message_params::kBand] = enums_value::kAM; ON_CALL(app_mngr_, applications()).WillByDefault(Return(apps_da_)); - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); // Expectations @@ -347,7 +368,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, EXPECT_CALL(mock_interior_data_cache_, Retrieve(enums_value::kRadio)) .WillOnce(Return(radio_data)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); MessageSharedPtr command_result; EXPECT_CALL( mock_rpc_service_, @@ -355,6 +376,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); // Act + ASSERT_TRUE(command->Init()); command->Run(); // Assert @@ -374,21 +396,23 @@ TEST_F( ns_smart_device_link::ns_smart_objects::SmartObject& msg_params = (*mobile_message)[application_manager::strings::msg_params]; msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO; - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); smart_objects::SmartObject rc_capabilities; ON_CALL(mock_hmi_capabilities_, rc_capability()) .WillByDefault(Return(&rc_capabilities)); // Expectations - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); - EXPECT_CALL(mock_rpc_service_, - ManageMobileCommand( - MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), - _)).WillOnce((Return(true))); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageMobileCommand( + MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _)) + .WillOnce((Return(true))); // Act + ASSERT_TRUE(command->Init()); command->Run(); } @@ -400,20 +424,21 @@ TEST_F( ns_smart_device_link::ns_smart_objects::SmartObject& msg_params = (*mobile_message)[application_manager::strings::msg_params]; msg_params[message_params::kModuleType] = mobile_apis::ModuleType::RADIO; - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); ON_CALL(mock_policy_handler_, CheckModule(_, _)).WillByDefault(Return(false)); // Expectations - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::DISALLOWED), _)) .WillOnce((Return(true))); // Act + ASSERT_TRUE(command->Init()); command->Run(); } @@ -443,9 +468,10 @@ TEST_F(GetInteriorVehicleDataRequestTest, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _)) .WillOnce(Return(true)); // Act @@ -453,6 +479,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, application_manager::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); event.set_smart_object(*hmi_response_message); + ASSERT_TRUE(command->Init()); command->Run(); command->on_event(event); } @@ -478,9 +505,10 @@ TEST_F(GetInteriorVehicleDataRequestTest, .WillByDefault(Return(true)); // Expectations - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _)) .WillOnce(Return(true)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( @@ -492,6 +520,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, hmi_apis::FunctionID::RC_GetInteriorVehicleData); event.set_smart_object(*hmi_message); auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message); + ASSERT_TRUE(command->Init()); command->Run(); command->on_event(event); } @@ -519,9 +548,10 @@ TEST_F(GetInteriorVehicleDataRequestTest, .WillByDefault(Return(true)); // Expectations - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), _)) .WillOnce(Return(true)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( @@ -531,10 +561,11 @@ TEST_F(GetInteriorVehicleDataRequestTest, EXPECT_CALL(mock_interior_data_cache_, Clear()).Times(0); // Act - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); + ASSERT_TRUE(command->Init()); command->Run(); application_manager::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); @@ -555,9 +586,9 @@ TEST_F(GetInteriorVehicleDataRequestTest, [message_params::kModuleType] = module_type; smart_objects::SmartObject radio_data; radio_data[message_params::kBand] = enums_value::kAM; - std::shared_ptr< - rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( mobile_message); size_t i = 0; for (; i <= max_request_in_time_frame; ++i) { @@ -569,11 +600,14 @@ TEST_F(GetInteriorVehicleDataRequestTest, StoreRequestToHMITime(enums_value::kRadio)); EXPECT_CALL(mock_interior_data_cache_, Contains(enums_value::kRadio)) .WillRepeatedly(Return(false)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::RC_GetInteriorVehicleData))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_GetInteriorVehicleData), + _)) .WillRepeatedly(Return(true)); // Act + ASSERT_TRUE(command->Init()); command->Run(); } @@ -585,9 +619,133 @@ TEST_F(GetInteriorVehicleDataRequestTest, mock_rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED), _)) .WillOnce(Return(false)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); // Act + ASSERT_TRUE(command->Init()); command->Run(); } + +TEST_F(GetInteriorVehicleDataRequestTest, + OnEvent_ValidHmiResponse_AvailableHDChanelsIsArrayWithHDChanels) { + using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest; + namespace hmi_response = application_manager::hmi_response; + namespace strings = application_manager::strings; + + const uint32_t chanel1_index = 1u; + const uint32_t chanel2_index = 2u; + const uint32_t chanel3_index = 3u; + + const uint32_t expected_array_length = 3u; + + // Arrange + MessageSharedPtr mobile_message = CreateBasicMessage(); + + MessageSharedPtr hmi_response_message = CreateBasicMessage(); + auto& hmi_response_params = (*hmi_response_message)[strings::msg_params]; + hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS; + hmi_response_params[strings::connection_key] = kAppId; + + auto& msg_params = (*hmi_response_message)[strings::msg_params]; + msg_params[message_params::kModuleType] = module_type; + + auto available_hd_chanels = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + available_hd_chanels[0] = chanel1_index; + available_hd_chanels[1] = chanel2_index; + available_hd_chanels[2] = chanel3_index; + + msg_params[message_params::kModuleData][message_params::kRadioControlData] + [message_params::kAvailableHdChannels] = available_hd_chanels; + + ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false)); + ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_)) + .WillByDefault(Return(true)); + + MessageSharedPtr message_to_mob = CreateBasicMessage(); + + // Expectations + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&message_to_mob), Return(true))); + + // Act + auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message); + application_manager::event_engine::Event event( + hmi_apis::FunctionID::RC_GetInteriorVehicleData); + + ASSERT_TRUE(command->Init()); + command->Run(); + + event.set_smart_object(*hmi_response_message); + command->on_event(event); + + auto& hd_chanels = + (*message_to_mob)[strings::msg_params][message_params::kModuleData] + [message_params::kRadioControlData] + [message_params::kAvailableHdChannels]; + const size_t array_length = hd_chanels.length(); + + EXPECT_EQ(expected_array_length, array_length); + + EXPECT_EQ(chanel1_index, hd_chanels[0].asUInt()); + EXPECT_EQ(chanel2_index, hd_chanels[1].asUInt()); + EXPECT_EQ(chanel3_index, hd_chanels[2].asUInt()); +} + +TEST_F(GetInteriorVehicleDataRequestTest, + OnEvent_ValidHmiResponse_ClimateEnableAvailable) { + using rc_rpc_plugin::commands::GetInteriorVehicleDataRequest; + namespace hmi_response = application_manager::hmi_response; + namespace strings = application_manager::strings; + + // Arrange + MessageSharedPtr mobile_message = CreateBasicMessage(); + + MessageSharedPtr hmi_response_message = CreateBasicMessage(); + auto& hmi_response_params = (*hmi_response_message)[strings::msg_params]; + hmi_response_params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS; + hmi_response_params[strings::connection_key] = kAppId; + + auto& msg_params = (*hmi_response_message)[strings::msg_params]; + + auto climate_control_data = + smart_objects::SmartObject(smart_objects::SmartType_Boolean); + climate_control_data = true; + + msg_params[message_params::kModuleData][message_params::kClimateControlData] + [message_params::kClimateEnableAvailable] = climate_control_data; + + ON_CALL(mock_interior_data_cache_, Contains(_)).WillByDefault(Return(false)); + ON_CALL(mock_interior_data_manager_, CheckRequestsToHMIFrequency(_)) + .WillByDefault(Return(true)); + + auto message_to_mob = CreateBasicMessage(); + + // Expectations + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&message_to_mob), Return(true))); + + // Act + auto command = CreateRCCommand<GetInteriorVehicleDataRequest>(mobile_message); + application_manager::event_engine::Event event( + hmi_apis::FunctionID::RC_GetInteriorVehicleData); + + ASSERT_TRUE(command->Init()); + command->Run(); + + event.set_smart_object(*hmi_response_message); + command->on_event(event); + + const bool climate_enable_available = + (*message_to_mob)[strings::msg_params][message_params::kModuleData] + [message_params::kClimateControlData] + [message_params::kClimateEnableAvailable] + .asBool(); + + EXPECT_TRUE(climate_enable_available); +} + } // namespace rc_rpc_plugin_test diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc index b344471254..dcf36a34a0 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc @@ -30,36 +30,36 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h" #include "application_manager/application.h" -#include "application_manager/mock_application.h" #include "application_manager/commands/commands_test.h" -#include "rc_rpc_plugin/commands/mobile/on_interior_vehicle_data_notification.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" -#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" -#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "application_manager/mock_application.h" #include "gtest/gtest.h" #include "interfaces/MOBILE_API.h" +#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" +#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" -using ::testing::_; -using ::testing::Return; -using ::testing::NiceMock; -using ::testing::SaveArg; -using ::testing::Mock; using application_manager::ApplicationSet; using application_manager::commands::MessageSharedPtr; using test::components::application_manager_test::MockApplication; using test::components::application_manager_test::MockApplicationManager; using test::components::commands_test::CommandsTest; using test::components::commands_test::CommandsTestMocks; +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::SaveArg; namespace { const uint32_t kAppId = 0u; const uint32_t kConnectionKey = 1u; const std::string kPolicyAppId = "Test"; const int kModuleId = 153u; -} +} // namespace namespace rc_rpc_plugin_test { using namespace rc_rpc_plugin; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc index b95725e0b4..6fbff118a4 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc @@ -32,34 +32,34 @@ #include "application_manager/application.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/mock_application.h" +#include "gtest/gtest.h" +#include "interfaces/MOBILE_API.h" #include "rc_rpc_plugin/commands/hmi/rc_on_remote_control_settings_notification.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" #include "rc_rpc_plugin/mock/mock_interior_data_cache.h" #include "rc_rpc_plugin/mock/mock_interior_data_manager.h" -#include "gtest/gtest.h" -#include "interfaces/MOBILE_API.h" +#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" -using ::testing::_; -using ::testing::Return; -using ::testing::NiceMock; -using ::testing::SaveArg; -using ::testing::Mock; using application_manager::ApplicationSet; using application_manager::commands::MessageSharedPtr; using test::components::application_manager_test::MockApplication; using test::components::application_manager_test::MockApplicationManager; using test::components::commands_test::CommandsTest; using test::components::commands_test::CommandsTestMocks; +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::SaveArg; namespace { const uint32_t kAppId = 0u; const uint32_t kConnectionKey = 1u; const std::string kPolicyAppId = "Test"; -} +} // namespace namespace rc_rpc_plugin_test { using namespace rc_rpc_plugin; @@ -124,8 +124,8 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest, SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER)); // Act std::shared_ptr< - rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command = - CreateRCCommand< + rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> + command = CreateRCCommand< rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>( mobile_message); @@ -144,8 +144,8 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest, // Act std::shared_ptr< - rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command = - CreateRCCommand< + rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> + command = CreateRCCommand< rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>( mobile_message); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc index 567d4b1e20..b28f2c972a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc @@ -31,59 +31,58 @@ */ #include "application_manager/application.h" -#include "application_manager/mock_application.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/rpc_service_impl.h" -#include "application_manager/mock_request_controller_settings.h" #include "application_manager/include/application_manager/command_holder_impl.h" -#include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/request_controller.h" -#include "application_manager/mock_rpc_plugin_manager.h" -#include "application_manager/mock_rpc_plugin.h" +#include "application_manager/message.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_command_factory.h" #include "application_manager/mock_event_dispatcher.h" -#include "application_manager/message.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" -#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" -#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" -#include "rc_rpc_plugin/commands/mobile/button_press_request.h" -#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h" -#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_request_controller_settings.h" +#include "application_manager/mock_rpc_plugin.h" +#include "application_manager/mock_rpc_plugin_manager.h" +#include "application_manager/request_controller.h" +#include "application_manager/rpc_service_impl.h" #include "hmi_message_handler/mock_hmi_message_handler.h" -#include "interfaces/MOBILE_API.h" #include "include/test/protocol_handler/mock_protocol_handler.h" +#include "interfaces/MOBILE_API.h" +#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_request.h" +#include "rc_rpc_plugin/commands/hmi/rc_get_interior_vehicle_data_consent_response.h" +#include "rc_rpc_plugin/commands/mobile/button_press_request.h" +#include "rc_rpc_plugin/mock/mock_interior_data_cache.h" +#include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" #include "test/application_manager/mock_application_manager_settings.h" using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; using ::testing::SaveArg; -using ::testing::Mock; -using ::testing::NiceMock; namespace am = ::application_manager; using am::ApplicationSet; -using am::commands::MessageSharedPtr; using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; +using am::plugin_manager::MockRPCPlugin; +using am::plugin_manager::MockRPCPluginManager; using am::plugin_manager::RPCPlugin; -using ::smart_objects::SmartObject; +using rc_rpc_plugin::RCRPCPlugin; using rc_rpc_plugin::commands::ButtonPressRequest; -using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentResponse; using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentRequest; -using rc_rpc_plugin::RCRPCPlugin; -using test::components::commands_test::CommandsTestMocks; -using test::components::commands_test::CommandRequestTest; -using am::plugin_manager::MockRPCPluginManager; -using am::plugin_manager::MockRPCPlugin; +using rc_rpc_plugin::commands::RCGetInteriorVehicleDataConsentResponse; +using ::smart_objects::SmartObject; using test::components::application_manager_test::MockApplication; +using test::components::application_manager_test::MockCommandFactory; +using test::components::application_manager_test::MockHMICapabilities; using test::components::application_manager_test::MockRequestControlerSettings; -using test::components::protocol_handler_test::MockProtocolHandler; +using test::components::commands_test::CommandRequestTest; +using test::components::commands_test::CommandsTestMocks; using test::components::hmi_message_handler_test::MockHMIMessageHandler; -using test::components::application_manager_test::MockHMICapabilities; -using test::components::application_manager_test::MockCommandFactory; using test::components::policy_test::MockPolicyHandlerInterface; +using test::components::protocol_handler_test::MockProtocolHandler; namespace rc_rpc_plugin_test { using namespace rc_rpc_plugin; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc index b1cb8271f5..f7718a7248 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc @@ -30,34 +30,38 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h" #include "application_manager/application.h" #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application.h" -#include "rc_rpc_plugin/commands/mobile/set_interior_vehicle_data_request.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" -#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" +#include "interfaces/MOBILE_API.h" #include "rc_rpc_plugin/mock/mock_interior_data_cache.h" #include "rc_rpc_plugin/mock/mock_interior_data_manager.h" +#include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" + +#include <stdint.h> #include "gtest/gtest.h" -#include "interfaces/MOBILE_API.h" -using ::testing::_; -using ::testing::Return; -using ::testing::NiceMock; using application_manager::ApplicationSet; using application_manager::commands::MessageSharedPtr; using test::components::application_manager_test::MockApplication; using test::components::application_manager_test::MockApplicationManager; using test::components::commands_test::CommandRequestTest; using test::components::commands_test::CommandsTestMocks; +using test::components::commands_test::HMIResultCodeIs; +using ::testing::_; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::SaveArg; namespace { const uint32_t kAppId = 0u; const int kModuleId = 153u; const uint32_t kConnectionKey = 1u; const std::string kPolicyAppId = "Test"; -} +} // namespace namespace rc_rpc_plugin_test { using namespace rc_rpc_plugin; @@ -90,7 +94,8 @@ class SetInteriorVehicleDataRequestTest ON_CALL(mock_policy_handler_, CheckHMIType(kPolicyAppId, mobile_apis::AppHMIType::eType::REMOTE_CONTROL, - nullptr)).WillByDefault(Return(true)); + nullptr)) + .WillByDefault(Return(true)); ON_CALL(mock_allocation_manager_, is_rc_enabled()) .WillByDefault(Return(true)); } @@ -139,8 +144,11 @@ TEST_F(SetInteriorVehicleDataRequestTest, (*mobile_message)[application_manager::strings::msg_params]; msg_params[message_params::kModuleData][message_params::kModuleType] = mobile_apis::ModuleType::CLIMATE; + smart_objects::SmartObject climate_control_data(smart_objects::SmartType_Map); + climate_control_data[message_params::kFanSpeed] = 10; + msg_params[message_params::kModuleData][message_params::kClimateControlData] = - smart_objects::SmartObject(smart_objects::SmartType_Map); + climate_control_data; // Expectations EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _)) .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed)); @@ -150,14 +158,15 @@ TEST_F(SetInteriorVehicleDataRequestTest, EXPECT_CALL( mock_rpc_service_, - ManageMobileCommand(test::components::commands_test::MobileResultCodeIs( - mobile_apis::Result::READ_ONLY), - application_manager::commands::Command::SOURCE_SDL)); + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _)) + .WillOnce(Return(true)); // Act - std::shared_ptr< - rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( mobile_message); + ASSERT_TRUE(command->Init()); command->Run(); } @@ -188,15 +197,16 @@ TEST_F( EXPECT_CALL( mock_rpc_service_, - ManageMobileCommand(test::components::commands_test::MobileResultCodeIs( - mobile_apis::Result::OUT_OF_MEMORY), - application_manager::commands::Command::SOURCE_SDL)); + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::RC_SetInteriorVehicleData), _)) + .WillOnce(Return(true)); // Act - std::shared_ptr< - rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( mobile_message); + ASSERT_TRUE(command->Init()); command->Run(); } @@ -224,11 +234,103 @@ TEST_F( application_manager::commands::Command::SOURCE_SDL)); // Act - std::shared_ptr< - rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command = - CreateRCCommand<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( + std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( mobile_message); + ASSERT_TRUE(command->Init()); command->Run(); } +TEST_F(SetInteriorVehicleDataRequestTest, + Execute_ValidWithSettableParams_SUCCESSSendToHMI) { + MessageSharedPtr mobile_message = CreateBasicMessage(); + auto& msg_params = + (*mobile_message)[application_manager::strings::msg_params]; + msg_params[message_params::kModuleData][message_params::kModuleType] = + mobile_apis::ModuleType::CLIMATE; + + msg_params[message_params::kModuleData][message_params::kClimateControlData] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + msg_params[message_params::kModuleData][message_params::kClimateControlData] + [message_params::kClimateEnable] = true; + + // Expectations + EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _)) + .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed)); + + EXPECT_CALL(mock_hmi_capabilities_, rc_capability()) + .WillOnce(Return(nullptr)); + + MessageSharedPtr message_from_mobile = CreateBasicMessage(); + + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&message_from_mobile), Return(true))); + + std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( + mobile_message); + + ASSERT_TRUE(command->Init()); + command->Run(); + + auto& msg_params_from_mobile = + (*message_from_mobile)[application_manager::strings::msg_params]; + + const bool climate_enable = + msg_params_from_mobile[message_params::kModuleData] + [message_params::kClimateControlData] + [message_params::kClimateEnable] + .asBool(); + EXPECT_TRUE(climate_enable); +} + +TEST_F(SetInteriorVehicleDataRequestTest, + Execute_ValidWithSettableParams_SUCCESSSendToHMI_HDChannel) { + MessageSharedPtr mobile_message = CreateBasicMessage(); + auto& msg_params = + (*mobile_message)[application_manager::strings::msg_params]; + msg_params[message_params::kModuleData][message_params::kModuleType] = + mobile_apis::ModuleType::RADIO; + + msg_params[message_params::kModuleData][message_params::kRadioControlData] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + const std::uint32_t hd_channel = 2u; + msg_params[message_params::kModuleData][message_params::kRadioControlData] + [message_params::kHdChannel] = hd_channel; + + // Expectations + EXPECT_CALL(mock_policy_handler_, CheckModule(kPolicyAppId, _)) + .WillOnce(Return(rc_rpc_plugin::TypeAccess::kAllowed)); + + EXPECT_CALL(mock_hmi_capabilities_, rc_capability()) + .WillOnce(Return(nullptr)); + + auto message_from_mobile = CreateBasicMessage(); + + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&message_from_mobile), Return(true))); + + std::shared_ptr<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> + command = CreateRCCommand< + rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( + mobile_message); + + command->Init(); + command->Run(); + + auto& msg_params_from_mobile = + (*message_from_mobile)[application_manager::strings::msg_params]; + + const uint64_t hd_channel_from_hmi = + msg_params_from_mobile[message_params::kModuleData] + [message_params::kRadioControlData] + [message_params::kHdChannel] + .asUInt(); + + EXPECT_EQ(hd_channel, hd_channel_from_hmi); +} } // namespace rc_rpc_plugin_test diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h index 72ace1432a..828e2eea11 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/include/rc_rpc_plugin/mock/mock_resource_allocation_manager.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_RC_RPC_PLUGIN_TEST_INCLUDE_RC_RPC_PLUGIN_MOCK_MOCK_RESOURCE_ALLOCATION_MANAGER_H_ -#include "gmock/gmock.h" #include "application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h" +#include "gmock/gmock.h" namespace rc_rpc_plugin_test { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc index e6922a4c83..b7eb4a554a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc @@ -157,4 +157,4 @@ TEST_F(InteriorDataCacheTest, Exist2ModuleTypesRemoveOneAnotherOneLeft) { EXPECT_EQ(data2, retrieved_data2); } -} // rc_rpc_plugin_test +} // namespace rc_rpc_plugin_test diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc index 86c58b9d46..a72b89b9de 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc @@ -32,34 +32,34 @@ #include <algorithm> #include "gtest/gtest.h" -#include "rc_rpc_plugin/resource_allocation_manager_impl.h" -#include "rc_rpc_plugin/rc_rpc_plugin.h" -#include "rc_rpc_plugin/rc_module_constants.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_rpc_service.h" #include "application_manager/policies/mock_policy_handler_interface.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" +#include "rc_rpc_plugin/rc_module_constants.h" +#include "rc_rpc_plugin/rc_rpc_plugin.h" +#include "rc_rpc_plugin/resource_allocation_manager_impl.h" using test::components::application_manager_test::MockApplication; using test::components::application_manager_test::MockApplicationManager; using test::components::application_manager_test::MockRPCService; +using ::application_manager::ApplicationSharedPtr; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::protocol_handler::MessagePriority; using ::testing::_; +using ::testing::DoAll; +using ::testing::Eq; using ::testing::Mock; using ::testing::NiceMock; -using ::testing::StrictMock; using ::testing::Return; using ::testing::ReturnRef; using ::testing::SaveArg; -using ::testing::Eq; -using ::testing::DoAll; using ::testing::SetArgPointee; -using ::application_manager::Message; -using ::application_manager::MessageType; -using ::application_manager::ApplicationSharedPtr; -using ::protocol_handler::MessagePriority; +using ::testing::StrictMock; namespace { const bool kDeviceHandle = 1u; @@ -72,7 +72,7 @@ const uint32_t kHMIAppId1 = 1u; const uint32_t kAppId2 = 22u; const std::string policy_app_id_1_ = "policy_id_1"; const uint32_t kSizeOfModules = 6u; -} +} // namespace namespace rc_rpc_plugin_test { @@ -665,4 +665,4 @@ TEST_F(RAManagerTest, OnRCStatus_ModuleAllocation) { kHMIAppId1); } -} // namespace rc_rpc_plugin +} // namespace rc_rpc_plugin_test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt index 11dd35d061..fdf02b57cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/CMakeLists.txt @@ -42,8 +42,12 @@ set (HMI_COMMANDS_SOURCE_DIR ${COMMANDS_SOURCE_DIR}/hmi ) +set (EXTENSIONS_SOURCE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}/src/extensions +) collect_sources(MOBILE_COMMANDS "${MOBILE_COMMANDS_SOURCE_DIR}") collect_sources(HMI_COMMANDS "${HMI_COMMANDS_SOURCE_DIR}") +collect_sources(APP_EXTENSIONS "${EXTENSIONS_SOURCE_DIR}") collect_sources(RPC_PLUGIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src") set(LIBRARIES @@ -60,7 +64,7 @@ if(ENABLE_LOG) list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY}) endif() -add_library("sdl_rpc_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES}) +add_library("sdl_rpc_plugin" SHARED ${MOBILE_COMMANDS} ${HMI_COMMANDS} ${RPC_PLUGIN_SOURCES} ${APP_EXTENSIONS}) target_link_libraries("sdl_rpc_plugin" ${LIBRARIES}) set(INSTALL_DESTINATION bin) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h index 7b0911fef9..6d8f5e4b2b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_request.h @@ -72,6 +72,6 @@ class ActivateAppRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h index f937b4f63b..93be297bf6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/activate_app_response.h @@ -72,6 +72,6 @@ class ActivateAppResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h index 4e9e4d54d7..6e7ef63cf4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h @@ -74,6 +74,6 @@ class AddStatisticsInfoNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ADD_STATISTICS_INFO_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h index 45acb3a424..54a81f50f3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h @@ -72,6 +72,6 @@ class AllowAllAppsRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h index 41d1c9e752..ffd60a61d8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h @@ -72,6 +72,6 @@ class AllowAllAppsResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_ALL_APPS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h index b3a2d88d7d..c8c0198cc8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_request.h @@ -72,6 +72,6 @@ class AllowAppRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h index 55637e1756..5f6ee670ec 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/allow_app_response.h @@ -72,6 +72,6 @@ class AllowAppResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ALLOW_APP_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h new file mode 100644 index 0000000000..9847f567e0 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_ + +#include "application_manager/commands/request_to_hmi.h" +#include "sdl_rpc_plugin/sdl_rpc_plugin.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief BasicCommunicationCloseApplicationRequest command class + **/ +class BasicCommunicationCloseApplicationRequest + : public app_mngr::commands::RequestToHMI { + public: + /** + * @brief BasicCommunicationCloseApplicationRequest class constructor + * + * @param message Incoming SmartObject message + **/ + BasicCommunicationCloseApplicationRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief BasicCommunicationCloseApplicationRequest class destructor + **/ + ~BasicCommunicationCloseApplicationRequest() OVERRIDE; + + /** + * @brief Execute command + **/ + void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationRequest); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h new file mode 100644 index 0000000000..9576684b77 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_ + +#include "application_manager/commands/response_from_hmi.h" +#include "sdl_rpc_plugin/sdl_rpc_plugin.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief BasicCommunicationCloseApplicationResponse command class + **/ +class BasicCommunicationCloseApplicationResponse + : public app_mngr::commands::ResponseFromHMI { + public: + /** + * @brief BasicCommunicationCloseApplicationResponse class constructor + * + * @param message Incoming SmartObject message + **/ + BasicCommunicationCloseApplicationResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief BasicCommunicationCloseApplicationResponse class destructor + **/ + ~BasicCommunicationCloseApplicationResponse() OVERRIDE; + + /** + * @brief Execute command + **/ + void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(BasicCommunicationCloseApplicationResponse); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_CLOSE_APPLICATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h index 90160d9953..e90e6cd20f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h @@ -35,8 +35,8 @@ #include "application_manager/commands/response_from_hmi.h" +#include "application_manager/application_manager.h" #include "utils/macro.h" -#include "application_manager/application_manager_impl.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h index 2ac1be2580..82ac7b0efa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h @@ -72,6 +72,6 @@ class OnAwakeSDLNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h index a7eb820146..71eb9e4105 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h @@ -74,6 +74,6 @@ class BasicCommunicationSystemRequest } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h index 20483a45e3..c76993cc6f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h @@ -74,6 +74,6 @@ class BasicCommunicationSystemResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h new file mode 100644 index 0000000000..fd241da3c4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h @@ -0,0 +1,77 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_REQUEST_H_ + +#include "application_manager/commands/request_to_hmi.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief BCGetFilePathRequest command class + **/ +class BCGetFilePathRequest : public app_mngr::commands::RequestToHMI { + public: + /** + * @brief BCGetFilePathRequest class constructor + * + * @param message Incoming SmartObject message + **/ + BCGetFilePathRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + + /** + * @brief BCGetFilePathRequest class destructor + **/ + virtual ~BCGetFilePathRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(BCGetFilePathRequest); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_sdl_RPC_PLUGIN_INCLUDE_sdl_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h new file mode 100644 index 0000000000..2a6025cbdf --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h @@ -0,0 +1,77 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_RESPONSE_H_ + +#include "application_manager/commands/response_from_hmi.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief BCGetFilePathResponse command class + **/ +class BCGetFilePathResponse : public app_mngr::commands::ResponseFromHMI { + public: + /** + * @brief BCGetFilePathResponse class constructor + * + * @param message Incoming SmartObject message + **/ + BCGetFilePathResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + + /** + * @brief BCGetFilePathResponse class destructor + **/ + virtual ~BCGetFilePathResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(BCGetFilePathResponse); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BC_GET_FILE_PATH_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h index 5c650fb8e4..9bb3d9a6fb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h @@ -73,6 +73,6 @@ class ButtonGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h index bf2f15c18a..4431ea1224 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h @@ -74,6 +74,6 @@ class ButtonGetCapabilitiesResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_BUTTON_GET_CAPABILITIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h index 635b0579f4..bfcf478930 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_request.h @@ -72,6 +72,6 @@ class ClosePopupRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h index 199b40f070..7477bda854 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/close_popup_response.h @@ -72,6 +72,6 @@ class ClosePopupResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h index a70bff2553..f59b36fe09 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h @@ -67,6 +67,6 @@ class DecryptCertificateRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h index 88b216eeea..9844ed9165 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h @@ -73,6 +73,6 @@ class DecryptCertificateResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h index fa0efb90e6..bafe9c1e91 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_request.h @@ -75,6 +75,6 @@ class DialNumberRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h index 33d4788eca..9097757ab2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/dial_number_response.h @@ -76,6 +76,6 @@ class DialNumberResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_DIAL_NUMBER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h index d771167798..8d3be68539 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_request.h @@ -72,6 +72,6 @@ class GetSystemInfoRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h index 5bf5f41b73..d4f35a4e2a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_system_info_response.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_ -#include "application_manager/commands/response_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/response_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -82,6 +82,6 @@ class GetSystemInfoResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h index 93b414c8c4..c3f7453583 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls.h @@ -91,6 +91,6 @@ class GetUrls : public app_mngr::commands::RequestFromHMI { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h index 1ff38194b8..06af3c6ea5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/get_urls_response.h @@ -67,6 +67,6 @@ class GetUrlsResponse : public app_mngr::commands::ResponseToHMI { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_GET_URLS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h index 34c10cedf1..46aa575eb5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h @@ -73,6 +73,6 @@ class MixingAudioSupportedRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h index 5c67666225..32dd23d352 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h @@ -74,6 +74,6 @@ class MixingAudioSupportedResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_MIXING_AUDIO_SUPPORTED_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h index 3f63ef883d..a04488df76 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h @@ -72,6 +72,6 @@ class NaviAlertManeuverRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h index 7d7c4de85e..610af3fbfc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h @@ -72,6 +72,6 @@ class NaviAlertManeuverResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_ALERT_MANEUVER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h index 80e948ad25..fa9eee485e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h @@ -63,8 +63,8 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI, virtual ~AudioStartStreamRequest(); /** - * @brief onTimeOut from requrst Controller - */ + * @brief onTimeOut from requrst Controller + */ virtual void onTimeOut(); /** @@ -78,9 +78,9 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI, virtual void on_event(const app_mngr::event_engine::Event& event); /** - * @brief RetryStartSession resend HMI startSession request if needed. - * If limit expired, set audio_stream_retry_number counter to 0 - */ + * @brief RetryStartSession resend HMI startSession request if needed. + * If limit expired, set audio_stream_retry_number counter to 0 + */ void RetryStartSession(); private: @@ -90,6 +90,6 @@ class AudioStartStreamRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h index 926cfc36ed..0f669084cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h @@ -71,6 +71,6 @@ class AudioStartStreamResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_START_STREAM_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h index 7c5fbbdd3d..9f3aa8c312 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h @@ -71,6 +71,6 @@ class AudioStopStreamRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h index 8eb091dd92..740efc2d19 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h @@ -71,6 +71,6 @@ class AudioStopStreamResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_AUDIO_STOP_STREAM_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h index dab5fc1022..0e2ad8b9a3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h @@ -70,6 +70,6 @@ class NaviGetWayPointsRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h index fb93c2c64a..9fef4f041e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h @@ -72,6 +72,6 @@ class NaviGetWayPointsResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h index 404ddc9f00..17d4eb483f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h @@ -78,6 +78,6 @@ class NaviIsReadyRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h index 7f94312d04..5dcbdd46df 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h @@ -72,6 +72,6 @@ class NaviIsReadyResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h index 7bdf0e4787..02068779a9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_request.h @@ -72,6 +72,6 @@ class NaviSendLocationRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h index 6a65eb00a1..e322177e45 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_send_location_response.h @@ -72,6 +72,6 @@ class NaviSendLocationResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SEND_LOCATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h index a981b8ff81..437d58861c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h @@ -84,6 +84,6 @@ class NaviSetVideoConfigRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h index f5f9e7a5ee..3cf3ca17ae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h @@ -74,6 +74,6 @@ class NaviSetVideoConfigResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h index f64bdf6ce0..efe6743d88 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h @@ -73,6 +73,6 @@ class NaviShowConstantTBTRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h index fd4da08cf0..a77d2b9dbb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h @@ -73,6 +73,6 @@ class NaviShowConstantTBTResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SHOW_CONSTANT_TBT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h index d5aae67661..afad744eb3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h @@ -47,10 +47,10 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI, public app_mngr::event_engine::EventObserver { public: /** - * @brief NaviStartStreamRequest class constructor - * - * @param message Incoming SmartObject message - **/ + * @brief NaviStartStreamRequest class constructor + * + * @param message Incoming SmartObject message + **/ NaviStartStreamRequest(const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, app_mngr::rpc_service::RPCService& rpc_service, @@ -78,9 +78,9 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI, virtual void onTimeOut(); /** - * @brief RetryStartSession resend HMI startSession request if needed. - * If limit expired, set video_stream_retry_number counter to 0 - */ + * @brief RetryStartSession resend HMI startSession request if needed. + * If limit expired, set video_stream_retry_number counter to 0 + */ void RetryStartSession(); private: @@ -90,6 +90,6 @@ class NaviStartStreamRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h index b4770e82fe..38d9ba905c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h @@ -71,6 +71,6 @@ class NaviStartStreamResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_START_STREAM_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h index 400c61ba07..0d14d0595f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h @@ -71,6 +71,6 @@ class NaviStopStreamRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h index 39512ac2bb..10b5ef0f80 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h @@ -71,6 +71,6 @@ class NaviStopStreamResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_STOP_STREAM_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h index 052c3c7151..3def06ba9a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h @@ -71,6 +71,6 @@ class NaviSubscribeWayPointsRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h index 73aab4633f..c424ae0857 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h @@ -74,6 +74,6 @@ class NaviSubscribeWayPointsResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h index f20386a246..be1ccbb45b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h @@ -72,6 +72,6 @@ class NaviUnsubscribeWayPointsRequest } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h index ec4f4eb963..d4f98a871c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h @@ -74,5 +74,5 @@ class NaviUnsubscribeWayPointsResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h index db269a65d3..a80d111dae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h @@ -72,6 +72,6 @@ class NaviUpdateTurnListRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h index 20295485a3..8f715ac33d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h @@ -73,6 +73,6 @@ class NaviUpdateTurnListResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_NAVI_UPDATE_TURN_LIST_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h index 42bf877f2d..3f9d096625 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h @@ -74,6 +74,6 @@ class OnAllowSDLFunctionalityNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h index cc21d699fb..f856ce966e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h @@ -74,6 +74,6 @@ class OnAppActivatedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h index 9b4a6ba5a0..6a7fd00632 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h @@ -74,6 +74,6 @@ class OnAppDeactivatedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_DEACTIVATED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h index 6008a8ce51..afed4bfa39 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h @@ -74,6 +74,6 @@ class OnAppPermissionChangedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h index a751b25d85..1f06e38ccd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h @@ -74,6 +74,6 @@ class OnAppPermissionConsentNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h index 3548786d1d..00c75d2c23 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h @@ -74,6 +74,6 @@ class OnAppRegisteredNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_REGISTERED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h index 097eb1eb28..791374f6f4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h @@ -64,13 +64,13 @@ class OnAppUnregisteredNotification ~OnAppUnregisteredNotification() FINAL; /** - * @brief Init overrides and skips replacement of app id with hmi id since - * 1) at the moment this notification is being sent there is no application - * registered in application manager - * 2) hmi id is already used whenever this message is being constructed, so - * its already there - * @return True in any case - */ + * @brief Init overrides and skips replacement of app id with hmi id since + * 1) at the moment this notification is being sent there is no application + * registered in application manager + * 2) hmi id is already used whenever this message is being constructed, so + * its already there + * @return True in any case + */ bool Init() FINAL; /** @@ -84,6 +84,6 @@ class OnAppUnregisteredNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_APP_UNREGISTERED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h index cac306f760..8f51a822a2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h @@ -74,6 +74,6 @@ class OnAudioDataStreamingNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h new file mode 100644 index 0000000000..0e956e8688 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_ + +#include "application_manager/commands/notification_to_hmi.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief OnASSystemCapabilityUpdatedNotification command class + **/ +class OnBCSystemCapabilityUpdatedNotification + : public app_mngr::commands::NotificationToHMI { + public: + /** + * @brief OnASSystemCapabilityUpdatedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnBCSystemCapabilityUpdatedNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief OnASSystemCapabilityUpdatedNotification class destructor + **/ + virtual ~OnBCSystemCapabilityUpdatedNotification(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(OnBCSystemCapabilityUpdatedNotification); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BC_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h index b83fe1bfe0..955249bd4b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_event_notification.h @@ -74,6 +74,6 @@ class OnButtonEventNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_EVENT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h index e996c9952c..9de86d1d9c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_press_notification.h @@ -74,6 +74,6 @@ class OnButtonPressNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_PRESS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h index 4ed60f9a07..0a0a8c3c5d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h @@ -78,6 +78,6 @@ class OnButtonSubscriptionNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_BUTTON_SUBSCRIPTION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h index 99c165c12f..7fe0b2a8c3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h @@ -74,6 +74,6 @@ class OnDeviceChosenNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_CHOSEN_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h index 7701e2a601..df1efb4d30 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h @@ -74,6 +74,6 @@ class OnDeviceStateChangedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DEVICE_STATE_CHANGED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h index 51fb49c6bc..df8dd3d401 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h @@ -80,6 +80,6 @@ class OnDriverDistractionNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_DRIVER_DISTRACTION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h index cff0a0e617..4fcde5f7d0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h @@ -74,6 +74,6 @@ class OnEventChangedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h index 116932d87a..dbbbe925fe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h @@ -79,6 +79,6 @@ class OnExitAllApplicationsNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h index 11c397bfe7..403642f64d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h @@ -74,6 +74,6 @@ class OnExitApplicationNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h index 38c5dcf535..7658017364 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h @@ -72,6 +72,6 @@ class OnFileRemovedNotification : public app_mngr::commands::NotificationToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FILE_REMOVED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h index 672ded9dcf..bf3a9d530e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_find_applications.h @@ -72,6 +72,6 @@ class OnFindApplications : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h index 85b7ed356e..d215b3d07d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_impl.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnIgnitionCycleOverNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_IGNITION_CYCLE_OVER_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h index 075dc2cb5c..a07af99df1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnNaviTBTClientStateNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_TBT_CLIENT_STATE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h index 3efde9c8c1..74058e246c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,5 +75,5 @@ class OnNaviWayPointChangeNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h index 331e352795..ede78dd362 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_policy_update.h @@ -66,6 +66,6 @@ class OnPolicyUpdate : public app_mngr::commands::NotificationFromHMI { DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate); }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_POLICY_UPDATE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h index 503013ff58..e64edd51bc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_put_file_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_ -#include "application_manager/commands/notification_to_hmi.h" #include "application_manager/application_impl.h" +#include "application_manager/commands/notification_to_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnPutFileNotification : public app_mngr::commands::NotificationToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_PUT_FILE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h index c4adc20090..f540abbf4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ready_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnReadyNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_READY_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h index c1e1b01a18..1ffe038a82 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_received_policy_update.h @@ -43,10 +43,10 @@ namespace commands { class OnReceivedPolicyUpdate : public app_mngr::commands::NotificationFromHMI { public: /** - * @brief OnReceivedPolicyUpdate class constructor - * - * @param message Incoming SmartObject message - **/ + * @brief OnReceivedPolicyUpdate class constructor + * + * @param message Incoming SmartObject message + **/ OnReceivedPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, app_mngr::rpc_service::RPCService& rpc_service, @@ -69,6 +69,6 @@ class OnReceivedPolicyUpdate : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h index c5755a364c..68cc5ca487 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_record_start_notification.h @@ -74,6 +74,6 @@ class OnRecordStartdNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RECORD_START_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h index ef2b5a34eb..63ea659747 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_ -#include "application_manager/commands/notification_to_hmi.h" #include "application_manager/application_impl.h" +#include "application_manager/commands/notification_to_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnResumeAudioSourceNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESUME_AUDIO_SOURCE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h index 34fe41de81..a40872b578 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h @@ -72,6 +72,6 @@ class OnSDLCloseNotification : public app_mngr::commands::NotificationToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CLOSE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h index 9fe736a595..00bc6c9a05 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h @@ -74,6 +74,6 @@ class OnSDLConsentNeededNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h index 96f63845e1..6ae9aee1f5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h @@ -74,6 +74,6 @@ class OnSDLPersistenceCompleteNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h index da049b1dc4..38bb1db03e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h @@ -72,6 +72,6 @@ class OnStartDeviceDiscovery : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h index 7c61fac041..7a6e8b871a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_status_update_notification.h @@ -74,6 +74,6 @@ class OnStatusUpdateNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h index d4c940bac7..a239203053 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_context_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -76,6 +76,6 @@ class OnSystemContextNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_CONTEXT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h index 76325b078f..3993eefd8b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_error_notification.h @@ -73,6 +73,6 @@ class OnSystemErrorNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_ERROR_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h index 1e4046b83b..a5ab636464 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h @@ -74,6 +74,6 @@ class OnSystemInfoChangedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h index 1e1e1818b8..6f9f63b517 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_request_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_impl.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnSystemRequestNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_REQUEST_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h index 0beba8dc6b..799af1e134 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_SYSTEM_TIME_READY_NOTIFICATION_H_ +#include "application_manager/application_manager.h" #include "application_manager/commands/notification_from_hmi.h" -#include "application_manager/application_manager_impl.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h index 33c7d98b6f..0462925f71 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h @@ -74,6 +74,6 @@ class OnTTSLanguageChangeNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_LANGUAGE_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h index 70050a667e..c8bd159064 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h @@ -78,6 +78,6 @@ class OnTTSResetTimeoutNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h index 93dac3f292..315acf3a5f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h @@ -73,6 +73,6 @@ class OnTTSStartedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STARTED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h index 362e96f4be..0dafd61c58 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h @@ -73,6 +73,6 @@ class OnTTSStoppedNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_STOPPED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h index 0cc4e9e772..f468ce5b0a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h @@ -72,6 +72,6 @@ class OnUICommandNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_COMMAND_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h index c487894770..31b7eef3a3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -79,6 +79,6 @@ class OnUIKeyBoardInputNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_KEYBOARD_INPUT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h index f30b8573aa..2495aa2b96 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h @@ -74,6 +74,6 @@ class OnUILanguageChangeNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_LANGUAGE_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h index bbdf4d04ef..1c87f82349 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h @@ -78,6 +78,6 @@ class OnUIResetTimeoutNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h index 5c7dd0128b..26c25f437a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -79,6 +79,6 @@ class OnUITouchEventNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_TOUCH_EVENT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h index 2942c36053..d638629b3a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_update_device_list.h @@ -72,6 +72,6 @@ class OnUpdateDeviceList : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UPDATE_DEVICE_LIST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h index ed0b1572ff..c848233497 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_acc_pedal_position_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIAccPedalPositionNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ACC_PEDAL_POSITION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h index cc81160ccb..0cb3e04f4e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_belt_status_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIBeltStatusNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BELT_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h index 2b46b69f55..6ab920204d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_body_information_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIBodyInformationNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_BODY_INFORMATION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h index 05da9a775d..b3afeb82b3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_device_status_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIDeviceStatusNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DEVICE_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h index 6640d7953a..a1885c5e29 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_driver_braking_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIDriverBrakingNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_DRIVER_BRAKING_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h index f8c0526f8c..feb6cc6060 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_engine_torque_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIEngineTorqueNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ENGINE_TORQUE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h index 900aecd845..734420aaee 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_external_temperature_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIExternalTemperatureNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_EXTERNAL_TEMPERATURE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h index 7374de9ad9..a5588901f7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -74,6 +74,6 @@ class OnVIFuelLevelNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h index a705fcbd04..5ed661cdbf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_fuel_level_state_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIFuelLevelStateNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_FUEL_LEVEL_STATE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h index 984e1e4c0b..70ee5f6c00 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_gps_data_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVIGpsDataNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_GPS_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h index 1dfda8a9e0..5ef1e3ed92 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_head_lamp_status_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIHeadLampStatusNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_HEAD_LAMP_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h index fd8743907c..7bb7756fc5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_instant_fuel_consumption_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIInstantFuelConsumptionNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_INSTANT_FUEL_CONSUMPTION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h index 25ace2821d..cdebc99768 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_my_key_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVIMyKeyNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_MY_KEY_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h index ad141e733c..1da26dd316 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_odometer_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -74,6 +74,6 @@ class OnVIOdometerNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_ODOMETER_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h index 95fb873957..7d03c62633 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_prndl_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVIPrndlNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_PRNDL_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h index d4b121a96f..60a0ce0782 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_rpm_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVIRpmNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_RPM_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h index 4afaafc9ff..4920fbd661 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_speed_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVISpeedNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_SPEED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h index 0d0aeadad8..cff99ecf8e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_steering_wheel_angle_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVISteeringWheelAngleNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_STEERING_WHEEL_ANGLE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h index c358ed37e9..0399780869 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_tire_pressure_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVITirePressureNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_TIRE_PRESSURE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h index 75062a51e1..60b686683f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_vin_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVIVinNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VIN_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h index de7a5dfc9e..a6e1ba9921 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vi_wiper_status_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -75,6 +75,6 @@ class OnVIWiperStatusNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_WIPER_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h index 7a7cf3cd96..6d6d4a69db 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h @@ -74,6 +74,6 @@ class OnVideoDataStreamingNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h index 3ef21fc568..58ea2e07b5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_impl.h" +#include "application_manager/commands/notification_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class OnVRCommandNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_COMMAND_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h index e6bd39d46e..f583d1e2fe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h @@ -74,6 +74,6 @@ class OnVRLanguageChangeNotification } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_LANGUAGE_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h index abca9db91d..98ed40101b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h @@ -72,6 +72,6 @@ class OnVRStartedNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STARTED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h index 9b53214f8f..e16b440da7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h @@ -72,6 +72,6 @@ class OnVRStoppedNotification : public app_mngr::commands::NotificationFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VR_STOPPED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h index 8f94d4876a..57a90955f4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h @@ -72,6 +72,6 @@ class RCGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h index dec31c9ea1..e0c305f796 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h @@ -72,6 +72,6 @@ class RCGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h index 3ba614f823..305a866659 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h @@ -89,6 +89,6 @@ class RCIsReadyRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h index 93f30e795c..5f4af23527 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h @@ -72,6 +72,6 @@ class RCIsReadyResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h index e97312b881..2751104486 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_ -#include "application_manager/commands/request_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/request_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -109,6 +109,6 @@ class SDLActivateAppRequest : public app_mngr::commands::RequestFromHMI { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h index 7a3f5157da..fd8b885e88 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h @@ -71,6 +71,6 @@ class SDLActivateAppResponse : public app_mngr::commands::ResponseToHMI { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h index 61426e0af3..acf390cfbc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h @@ -73,6 +73,6 @@ class SDLGetListOfPermissionsRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h index e2556bac3d..4fc1775c72 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h @@ -74,6 +74,6 @@ class SDLGetListOfPermissionsResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h index b6376bacc6..fae0b6480d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h @@ -71,6 +71,6 @@ class SDLGetStatusUpdateRequest : public app_mngr::commands::RequestFromHMI { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h index 4e6da22370..1c10142c99 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h @@ -72,6 +72,6 @@ class SDLGetStatusUpdateResponse : public app_mngr::commands::ResponseToHMI { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h index 75902e2733..18ad1fa535 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_ -#include "application_manager/commands/request_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/request_from_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -74,6 +74,6 @@ class SDLGetUserFriendlyMessageRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h index a02d6894e3..101a13b218 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h @@ -74,6 +74,6 @@ class SDLGetUserFriendlyMessageResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h index f164aed775..e330e847b0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update.h @@ -43,10 +43,10 @@ namespace commands { class SDLPolicyUpdate : public app_mngr::commands::RequestToHMI { public: /** - * @brief SDLPolicyUpdate class constructor - * - * @param message Incoming SmartObject message - **/ + * @brief SDLPolicyUpdate class constructor + * + * @param message Incoming SmartObject message + **/ SDLPolicyUpdate(const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, app_mngr::rpc_service::RPCService& rpc_service, @@ -66,6 +66,6 @@ class SDLPolicyUpdate : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h index 63f33477b6..ce7125f251 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h @@ -69,6 +69,6 @@ class SDLPolicyUpdateResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h index 229ed92947..0905e90b45 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h @@ -73,6 +73,6 @@ class TTSChangeRegistrationRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h index 8462178283..1988a7ee62 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h @@ -74,6 +74,6 @@ class TTSChangeRegistratioResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_CHANGE_REGISTRATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h index df6cf3b4a4..d636485915 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h @@ -72,6 +72,6 @@ class TTSGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h index 7919f213a4..5c9b60e2f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h @@ -73,6 +73,6 @@ class TTSGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_CAPABILITIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h index 09345c02d7..73ef8c5234 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_request.h @@ -72,6 +72,6 @@ class TTSGetLanguageRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h index e52dbf1ada..b29b3e7314 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_language_response.h @@ -72,6 +72,6 @@ class TTSGetLanguageResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_LANGUAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h index c42d0257d3..a24a6446b3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h @@ -74,6 +74,6 @@ class TTSGetSupportedLanguagesRequest } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h index cc24db22b9..25850de5f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h @@ -74,6 +74,6 @@ class TTSGetSupportedLanguagesResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_GET_SUPPORTED_LANGUAGES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h index b7dffd5bde..dd360eeb4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h @@ -88,6 +88,6 @@ class TTSIsReadyRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h index 268edd0eeb..881cd98179 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h @@ -72,6 +72,6 @@ class TTSIsReadyResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h index f416b3a787..009ee8f0be 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h @@ -73,6 +73,6 @@ class TTSSetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h index ff5622296c..d7ac422e57 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h @@ -74,6 +74,6 @@ class TTSSetGlobalPropertiesResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SET_GLOBAL_PROPERTIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h index 9e8915a440..efb67243fa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_request.h @@ -72,6 +72,6 @@ class TTSSpeakRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h index e4b2c8adbd..d516a9df1e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_speak_response.h @@ -72,6 +72,6 @@ class TTSSpeakResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_SPEAK_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h index 8eb6a66c95..f3ce24d928 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h @@ -72,6 +72,6 @@ class TTSStopSpeakingRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h index d433fe2280..6399193ae6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h @@ -72,6 +72,6 @@ class TTSStopSpeakingResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_TTS_STOP_SPEAKING_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h index e5d2483576..2d1e84fbec 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_request.h @@ -72,6 +72,6 @@ class UIAddCommandRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h index 90a9666561..cf69368551 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_command_response.h @@ -72,6 +72,6 @@ class UIAddCommandResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_COMMAND_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h index 5de5e41cd6..0cd120b3cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h @@ -72,6 +72,6 @@ class UIAddSubmenuRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h index 20f830be27..5e951600bd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h @@ -72,6 +72,6 @@ class UIAddSubmenuResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ADD_SUBMENU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h index 6235a51c7d..3c0423e35e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_request.h @@ -72,6 +72,6 @@ class UIAlertRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h index b43185af78..0392da0c7b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_alert_response.h @@ -72,6 +72,6 @@ class UIAlertResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_ALERT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h index c504c55727..44440bf49d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h @@ -73,6 +73,6 @@ class UIChangeRegistrationRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h index d7fca83d3e..e0077744a1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h @@ -73,6 +73,6 @@ class UIChangeRegistratioResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_CHANGE_REGISTRATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h index ecc0b44495..4af8b91793 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h @@ -72,6 +72,6 @@ class UIDeleteCommandRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h index f9601b7491..1eda0d362a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h @@ -72,6 +72,6 @@ class UIDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_COMMAND_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h index 3161c84b7c..9a7cd97ec7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h @@ -72,6 +72,6 @@ class UIDeleteSubmenuRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h index 7c73a53c3e..3edb8489e0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h @@ -72,6 +72,6 @@ class UIDeleteSubmenuResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_DELETE_SUBMENU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h index 8d34e1852b..90bf6f7dbc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h @@ -73,6 +73,6 @@ class UIEndAudioPassThruRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h index b1c3bfd87a..69a7959e53 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h @@ -73,6 +73,6 @@ class UIEndAudioPassThruResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_END_AUDIO_PASS_THRU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h index 47782cc7a9..58d8d0f732 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h @@ -72,6 +72,6 @@ class UIGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h index 421844560d..d83d5f211b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h @@ -72,6 +72,6 @@ class UIGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_CAPABILITIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h index 7c82584178..842a97a717 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_request.h @@ -72,6 +72,6 @@ class UIGetLanguageRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h index 7354e87ee4..ec02b6fde9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_language_response.h @@ -72,6 +72,6 @@ class UIGetLanguageResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_LANGUAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h index 7fd456b92b..42ea555358 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h @@ -73,6 +73,6 @@ class UIGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h index 26d8e98892..45137ba518 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h @@ -74,6 +74,6 @@ class UIGetSupportedLanguagesResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_GET_SUPPORTED_LANGUAGES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h index 2e7806cd2b..18536032b7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h @@ -88,6 +88,6 @@ class UIIsReadyRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h index f2b4f201f3..790c0115aa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h @@ -72,6 +72,6 @@ class UIIsReadyResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h index 6d4e870228..be7d384583 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h @@ -73,6 +73,6 @@ class UIPerformAudioPassThruRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h index e36a292573..05f2cc84fd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h @@ -74,6 +74,6 @@ class UIPerformAudioPassThruResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h index ff4540de23..15cec6c17e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h @@ -73,6 +73,6 @@ class UIPerformInteractionRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h index caf5716e18..2d13e15ad2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h @@ -74,6 +74,6 @@ class UIPerformInteractionResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_PERFORM_INTERACTION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h index f5acf41c8d..bc25259662 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h @@ -73,6 +73,6 @@ class UIScrollableMessageRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h index e46265c0e4..f7f92600cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h @@ -73,6 +73,6 @@ class UIScrollableMessageResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SCROLLABLE_MESSAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h index 4e260a99ff..56ffe40c21 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h @@ -73,6 +73,6 @@ class UISendHapticDataRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h index 1bf38939be..439c2f2682 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h @@ -73,6 +73,6 @@ class UISendHapticDataResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h index ea526df135..a7d07628e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h @@ -72,6 +72,6 @@ class UISetAppIconRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h index af2c4fafea..3e4b338439 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h @@ -72,6 +72,6 @@ class UISetAppIconResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h index f60f7325fd..446b77b997 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h @@ -71,6 +71,6 @@ class UiSetDisplayLayoutRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h index ce404a4049..ade6aa1c13 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h @@ -73,6 +73,6 @@ class UiSetDisplayLayoutResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h index 44e8bba450..8df60a318a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h @@ -73,6 +73,6 @@ class UISetGlobalPropertiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h index a9c27a423b..a189093fc7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h @@ -74,6 +74,6 @@ class UISetGlobalPropertiesResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_GLOBAL_PROPERTIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h index 24f4d76d89..b1b196a25f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h @@ -73,6 +73,6 @@ class UISetMediaClockTimerRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h index c664bd04f9..23b6d3aefa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h @@ -74,6 +74,6 @@ class UISetMediaClockTimerResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h index 7ba950d530..6024243481 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_request.h @@ -72,6 +72,6 @@ class UIShowRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h index f9f7a61056..4d19667153 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_show_response.h @@ -72,6 +72,6 @@ class UIShowResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SHOW_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h index 3de1b4e775..c41e02b44f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_request.h @@ -72,6 +72,6 @@ class UISliderRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h index 17d1f8a8ed..f4e4465568 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/ui_slider_response.h @@ -72,6 +72,6 @@ class UISliderResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UI_SLIDER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h index dc0166e33f..b352a3b273 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_request.h @@ -72,6 +72,6 @@ class UpdateAppListRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h index 2e3bb79233..a31621dbd5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_app_list_response.h @@ -72,6 +72,6 @@ class UpdateAppListResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_APP_LIST_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h index c4c9f11e06..db4f265a9f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_request.h @@ -35,8 +35,8 @@ #include "application_manager/commands/request_to_hmi.h" #include "application_manager/event_engine/event_observer.h" -#include "utils/lock.h" #include "utils/conditional_variable.h" +#include "utils/lock.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -92,6 +92,6 @@ class UpdateDeviceListRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h index c33518a545..5f7afed2c3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_device_list_response.h @@ -72,6 +72,6 @@ class UpdateDeviceListResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h index e30b045fcb..3e001b2582 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_request.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_ -#include "application_manager/commands/request_to_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/request_to_hmi.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class UpdateSDLRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h index f71921ea3a..a6fc917872 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/update_sdl_response.h @@ -72,6 +72,6 @@ class UpdateSDLResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_UPDATE_SDL_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h index 0abb37adbc..b40245256e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_request.h @@ -72,6 +72,6 @@ class VRAddCommandRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h index 5f9c99a483..dc123bc82f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_add_command_response.h @@ -72,6 +72,6 @@ class VRAddCommandResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_ADD_COMMAND_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h index 4af28cb542..418842395d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h @@ -73,6 +73,6 @@ class VRChangeRegistrationRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h index a80df0968b..08f3dfa501 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h @@ -74,6 +74,6 @@ class VRChangeRegistrationResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_CHANGE_REGISTRATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h index 0ed9521ec5..2e1aa7c0d1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h @@ -72,6 +72,6 @@ class VRDeleteCommandRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h index 63efcab355..a7d45ed5ea 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h @@ -72,6 +72,6 @@ class VRDeleteCommandResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_DELETE_COMMAND_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h index f8ac83af58..254d00452f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h @@ -72,6 +72,6 @@ class VRGetCapabilitiesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h index 9c9bb55b1b..781e38cda2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h @@ -72,6 +72,6 @@ class VRGetCapabilitiesResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_CAPABILITIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h index e764cbef91..441795cfb5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_request.h @@ -72,6 +72,6 @@ class VRGetLanguageRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h index 470fe3ebdc..2bc08e5173 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_language_response.h @@ -72,6 +72,6 @@ class VRGetLanguageResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_LANGUAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h index 8d9e9e2a61..ad87415a87 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h @@ -73,6 +73,6 @@ class VRGetSupportedLanguagesRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h index 735844cd99..16a67d6468 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h @@ -74,6 +74,6 @@ class VRGetSupportedLanguagesResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_GET_SUPPORTED_LANGUAGES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h index 0b580f6c1d..2dba80065a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h @@ -89,6 +89,6 @@ class VRIsReadyRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h index 42c47f5077..f901147094 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h @@ -72,6 +72,6 @@ class VRIsReadyResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h index 6f206c010f..8cbd2e346e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h @@ -73,6 +73,6 @@ class VRPerformInteractionRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h index 9e8599419f..60cb4cb80c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h @@ -74,6 +74,6 @@ class VRPerformInteractionResponse } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VR_PERFORM_INTERACTION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h index 745fb3ec18..8cac0d686d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_request.h @@ -164,6 +164,6 @@ class AddCommandRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h index fb3f172b0b..811bda2cc7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_command_response.h @@ -73,6 +73,6 @@ class AddCommandResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h index 37ba9a5990..2da94ae67e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h @@ -92,6 +92,6 @@ class AddSubMenuRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h index 253556f899..ba15f04cd0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h @@ -73,6 +73,6 @@ class AddSubMenuResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h index 93f716cb65..8b7e86fb3f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h @@ -105,6 +105,6 @@ class AlertManeuverRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h index 8b21aa64eb..2f21fadb54 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h @@ -73,6 +73,6 @@ class AlertManeuverResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h index e34653daf4..dfc7b73487 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_request.h @@ -149,6 +149,6 @@ class AlertRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h index 4ae95fb979..51de24fd41 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/alert_response.h @@ -73,6 +73,6 @@ class AlertResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ALERT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h index bd5c34ebd1..01f20a68e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_request.h @@ -38,8 +38,8 @@ #include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/pending.h" -#include "utils/macro.h" #include "utils/custom_string.h" +#include "utils/macro.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -146,11 +146,11 @@ class ChangeRegistrationRequest std::string& ResponseInfo); /** - * @brief Predicate for using with CheckCoincidence method to compare with VR - * synonym SO - * - * @return TRUE if there is coincidence of VR, otherwise FALSE - */ + * @brief Predicate for using with CheckCoincidence method to compare with VR + * synonym SO + * + * @return TRUE if there is coincidence of VR, otherwise FALSE + */ struct CoincidencePredicateVR { CoincidencePredicateVR(const custom_str::CustomString& newItem) : newItem_(newItem) {} @@ -186,6 +186,6 @@ class ChangeRegistrationRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h index 4cb8c394c7..8c3b7f0be3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/change_registration_response.h @@ -75,6 +75,6 @@ class ChangeRegistrationResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h new file mode 100644 index 0000000000..b965e880b4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_request.h @@ -0,0 +1,85 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" +#include "sdl_rpc_plugin/sdl_rpc_plugin.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief CloseApplicationRequest command class + **/ +class CloseApplicationRequest : public app_mngr::commands::CommandRequestImpl { + public: + /** + * @brief CloseApplicationRequest class constructor + * + * @param message Incoming SmartObject message + **/ + CloseApplicationRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief CloseApplicationRequest class destructor + **/ + ~CloseApplicationRequest() OVERRIDE; + + /** + * @brief Execute command + **/ + void Run() OVERRIDE; + + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + void on_event(const app_mngr::event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(CloseApplicationRequest); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h new file mode 100644 index 0000000000..c7b649f4e9 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/close_application_response.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "sdl_rpc_plugin/sdl_rpc_plugin.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief CloseApplicationResponse command class + **/ +class CloseApplicationResponse + : public app_mngr::commands::CommandResponseImpl { + public: + /** + * @brief CloseApplicationResponse class constructor + * + * @param message Incoming SmartObject message + **/ + CloseApplicationResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief CloseApplicationResponse class destructor + **/ + ~CloseApplicationResponse() OVERRIDE; + + /** + * @brief Execute command + **/ + void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(CloseApplicationResponse); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CLOSE_APPLICATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h index 1ad1c07b2a..a1bc866347 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h @@ -162,11 +162,11 @@ class CreateInteractionChoiceSetRequest app_mngr::ApplicationConstSharedPtr app); /* - * @brief Predicate for using with CheckChoiceSet method to compare choice ID - *param - * - * return TRUE if there is coincidence of choice ID, otherwise FALSE - */ + * @brief Predicate for using with CheckChoiceSet method to compare choice ID + *param + * + * return TRUE if there is coincidence of choice ID, otherwise FALSE + */ struct CoincidencePredicateChoiceID { CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {} @@ -178,11 +178,11 @@ class CreateInteractionChoiceSetRequest }; /* - * @brief Predicate for using with CheckChoiceSet method to compare menu name - *param - * - * return TRUE if there is coincidence of menu name, otherwise FALSE - */ + * @brief Predicate for using with CheckChoiceSet method to compare menu name + *param + * + * return TRUE if there is coincidence of menu name, otherwise FALSE + */ struct CoincidencePredicateMenuName { CoincidencePredicateMenuName(const std::string& newItem) : newItem_(newItem) {} @@ -195,11 +195,11 @@ class CreateInteractionChoiceSetRequest }; /* - * @brief Predicate for using with CheckChoiceSet method to compare VR commands - *param - * - * return TRUE if there is coincidence of VR commands, otherwise FALSE - */ + * @brief Predicate for using with CheckChoiceSet method to compare VR + *commands param + * + * return TRUE if there is coincidence of VR commands, otherwise FALSE + */ struct CoincidencePredicateVRCommands { CoincidencePredicateVRCommands(const smart_objects::SmartObject& newItem) : newItem_(newItem) {} @@ -219,7 +219,7 @@ class CreateInteractionChoiceSetRequest * * return Return TRUE if there are similar VR synonyms in choice set, * otherwise FALSE - */ + */ bool compareSynonyms( const ns_smart_device_link::ns_smart_objects::SmartObject& choice1, const ns_smart_device_link::ns_smart_objects::SmartObject& choice2); @@ -232,7 +232,7 @@ class CreateInteractionChoiceSetRequest * * return Return TRUE if there are similar VR synonyms in choice set, * otherwise FALSE - */ + */ static bool compareStr( const ns_smart_device_link::ns_smart_objects::SmartObject& str1, const ns_smart_device_link::ns_smart_objects::SmartObject& str2); @@ -273,6 +273,6 @@ class CreateInteractionChoiceSetRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h index 76718bc2c3..0bfc0e5cdf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h @@ -75,6 +75,6 @@ class CreateInteractionChoiceSetResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h index a21b1928d0..45864ca3aa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_request.h @@ -114,6 +114,6 @@ class DeleteCommandRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h index f81f119792..a91012a934 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_command_response.h @@ -73,6 +73,6 @@ class DeleteCommandResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h index 02cd0086b6..8e4d63df4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_request.h @@ -78,6 +78,6 @@ class DeleteFileRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h index fbdc70c9bc..8fbc79ba9f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_file_response.h @@ -73,6 +73,6 @@ class DeleteFileResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h index 4dec11a67b..c1d8759962 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_ -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -90,6 +90,6 @@ class DeleteInteractionChoiceSetRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h index 0fce16ea9f..bd67f9c556 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h @@ -75,6 +75,6 @@ class DeleteInteractionChoiceSetResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h index c947fda78a..2f85065ee7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_ -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -104,6 +104,6 @@ class DeleteSubMenuRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h index e5b0c58a34..c569d61258 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h @@ -73,6 +73,6 @@ class DeleteSubMenuResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h index 3e313602c7..750288f5e8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_request.h @@ -61,13 +61,13 @@ class DialNumberRequest : public app_mngr::commands::CommandRequestImpl { ~DialNumberRequest() OVERRIDE; /** - * @brief Initialize request params + * @brief Initialize request params **/ bool Init() OVERRIDE; /** - * @brief Execute command - **/ + * @brief Execute command + **/ void Run() OVERRIDE; /** @@ -90,6 +90,6 @@ class DialNumberRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h index 6181231458..9c47537c6f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/dial_number_response.h @@ -73,6 +73,6 @@ class DialNumberResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h index 319a20958e..1c18de3237 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h @@ -80,6 +80,6 @@ class EndAudioPassThruRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h index e2a667f272..1003d9d2d7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h @@ -74,6 +74,6 @@ class EndAudioPassThruResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h index b780daaf03..6516d3cef1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/generic_response.h @@ -72,6 +72,6 @@ class GenericResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GENERIC_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h new file mode 100644 index 0000000000..3d74a80dc2 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class GetCloudAppPropertiesRequest + : public app_mngr::commands::CommandRequestImpl { + public: + GetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~GetCloudAppPropertiesRequest(); + virtual void Run(); + virtual void on_event(const app_mngr::event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(GetCloudAppPropertiesRequest); +}; // GetCloudAppPropertiesRequest + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h new file mode 100644 index 0000000000..f716c7dcb5 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class GetCloudAppPropertiesResponse + : public app_mngr::commands::CommandResponseImpl { + public: + GetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~GetCloudAppPropertiesResponse(); + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(GetCloudAppPropertiesResponse); + +}; // GetCloudAppPropertiesResponse + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_CLOUD_APP_PROPERTIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h new file mode 100644 index 0000000000..d4182ea004 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_request.h @@ -0,0 +1,87 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" +#include "application_manager/event_engine/event.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief GetFileRequest command class + **/ +class GetFileRequest : public app_mngr::commands::CommandRequestImpl { + public: + /** + * @brief GetFileRequest class constructor + * + * @param message Incoming SmartObject message + **/ + GetFileRequest(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief GetFileRequest class destructor + **/ + virtual ~GetFileRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + bool GetFilePath(std::string& file_path, bool& forward_to_hmi); + + void on_event(const app_mngr::event_engine::Event& event) FINAL; + + private: + std::string file_name_; + mobile_apis::FileType::eType file_type_; + uint32_t length_; + uint32_t offset_; + + DISALLOW_COPY_AND_ASSIGN(GetFileRequest); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h new file mode 100644 index 0000000000..bc191d224c --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_file_response.h @@ -0,0 +1,77 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +/** + * @brief GetFileResponse command class + **/ +class GetFileResponse : public app_mngr::commands::CommandResponseImpl { + public: + /** + * @brief GetFileResponse class constructor + * + * @param message Incoming SmartObject message + **/ + GetFileResponse(const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle); + + /** + * @brief GetFileResponse class destructor + **/ + virtual ~GetFileResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(GetFileResponse); +}; + +} // namespace commands + +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_FILE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h index b8da061870..a5d1611f02 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_request.h @@ -61,7 +61,7 @@ class GetSystemCapabilityRequest DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest); }; // GetSystemCapabilityRequest -} // commands -} // application_manager +} // namespace commands +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h index 9fa954c89f..61079b3ac2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_system_capability_response.h @@ -60,7 +60,7 @@ class GetSystemCapabilityResponse DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse); }; // GetSystemCapabilityResponse -} // commands -} // application_manager +} // namespace commands +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h index 7197874475..ec656820e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_request.h @@ -76,6 +76,6 @@ class GetWayPointsRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h index bb480a7ac0..1b8f055e9c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/get_way_points_response.h @@ -71,6 +71,6 @@ class GetWayPointsResponse : public app_mngr::commands::CommandResponseImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h index 53d75819f8..d98fa433b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_request.h @@ -73,6 +73,6 @@ class ListFilesRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h index 1b3cdf1b02..d259b27ecf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/list_files_response.h @@ -73,6 +73,6 @@ class ListFilesResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h index ba01d4bb28..28508d386c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_app_interface_unregistered_notification.h @@ -75,6 +75,6 @@ class OnAppInterfaceUnregisteredNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h index e3410bd873..a6de6b929c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h @@ -77,6 +77,6 @@ class OnAudioPassThruNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h index 6afdc0e1cf..afde9bac92 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_event_notification.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_ -#include "application_manager/commands/command_notification_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_notification_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -87,6 +87,6 @@ class OnButtonEventNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h index fe9bc449be..57fda49be7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_button_press_notification.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_ -#include "application_manager/commands/command_notification_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_notification_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -86,6 +86,6 @@ class OnButtonPressNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h index 367b280e73..76ee0b4052 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_command_notification.h @@ -77,6 +77,6 @@ class OnCommandNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h index 82e6097d84..9c7fb5e91b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h @@ -79,6 +79,6 @@ class OnDriverDistractionNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h index 76c9cf34c5..b62f74e199 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h @@ -76,6 +76,6 @@ class OnHashChangeNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h index 0e1919676b..ef040de3de 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h @@ -74,6 +74,6 @@ class OnHMIStatusNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h index 12e3b54be9..6f3ef40076 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_ -#include "application_manager/commands/command_notification_from_mobile_impl.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/command_notification_from_mobile_impl.h" #include "interfaces/MOBILE_API.h" #include "utils/macro.h" @@ -77,6 +77,6 @@ class OnHMIStatusNotificationFromMobile }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h index d34815ff2f..52f6e5d487 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h @@ -78,6 +78,6 @@ class OnKeyBoardInputNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_KEYBOARD_INPUT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h index b234b93796..1bc1e94b1f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_language_change_notification.h @@ -75,6 +75,6 @@ class OnLanguageChangeNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h index f586a0d36c..eca3cebf31 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h @@ -75,6 +75,6 @@ class OnPermissionsChangeNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h new file mode 100644 index 0000000000..f29c7dcf2b --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h @@ -0,0 +1,84 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_ + +#include <vector> +#include "application_manager/commands/command_notification_impl.h" +#include "policy/policy_table/enums.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +namespace mobile { + +/** + * @brief OnSystemCapabilityUpdatedNotification class + **/ +class OnSystemCapabilityUpdatedNotification + : public app_mngr::commands::CommandNotificationImpl { + public: + typedef std::vector<uint8_t> BinaryMessage; + /** + * @brief OnSystemCapabilityUpdatedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnSystemCapabilityUpdatedNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + + /** + * @brief OnSystemCapabilityUpdatedNotification class destructor + **/ + ~OnSystemCapabilityUpdatedNotification() OVERRIDE; + + /** + * @brief Execute command + **/ + void Run() OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(OnSystemCapabilityUpdatedNotification); +}; + +} // namespace mobile +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_CAPABILITY_UPDATED_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h index b369ad38f2..a0148a4abd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_system_request_notification.h @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_ +#include <vector> #include "application_manager/commands/command_notification_impl.h" #include "policy/policy_table/enums.h" -#include <vector> namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -88,6 +88,6 @@ class OnSystemRequestNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h index 39b12fea15..cbb7525092 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h @@ -75,6 +75,6 @@ class OnTBTClientStateNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h index 858759b793..48872d9b27 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h @@ -77,6 +77,6 @@ class OnTouchEventNotification } // namespace mobile } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_TOUCH_EVENT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h index c379fceb02..ed7cbccf4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h @@ -71,5 +71,5 @@ class OnWayPointChangeNotification }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h index 1a4c248a02..434b6de028 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h @@ -35,8 +35,8 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_ #include "application_manager/commands/command_request_impl.h" -#include "utils/macro.h" #include "interfaces/MOBILE_API.h" +#include "utils/macro.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -184,6 +184,6 @@ class PerformAudioPassThruRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h index 6654762067..300ea6531f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h @@ -75,6 +75,6 @@ class PerformAudioPassThruResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h index 2d4cbc9afc..0572679c85 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_request.h @@ -36,8 +36,8 @@ #include <string> -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -246,6 +246,6 @@ class PerformInteractionRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h index 6bb9135dcc..113757a1ad 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/perform_interaction_response.h @@ -75,6 +75,6 @@ class PerformInteractionResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h index 2783280f87..b3e04f7796 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_request.h @@ -34,9 +34,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_ +#include "application_manager/application_manager.h" #include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" -#include "application_manager/application_manager.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -76,11 +76,11 @@ class PutFileRequest : public app_mngr::commands::CommandRequestImpl { mobile_apis::FileType::eType file_type_; bool is_persistent_file_; - void SendOnPutFileNotification(); + void SendOnPutFileNotification(bool is_system_file); DISALLOW_COPY_AND_ASSIGN(PutFileRequest); }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h index 22dbf1b5d5..348a217eba 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/put_file_response.h @@ -73,6 +73,6 @@ class PutFileResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h index 542fdac5f8..8a80db9cdf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_request.h @@ -36,8 +36,8 @@ #include "application_manager/commands/command_request_impl.h" #include "application_manager/policies/policy_handler_interface.h" -#include "utils/macro.h" #include "utils/custom_string.h" +#include "utils/macro.h" namespace policy { struct DeviceInfo; @@ -124,11 +124,14 @@ class RegisterAppInterfaceRequest /** * @brief Sends OnAppRegistered notification to HMI * - *@param application_impl application with changed HMI status - * + * @param app application with changed HMI status + * @param resumption If true, resumption-related parameters will be sent to + *the HMI + * @param need_restore_vr If resumption is true, whether or not VR commands + *should be resumed **/ void SendOnAppRegisteredNotificationToHMI( - const app_mngr::Application& application_impl, + app_mngr::ApplicationConstSharedPtr app, bool resumption = false, bool need_restore_vr = false); /* @@ -141,18 +144,21 @@ class RegisterAppInterfaceRequest /* * @brief Check new application parameters (name, tts, vr) for * coincidence with already known parameters of registered applications + * @param out_duplicate_apps In the case other apps was found with duplicate + * names, this field will be filled with a list of said apps * * return SUCCESS if there is no coincidence of app.name/TTS/VR synonyms, * otherwise appropriate error code returns - */ - mobile_apis::Result::eType CheckCoincidence(); + */ + mobile_apis::Result::eType CheckCoincidence( + std::vector<app_mngr::ApplicationSharedPtr>& out_duplicate_apps); /* - * @brief Predicate for using with CheckCoincidence method to compare with VR - * synonym SO - * - * return TRUE if there is coincidence of VR, otherwise FALSE - */ + * @brief Predicate for using with CheckCoincidence method to compare with VR + * synonym SO + * + * return TRUE if there is coincidence of VR, otherwise FALSE + */ struct CoincidencePredicateVR { CoincidencePredicateVR(const custom_str::CustomString& newItem) : newItem_(newItem) {} @@ -219,6 +225,6 @@ class RegisterAppInterfaceRequest } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h index d591d67794..2a6e847067 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/register_app_interface_response.h @@ -79,6 +79,6 @@ class RegisterAppInterfaceResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_REGISTER_APP_INTERFACE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h index 6f7e330bf5..880fced6ba 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_request.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_ -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -144,6 +144,6 @@ class ResetGlobalPropertiesRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h index b33ef41426..6d9b604b41 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h @@ -75,6 +75,6 @@ class ResetGlobalPropertiesResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_RESET_GLOBAL_PROPERTIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h index a641fa0cd4..58b7b4491a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_request.h @@ -85,6 +85,6 @@ class ScrollableMessageRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h index 8bc8a36363..e5c668b424 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/scrollable_message_response.h @@ -68,6 +68,6 @@ class ScrollableMessageResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SCROLLABLE_MESSAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h index e3ed6ef28b..2f00b58d9e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h @@ -34,8 +34,8 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_ #include <string> -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/command_request_impl.h" #include "application_manager/event_engine/event.h" #include "smart_objects/smart_object.h" @@ -83,6 +83,6 @@ class SendHapticDataRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h index 53e8766241..515fe3f74d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h @@ -72,6 +72,6 @@ class SendHapticDataResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h index 6626da4c9d..5a0dc67f35 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_request.h @@ -75,10 +75,10 @@ class SendLocationRequest : public app_mngr::commands::CommandRequestImpl { private: /** - * @brief CheckFieldsCompatibility checks if fields are compatible with each - * other. - * @return true if compatible, otherwise return false - */ + * @brief CheckFieldsCompatibility checks if fields are compatible with each + * other. + * @return true if compatible, otherwise return false + */ bool CheckFieldsCompatibility(); /** @@ -95,6 +95,6 @@ class SendLocationRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h index cb461f9a60..a2e9d1eb0a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/send_location_response.h @@ -66,6 +66,6 @@ class SendLocationResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SEND_LOCATION_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h index 1075999af9..86ca2fb126 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_request.h @@ -111,6 +111,6 @@ class SetAppIconRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h index e4ce0725dc..a9b203bec7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_app_icon_response.h @@ -73,6 +73,6 @@ class SetAppIconResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h new file mode 100644 index 0000000000..a3a3ea12f9 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class SetCloudAppPropertiesRequest + : public app_mngr::commands::CommandRequestImpl { + public: + SetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesRequest(); + virtual void Run(); + virtual void on_event(const app_mngr::event_engine::Event& event); + + private: + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesRequest); +}; // SetCloudAppPropertiesRequest + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_REQUEST_H_
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h new file mode 100644 index 0000000000..df71a2aaf5 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h @@ -0,0 +1,31 @@ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" + +namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; + +namespace commands { + +class SetCloudAppPropertiesResponse + : public app_mngr::commands::CommandResponseImpl { + public: + SetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler); + virtual ~SetCloudAppPropertiesResponse(); + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(SetCloudAppPropertiesResponse); + +}; // SetCloudAppPropertiesResponse + +} // namespace commands +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_CLOUD_APP_PROPERTIES_RESPONSE_H_
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h index 4bd800988c..2f9c0946d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_request.h @@ -80,6 +80,6 @@ class SetDisplayLayoutRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h index 73f57fc187..7b43613ac4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_display_layout_response.h @@ -74,6 +74,6 @@ class SetDisplayLayoutResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_DISPLAY_LAYOUT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h index 674de4731a..e84bf6e5e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_request.h @@ -33,9 +33,9 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_ #include <string> +#include "application_manager/application.h" #include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" -#include "application_manager/application.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -153,6 +153,6 @@ class SetGlobalPropertiesRequest }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h index 778dc9b7d7..f8d8117250 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_global_properties_response.h @@ -75,6 +75,6 @@ class SetGlobalPropertiesResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_GLOBAL_PROPERTIES_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h index ef674f1c38..adced13d73 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h @@ -81,6 +81,6 @@ class SetMediaClockRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h index 2fb3f25839..240d1be8d1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h @@ -69,6 +69,6 @@ class SetMediaClockTimerResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SET_MEDIA_CLOCK_TIMER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h index cadc87cef6..7694070a72 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h @@ -89,6 +89,6 @@ class ShowConstantTBTRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h index 4129a7640e..4b2136ad11 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_constant_tbt_response.h @@ -73,6 +73,6 @@ class ShowConstantTBTResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_CONSTANT_TBT_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h index 2277a38f11..586004b783 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_request.h @@ -98,6 +98,6 @@ class ShowRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h index c78820a26e..97843c2148 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/show_response.h @@ -67,6 +67,6 @@ class ShowResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SHOW_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h index f1e06e8d8d..5dbcbb7d41 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_request.h @@ -91,6 +91,6 @@ class SliderRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h index 2a93103632..842e52f595 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/slider_response.h @@ -67,6 +67,6 @@ class SliderResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SLIDER_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h index d6d47bb869..68e35fcd1d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_request.h @@ -93,6 +93,6 @@ class SpeakRequest : public app_mngr::commands::CommandRequestImpl { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h index 30eda07810..02b7baae54 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/speak_response.h @@ -67,6 +67,6 @@ class SpeakResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SPEAK_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h index 011c0aa359..2b9887daad 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_request.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_ -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application_impl.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" namespace sdl_rpc_plugin { @@ -98,6 +98,6 @@ class SubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h index 28e942ec17..b42ccb91e1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_button_response.h @@ -73,6 +73,6 @@ class SubscribeButtonResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h index 6105f08750..8b88a1c884 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h @@ -80,8 +80,8 @@ class SubscribeWayPointsRequest DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest); }; -} // commands +} // namespace commands -} // application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h index cd27e96d25..4039f21f8e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h @@ -71,8 +71,8 @@ class SubscribeWayPointsResponse DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse); }; -} // commands +} // namespace commands -} // application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h index c34db34506..eb2398f279 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_request.h @@ -35,8 +35,8 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_ #include <string> -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/command_request_impl.h" #include "application_manager/event_engine/event.h" #include "smart_objects/smart_object.h" @@ -93,6 +93,6 @@ class SystemRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h index afbd557d12..5c3f69d757 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/system_response.h @@ -72,6 +72,6 @@ class SystemResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h index 172f934a15..0bc01f2aaa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h @@ -80,6 +80,6 @@ class UnregisterAppInterfaceRequest } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h index 13d8b549e8..d1ac004ca0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h @@ -76,6 +76,6 @@ class UnregisterAppInterfaceResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNREGISTER_APP_INTERFACE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h index 8cbaafbfe1..51c10642cf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h @@ -84,6 +84,6 @@ class UnsubscribeButtonRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h index 1db067acce..efd5478363 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h @@ -74,6 +74,6 @@ class UnsubscribeButtonResponse }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_BUTTON_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h index fe14f5c7eb..e83e9b7509 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h @@ -79,8 +79,8 @@ class UnsubscribeWayPointsRequest DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsRequest); }; -} // commands +} // namespace commands -} // application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h index c578bf9f99..9ab167284a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h @@ -71,8 +71,8 @@ class UnsubscribeWayPointsResponse DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse); }; -} // commands +} // namespace commands -} // application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h index 8766339f96..e1e5df2289 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_request.h @@ -97,6 +97,6 @@ class UpdateTurnListRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h index 59d3bf0b2c..80e143644f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/update_turn_list_response.h @@ -73,6 +73,6 @@ class UpdateTurnListResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UPDATE_TURN_LIST_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h new file mode 100644 index 0000000000..935716aa30 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/extensions/system_capability_app_extension.h @@ -0,0 +1,83 @@ +/* + Copyright (c) 2018, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_EXTENSIONS_SYSTEM_CAPABILITY_APP_EXTENSION_H +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_EXTENSIONS_SYSTEM_CAPABILITY_APP_EXTENSION_H +#include <application_manager/application_manager.h> +#include <set> +#include <string> +#include "sdl_rpc_plugin/sdl_rpc_plugin.h" + +namespace sdl_rpc_plugin { +class SDLRPCPlugin; + +namespace app_mngr_ = application_manager; + +typedef mobile_apis::SystemCapabilityType::eType SystemCapabilityType; +typedef std::set<mobile_apis::SystemCapabilityType::eType> + SystemCapabilitySubscriptions; + +class SystemCapabilityAppExtension : public app_mngr_::AppExtension { + public: + SystemCapabilityAppExtension(SDLRPCPlugin& plugin, + app_mngr_::Application& app); + virtual ~SystemCapabilityAppExtension(); + + bool SubscribeTo(const SystemCapabilityType system_capability_type); + + bool UnsubscribeFrom(const SystemCapabilityType system_capability_type); + + void UnsubscribeFromAll(); + + bool IsSubscribedTo(const SystemCapabilityType system_capability_type) const; + + SystemCapabilitySubscriptions Subscriptions(); + + void SaveResumptionData(ns_smart_device_link::ns_smart_objects::SmartObject& + resumption_data) OVERRIDE; + + void ProcessResumption( + const smart_objects::SmartObject& resumption_data) OVERRIDE; + + static const app_mngr_::AppExtensionUID SystemCapabilityAppExtensionUID; + + static SystemCapabilityAppExtension& ExtractExtension( + app_mngr_::Application& app); + + private: + SystemCapabilitySubscriptions subscribed_data_; + SDLRPCPlugin& plugin_; + app_mngr_::Application& app_; +}; +} // namespace sdl_rpc_plugin + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_EXTENSIONS_SYSTEM_CAPABILITY_APP_EXTENSION_H diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h index eee454fb00..95bb253120 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_ -#include "application_manager/command_factory.h" #include "application_manager/application_manager.h" +#include "application_manager/command_factory.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -70,6 +70,6 @@ class HMICommandFactory : public app_mngr::CommandFactory { DISALLOW_COPY_AND_ASSIGN(HMICommandFactory); }; -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_HMI_COMMAND_FACTORY_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h index f0840dde41..132b68aaec 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/mobile_command_factory.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_ -#include "application_manager/command_factory.h" #include "application_manager/application_manager.h" +#include "application_manager/command_factory.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -59,9 +59,16 @@ class MobileCommandFactory : public app_mngr::CommandFactory { private: app_mngr::CommandCreator& get_creator_factory( - mobile_apis::FunctionID::eType id, - mobile_apis::messageType::eType message_type, - app_mngr::commands::Command::CommandSource source) const; + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type, + const app_mngr::commands::Command::CommandSource source) const; + app_mngr::CommandCreator& get_command_creator( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type) const; + app_mngr::CommandCreator& get_notification_creator( + const mobile_apis::FunctionID::eType id) const; + app_mngr::CommandCreator& get_notification_from_mobile_creator( + const mobile_apis::FunctionID::eType id) const; app_mngr::ApplicationManager& application_manager_; app_mngr::rpc_service::RPCService& rpc_service_; @@ -70,6 +77,6 @@ class MobileCommandFactory : public app_mngr::CommandFactory { DISALLOW_COPY_AND_ASSIGN(MobileCommandFactory); }; -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_MOBILE_COMMAND_FACTORY_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h index 5b5f0ae49f..edbfe1bdc0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_command_factory.h @@ -36,11 +36,11 @@ #include <memory> #include "application_manager/application_manager.h" #include "application_manager/command_factory.h" -#include "sdl_rpc_plugin/hmi_command_factory.h" -#include "sdl_rpc_plugin/mobile_command_factory.h" -#include "application_manager/rpc_service.h" #include "application_manager/hmi_capabilities.h" #include "application_manager/policies/policy_handler_interface.h" +#include "application_manager/rpc_service.h" +#include "sdl_rpc_plugin/hmi_command_factory.h" +#include "sdl_rpc_plugin/mobile_command_factory.h" namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -69,5 +69,5 @@ class SDLCommandFactory : public app_mngr::CommandFactory { std::unique_ptr<HMICommandFactory> hmi_command_factory_; std::unique_ptr<MobileCommandFactory> mobile_command_factory_; }; -} +} // namespace sdl_rpc_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h index 6ae3a0b6bc..7d482709cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/sdl_rpc_plugin.h @@ -32,36 +32,39 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_SDL_RPC_PLUGIN_H -#include "application_manager/plugin_manager/rpc_plugin.h" #include "application_manager/command_factory.h" +#include "application_manager/plugin_manager/rpc_plugin.h" namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; namespace plugins = application_manager::plugin_manager; + +class SystemCapabilityAppExtension; + class SDLRPCPlugin : public plugins::RPCPlugin { // RPCPlugin interface public: - bool Init(application_manager::ApplicationManager& app_manager, - application_manager::rpc_service::RPCService& rpc_service, - application_manager::HMICapabilities& hmi_capabilities, + bool Init(app_mngr::ApplicationManager& app_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, policy::PolicyHandlerInterface& policy_handler) OVERRIDE; bool IsAbleToProcess( const int32_t function_id, - const application_manager::commands::Command::CommandSource - message_source) OVERRIDE; + const app_mngr::commands::Command::CommandSource message_source) OVERRIDE; std::string PluginName() OVERRIDE; - application_manager::CommandFactory& GetCommandFactory() OVERRIDE; - void OnPolicyEvent( - application_manager::plugin_manager::PolicyEvent event) OVERRIDE; - void OnApplicationEvent( - application_manager::plugin_manager::ApplicationEvent event, - application_manager::ApplicationSharedPtr application) OVERRIDE; + app_mngr::CommandFactory& GetCommandFactory() OVERRIDE; + void OnPolicyEvent(plugins::PolicyEvent event) OVERRIDE; + void OnApplicationEvent(plugins::ApplicationEvent event, + app_mngr::ApplicationSharedPtr application) OVERRIDE; private: + void ClearSubscriptions(app_mngr::ApplicationSharedPtr app); + std::unique_ptr<application_manager::CommandFactory> command_factory_; }; -} +} // namespace sdl_rpc_plugin extern "C" application_manager::plugin_manager::RPCPlugin* Create(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc index 19d01b594f..c6d181bf57 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_request.cc @@ -75,4 +75,4 @@ void ActivateAppRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc index d7e38c5d5b..b829ef711e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/activate_app_response.cc @@ -63,4 +63,4 @@ void ActivateAppResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc index 3e46bd353a..93999f704d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/add_statistics_info_notification.cc @@ -64,4 +64,4 @@ void AddStatisticsInfoNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc index b227dd79dc..68c7896a7f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_request.cc @@ -59,4 +59,4 @@ void AllowAllAppsRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc index 2fdf29a7dd..c2182f4853 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_all_apps_response.cc @@ -59,4 +59,4 @@ void AllowAllAppsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc index 0c6e5145c7..6b5af76fb1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_request.cc @@ -59,4 +59,4 @@ void AllowAppRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc index 4853c3764a..c62645c6c0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/allow_app_response.cc @@ -70,4 +70,4 @@ void AllowAppResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc new file mode 100644 index 0000000000..b021faefd8 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_request.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +BasicCommunicationCloseApplicationRequest:: + BasicCommunicationCloseApplicationRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +BasicCommunicationCloseApplicationRequest:: + ~BasicCommunicationCloseApplicationRequest() {} + +void BasicCommunicationCloseApplicationRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc new file mode 100644 index 0000000000..2e56271cf2 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_close_application_response.cc @@ -0,0 +1,65 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +BasicCommunicationCloseApplicationResponse:: + BasicCommunicationCloseApplicationResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +BasicCommunicationCloseApplicationResponse:: + ~BasicCommunicationCloseApplicationResponse() {} + +void BasicCommunicationCloseApplicationResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_CloseApplication); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc index c067debf36..e26753b3f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_get_system_time_response.cc @@ -62,4 +62,4 @@ void BasicCommunicationGetSystemTimeResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc index 0c39389116..361dc5fea6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_on_awake_sdl.cc @@ -79,4 +79,4 @@ void OnAwakeSDLNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc index 04e44a6979..052a40a888 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_request.cc @@ -58,4 +58,4 @@ void BasicCommunicationSystemRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc index 5f8221fdbe..0b052de88d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/basic_communication_system_response.cc @@ -63,4 +63,4 @@ void BasicCommunicationSystemResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc new file mode 100644 index 0000000000..b735cd9bdf --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_request.cc @@ -0,0 +1,62 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +BCGetFilePathRequest::BCGetFilePathRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : RequestToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +BCGetFilePathRequest::~BCGetFilePathRequest() {} + +void BCGetFilePathRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc new file mode 100644 index 0000000000..58cda68a2b --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/bc_get_file_path_response.cc @@ -0,0 +1,66 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h" +#include "application_manager/application_impl.h" +#include "application_manager/event_engine/event.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +BCGetFilePathResponse::BCGetFilePathResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : ResponseFromHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +BCGetFilePathResponse::~BCGetFilePathResponse() {} + +void BCGetFilePathResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + application_manager::event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_GetFilePath); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc index cf2fbd9761..6696689174 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_request.cc @@ -60,4 +60,4 @@ void ButtonGetCapabilitiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc index 863e179040..b6ab822c47 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/button_get_capabilities_response.cc @@ -68,10 +68,14 @@ void ButtonGetCapabilitiesResponse::Run() { hmi_capabilities.set_button_capabilities( (*message_)[strings::msg_params][hmi_response::capabilities]); - hmi_capabilities.set_preset_bank_capabilities( - (*message_)[strings::msg_params][hmi_response::preset_bank_capabilities]); + if ((*message_)[strings::msg_params].keyExists( + hmi_response::preset_bank_capabilities)) { + hmi_capabilities.set_preset_bank_capabilities( + (*message_)[strings::msg_params] + [hmi_response::preset_bank_capabilities]); + } } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc index 84a47b9deb..988794f668 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_request.cc @@ -58,4 +58,4 @@ void ClosePopupRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc index 25396af337..072e1960e9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/close_popup_response.cc @@ -58,4 +58,4 @@ void ClosePopupResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc index 0e09c14650..71782ef575 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_request.cc @@ -59,4 +59,4 @@ void DecryptCertificateRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc index 694298ed91..cf2a4d092c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/decrypt_certificate_response.cc @@ -64,5 +64,5 @@ void DecryptCertificateResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin #endif // EXTERNAL_PROPRIETARY_MODE diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc index 63f5c2e815..97b5109642 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_request.cc @@ -61,4 +61,4 @@ void DialNumberRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc index 6d37ece2bf..4ff6785052 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/dial_number_response.cc @@ -63,4 +63,4 @@ void DialNumberResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc index c06c90973d..8546252119 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_request.cc @@ -61,4 +61,4 @@ void GetSystemInfoRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc index aef428b39f..3dbdf528a5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_system_info_response.cc @@ -90,4 +90,4 @@ const SystemInfo GetSystemInfoResponse::GetSystemInfo( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc index ae375e4087..54a9633a37 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc @@ -31,10 +31,10 @@ */ #include "sdl_rpc_plugin/commands/hmi/get_urls.h" -#include "application_manager/message.h" #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" +#include "application_manager/message.h" #include "application_manager/policies/policy_handler.h" +#include "application_manager/rpc_service.h" #include "utils/helpers.h" namespace sdl_rpc_plugin { @@ -227,4 +227,4 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) { #endif // PROPRIETARY_MODE } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc index 57c925e08f..77d90ec8bb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls_response.cc @@ -60,4 +60,4 @@ void GetUrlsResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc index 39f7e61c06..b8c61ca902 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_request.cc @@ -59,4 +59,4 @@ void MixingAudioSupportedRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc index 26fa967844..089e56e598 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/mixing_audio_supported_response.cc @@ -60,4 +60,4 @@ void MixingAudioSupportedResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc index ae3695b68e..8390fea5bc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_request.cc @@ -59,4 +59,4 @@ void NaviAlertManeuverRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc index 6a6307038a..a1603f069d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_alert_maneuver_response.cc @@ -63,4 +63,4 @@ void NaviAlertManeuverResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc index a9698d36ab..371f47a759 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc @@ -79,8 +79,8 @@ void AudioStartStreamRequest::Run() { application_manager_.application_by_hmi_app(application_id()); if (!app) { LOG4CXX_ERROR(logger_, - "Applcation with hmi_app_id " << application_id() - << " does not exist"); + "Application with hmi_app_id " << application_id() + << " does not exist"); return; } SetAllowedToTerminate(false); @@ -189,4 +189,4 @@ void AudioStartStreamRequest::RetryStartSession() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc index 362a46cc19..61d49577f6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_response.cc @@ -60,4 +60,4 @@ void AudioStartStreamResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc index ba2b8c8157..a5d436f015 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_request.cc @@ -62,4 +62,4 @@ void AudioStopStreamRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc index 87ddc81696..98023ab571 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_stop_stream_response.cc @@ -56,4 +56,4 @@ void AudioStopStreamResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc index 77ef3e3369..edc4afe1e4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_request.cc @@ -59,4 +59,4 @@ void NaviGetWayPointsRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc index 0aad5e5724..0f0b652d01 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_get_way_points_response.cc @@ -63,4 +63,4 @@ void NaviGetWayPointsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc index 781b8d3045..15e5b46b36 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_request.cc @@ -84,4 +84,4 @@ void NaviIsReadyRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc index b4e64e2a3e..073513eda9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_is_ready_response.cc @@ -58,4 +58,4 @@ void NaviIsReadyResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc index a10f61310d..360870e21c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_request.cc @@ -59,4 +59,4 @@ void NaviSendLocationRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc index f93e2e17c3..dc60f2fbf0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_send_location_response.cc @@ -61,4 +61,4 @@ void NaviSendLocationResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc index 5e4426bd20..764315f37f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_request.cc @@ -65,9 +65,9 @@ void NaviSetVideoConfigRequest::Run() { ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "Application with hmi_app_id " << application_id() - << "does not exist"); + LOG4CXX_ERROR( + logger_, + "Application with hmi_app_id " << application_id() << "does not exist"); return; } @@ -100,9 +100,9 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response"); result = true; } else { - LOG4CXX_DEBUG(logger_, - "Received SetVideoConfig failure response (" << event.id() - << ")"); + LOG4CXX_DEBUG( + logger_, + "Received SetVideoConfig failure response (" << event.id() << ")"); result = false; if (message[strings::msg_params].keyExists(strings::rejected_params)) { const smart_objects::SmartArray* list = @@ -153,4 +153,4 @@ void NaviSetVideoConfigRequest::onTimeOut() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc index c5f1c5307f..e4a30c9da5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_set_video_config_response.cc @@ -61,4 +61,4 @@ void NaviSetVideoConfigResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc index 22d604ab0d..95dd4561fc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_request.cc @@ -59,4 +59,4 @@ void NaviShowConstantTBTRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc index d2ff26b645..f73099d29a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_show_constant_tbt_response.cc @@ -63,4 +63,4 @@ void NaviShowConstantTBTResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc index f3d971acba..7f643d6130 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc @@ -79,9 +79,9 @@ void NaviStartStreamRequest::Run() { ApplicationSharedPtr app = application_manager_.application_by_hmi_app(application_id()); if (!app) { - LOG4CXX_ERROR(logger_, - "Applcation with hmi_app_id " << application_id() - << "does not exist"); + LOG4CXX_ERROR( + logger_, + "Application with hmi_app_id " << application_id() << "does not exist"); return; } SetAllowedToTerminate(false); @@ -190,4 +190,4 @@ void NaviStartStreamRequest::RetryStartSession() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc index f09a334f51..eafd81148a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_response.cc @@ -60,4 +60,4 @@ void NaviStartStreamResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc index 3e27692d62..ad09b0aee1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_request.cc @@ -62,4 +62,4 @@ void NaviStopStreamRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc index 61b8d5a1e2..ff8c0bddff 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_stop_stream_response.cc @@ -56,4 +56,4 @@ void NaviStopStreamResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc index a4445ebce8..ba29f552b7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_request.cc @@ -59,4 +59,4 @@ void NaviSubscribeWayPointsRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc index ae5f236f6f..ddf8f75e58 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_subscribe_way_points_response.cc @@ -64,4 +64,4 @@ void NaviSubscribeWayPointsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc index ec22c93d8f..d3c998cfdf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_request.cc @@ -59,4 +59,4 @@ void NaviUnsubscribeWayPointsRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc index c084bd52d3..beed29e1e2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_unsubscribe_way_points_response.cc @@ -32,8 +32,8 @@ #include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h" #include "application_manager/event_engine/event.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -65,4 +65,4 @@ void NaviUnsubscribeWayPointsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc index 9c507c3637..a8a258b1c0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_request.cc @@ -59,4 +59,4 @@ void NaviUpdateTurnListRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc index eb232e6d01..a2f737df38 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_update_turn_list_response.cc @@ -63,4 +63,4 @@ void NaviUpdateTurnListResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc index 398c2dac30..204cc7d347 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_allow_sdl_functionality_notification.cc @@ -66,4 +66,4 @@ void OnAllowSDLFunctionalityNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc index 189596c58a..e882020f8b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_activated_notification.cc @@ -64,4 +64,4 @@ void OnAppActivatedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc index ee45f9bf1e..18b796eaa8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_deactivated_notification.cc @@ -66,4 +66,4 @@ void OnAppDeactivatedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc index e13299ece7..a1eb412c66 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_changed_notification.cc @@ -58,4 +58,4 @@ void OnAppPermissionChangedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc index cf83c48a5a..0033b392d2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc @@ -32,12 +32,12 @@ */ #include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h" -#include "application_manager/application_manager.h" -#include "application_manager/policies/policy_handler.h" -#include "application_manager/message_helper.h" #include <algorithm> #include <functional> #include <string> +#include "application_manager/application_manager.h" +#include "application_manager/message_helper.h" +#include "application_manager/policies/policy_handler.h" #include "policy/policy_types.h" #include "smart_objects/smart_object.h" @@ -178,5 +178,5 @@ void OnAppPermissionConsentNotification::Run() { policy_handler_.OnAppPermissionConsent(connection_key, permission_consent); #endif } -} // commands -} // namespace application_manager +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc index 24c5a94272..51c3125921 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_registered_notification.cc @@ -64,4 +64,4 @@ void OnAppRegisteredNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc index 001b9fa5e0..07aadada81 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_unregistered_notification.cc @@ -73,4 +73,4 @@ void OnAppUnregisteredNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc index e2cd6d2cbf..d9c1120409 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_audio_data_streaming_notification.cc @@ -58,4 +58,4 @@ void OnAudioDataStreamingNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc new file mode 100644 index 0000000000..37dca47793 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_bc_system_capability_updated_notification.cc @@ -0,0 +1,171 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h" + +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/HMI_API.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +OnBCSystemCapabilityUpdatedNotification:: + OnBCSystemCapabilityUpdatedNotification( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : NotificationToHMI(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +OnBCSystemCapabilityUpdatedNotification:: + ~OnBCSystemCapabilityUpdatedNotification() {} + +void OnBCSystemCapabilityUpdatedNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, + "Sending BasicCommunication.OnSystemCapabilityUpdated " + "Notification to HMI"); + + smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + + hmi_apis::Common_SystemCapabilityType::eType system_capability_type = + static_cast<hmi_apis::Common_SystemCapabilityType::eType>( + msg_params[strings::system_capability] + [strings::system_capability_type] + .asInt()); + switch (system_capability_type) { + case hmi_apis::Common_SystemCapabilityType::NAVIGATION: { + smart_objects::SmartObject nav_capability(smart_objects::SmartType_Map); + bool has_nav_capability = false; + if (hmi_capabilities_.navigation_capability()) { + has_nav_capability = true; + nav_capability = *hmi_capabilities_.navigation_capability(); + } + has_nav_capability = application_manager_.GetAppServiceManager() + .UpdateNavigationCapabilities(nav_capability) || + has_nav_capability; + + if (has_nav_capability) { + msg_params[strings::system_capability][strings::navigation_capability] = + nav_capability; + } else { + return; + } + break; + } + case hmi_apis::Common_SystemCapabilityType::PHONE_CALL: { + if (hmi_capabilities_.phone_capability()) { + msg_params[strings::system_capability][strings::phone_capability] = + *hmi_capabilities_.phone_capability(); + } else { + return; + } + break; + } + case hmi_apis::Common_SystemCapabilityType::REMOTE_CONTROL: { + if (!hmi_capabilities_.is_rc_cooperating()) { + return; + } + if (hmi_capabilities_.rc_capability()) { + msg_params[strings::system_capability][strings::rc_capability] = + *hmi_capabilities_.rc_capability(); + } else { + return; + } + break; + } + case hmi_apis::Common_SystemCapabilityType::VIDEO_STREAMING: + if (hmi_capabilities_.video_streaming_capability()) { + msg_params[strings::system_capability] + [strings::video_streaming_capability] = + *hmi_capabilities_.video_streaming_capability(); + } else { + return; + } + break; + case hmi_apis::Common_SystemCapabilityType::APP_SERVICES: { + auto all_services = + application_manager_.GetAppServiceManager().GetAllServiceRecords(); + auto app_service_caps = + MessageHelper::CreateAppServiceCapabilities(all_services); + + smart_objects::SmartArray* app_services = + app_service_caps[strings::app_services].asArray(); + smart_objects::SmartObject& updated_capabilities = + msg_params[strings::system_capability] + [strings::app_services_capabilities][strings::app_services]; + for (size_t i = 0; i < updated_capabilities.length(); i++) { + std::string service_id = + updated_capabilities[i][strings::updated_app_service_record] + [strings::service_id] + .asString(); + auto matching_service_predicate = + [&service_id]( + const smart_objects::SmartObject& app_service_capability) { + return service_id == + app_service_capability[strings::updated_app_service_record] + [strings::service_id] + .asString(); + }; + + auto it = std::find_if(app_services->begin(), + app_services->end(), + matching_service_predicate); + if (it != app_services->end()) { + LOG4CXX_DEBUG( + logger_, + "Replacing updated record with service_id " << service_id); + app_services->erase(it); + } + app_services->push_back(updated_capabilities[i]); + } + msg_params[strings::system_capability] + [strings::app_services_capabilities] = app_service_caps; + break; + } + default: + return; + } + SendNotification(); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc index 1f052b865b..f25e6202cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_event_notification.cc @@ -67,4 +67,4 @@ void OnButtonEventNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc index 6c5d8f5a43..fee6b1b485 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_press_notification.cc @@ -33,8 +33,8 @@ #include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h" #include "application_manager/application_impl.h" -#include "utils/logger.h" #include "application_manager/event_engine/event.h" +#include "utils/logger.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -69,4 +69,4 @@ void OnButtonPressNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc index 70ff1c3fad..4ac752d6c5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_button_subscription_notification.cc @@ -63,4 +63,4 @@ void OnButtonSubscriptionNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc index 2c4f9a1ccc..f27c1fe5e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_chosen_notification.cc @@ -63,4 +63,4 @@ void OnDeviceChosenNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc index 307dccd09b..9ddd822b1c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_device_state_changed_notification.cc @@ -30,12 +30,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h" +#include <algorithm> #include "application_manager/application_manager.h" #include "application_manager/message_helper.h" -#include "interfaces/HMI_API.h" #include "encryption/hashing.h" +#include "interfaces/HMI_API.h" namespace { // TODO(AOleynik) : replace this !!! @@ -72,7 +72,7 @@ std::string convert_to_bt_mac(std::string& deviceInternalId) { return bt_mac; } -} +} // namespace namespace sdl_rpc_plugin { using namespace application_manager; @@ -121,4 +121,4 @@ void OnDeviceStateChangedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc index a5fb9b206e..2f3ee60a16 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <set> #include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h" +#include <set> #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -90,7 +90,7 @@ struct OnDriverDistractionProcessor { ApplicationManager& application_manager_; std::string stringified_function_id_; }; -} +} // namespace OnDriverDistractionNotification::OnDriverDistractionNotification( const application_manager::commands::MessageSharedPtr& message, @@ -139,4 +139,4 @@ void OnDriverDistractionNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc index cd3f2c23e6..f6ea22ae34 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_event_changed_notification.cc @@ -61,4 +61,4 @@ void OnEventChangedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc index 9d250d288e..4c168f9eff 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc @@ -32,13 +32,13 @@ #include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h" +#include <signal.h> #include <sys/types.h> #include <unistd.h> -#include <signal.h> #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" #include "application_manager/resumption/resume_ctrl.h" +#include "application_manager/rpc_service.h" #include "interfaces/HMI_API.h" namespace sdl_rpc_plugin { @@ -122,4 +122,4 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc index 681390fbf4..11647e2140 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc @@ -33,11 +33,11 @@ #include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h" #include "application_manager/application_impl.h" -#include "application_manager/state_controller.h" #include "application_manager/message_helper.h" #include "application_manager/rpc_service.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/state_controller.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -106,6 +106,13 @@ void OnExitApplicationNotification::Run() { application_manager_.UnregisterApplication(app_id, Result::SUCCESS); return; } +#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + case Common_ApplicationExitReason::CLOSE_CLOUD_CONNECTION: { + application_manager_.DisconnectCloudApp(app_impl); + break; + } +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT + default: { LOG4CXX_WARN(logger_, "Unhandled reason"); return; @@ -122,4 +129,4 @@ void OnExitApplicationNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc index ec680c667d..e1f0e2b104 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_file_removed_notification.cc @@ -59,4 +59,4 @@ void OnFileRemovedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc index c74dd70c84..2e8f15387f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_find_applications.cc @@ -59,4 +59,4 @@ void OnFindApplications::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc index 9ff1851e3f..9c2c68989f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ignition_cycle_over_notification.cc @@ -59,4 +59,4 @@ void OnIgnitionCycleOverNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc index 20f20ece08..f611b81764 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_tbt_client_state_notification.cc @@ -64,4 +64,4 @@ void OnNaviTBTClientStateNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc index fa8819ca5b..2a1a9c29fb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_navi_way_point_change_notification.cc @@ -60,4 +60,4 @@ void OnNaviWayPointChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc index e069bea740..67352fbc4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_policy_update.cc @@ -57,4 +57,4 @@ void OnPolicyUpdate::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc index 1524aa9ea2..441e36a385 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_put_file_notification.cc @@ -59,4 +59,4 @@ void OnPutFileNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc index 76c9115662..da3612b043 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ready_notification.cc @@ -62,4 +62,4 @@ void OnReadyNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc index 1eaef0b5e1..4a8c8df0ee 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_received_policy_update.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" +#include <string> #include "application_manager/application_manager.h" #include "utils/file_system.h" @@ -74,4 +74,4 @@ void OnReceivedPolicyUpdate::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc index 60699e5b9c..dbef717539 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_record_start_notification.cc @@ -59,4 +59,4 @@ void OnRecordStartdNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc index 9f8a713ffe..11d549655e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_resume_audio_source_notification.cc @@ -59,4 +59,4 @@ void OnResumeAudioSourceNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc index 65879edce6..d0c584c66c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_close_notification.cc @@ -59,4 +59,4 @@ void OnSDLCloseNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc index cf8feb4ca1..314a9e8f71 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_consent_needed_notification.cc @@ -59,4 +59,4 @@ void OnSDLConsentNeededNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc index 0ac4afd4d2..5db38d070b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_sdl_persistence_complete_notification.cc @@ -58,4 +58,4 @@ void OnSDLPersistenceCompleteNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc index 2cee7926bd..035def10e0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_start_device_discovery.cc @@ -59,4 +59,4 @@ void OnStartDeviceDiscovery::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc index 4cb01e7e90..5ee2ede198 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_status_update_notification.cc @@ -58,4 +58,4 @@ void OnStatusUpdateNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc index 242fb1d8cd..38b87f23d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc @@ -33,8 +33,8 @@ #include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h" #include "application_manager/application_impl.h" -#include "application_manager/state_controller.h" #include "application_manager/message_helper.h" +#include "application_manager/state_controller.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -85,4 +85,4 @@ void OnSystemContextNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc index 5591d59355..6a5ee4fce4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_error_notification.cc @@ -64,4 +64,4 @@ void OnSystemErrorNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc index 11b2471294..b7ba6951fb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_info_changed_notification.cc @@ -66,4 +66,4 @@ void OnSystemInfoChangedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc index d795896764..a9670681b2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc @@ -32,9 +32,9 @@ #include "application_manager/application_impl.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" #include "application_manager/policies/policy_handler_interface.h" #include "interfaces/MOBILE_API.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" #include "utils/macro.h" using policy::PolicyHandlerInterface; @@ -121,4 +121,4 @@ void OnSystemRequestNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc index b5fd1a007e..b068835545 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_time_ready_notification.cc @@ -59,4 +59,4 @@ void OnSystemTimeReadyNotification::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc index 5b5cfeefb1..f89baad737 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc @@ -100,4 +100,4 @@ void OnTTSLanguageChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc index 701dbe0538..8b60762b31 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc @@ -66,4 +66,4 @@ void OnTTSResetTimeoutNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc index 34ba82df1d..2d215b2ec9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_started_notification.cc @@ -60,4 +60,4 @@ void OnTTSStartedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc index 0935a36848..6910b188f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_stopped_notification.cc @@ -63,4 +63,4 @@ void OnTTSStoppedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc index 21cf0d9628..6cc9f85d6f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_command_notification.cc @@ -65,4 +65,4 @@ void OnUICommandNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc index fbdd4fce2b..f069e4ed65 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_keyboard_input_notification.cc @@ -67,4 +67,4 @@ void OnUIKeyBoardInputNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc index 3bf5a5aed4..697b2036c4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc @@ -99,4 +99,4 @@ void OnUILanguageChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc index 953932cdb6..bd1e1b8ea7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc @@ -67,4 +67,4 @@ void OnUIResetTimeoutNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc index e5b321e1ff..193c3666d2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_touch_event_notification.cc @@ -67,4 +67,4 @@ void OnUITouchEventNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc index 2a5e6ba797..e6275adab2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_update_device_list.cc @@ -56,4 +56,4 @@ void OnUpdateDeviceList::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc index c8ecba458a..99c6520fee 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_acc_pedal_position_notification.cc @@ -64,4 +64,4 @@ void OnVIAccPedalPositionNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc index ee909d19dc..dbfd9487e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_belt_status_notification.cc @@ -64,4 +64,4 @@ void OnVIBeltStatusNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc index f0386646ce..b8e66b9c0f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_body_information_notification.cc @@ -64,4 +64,4 @@ void OnVIBodyInformationNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc index 549c73065a..418c751d1c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_device_status_notification.cc @@ -64,4 +64,4 @@ void OnVIDeviceStatusNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc index 23f0d37068..29545fcd87 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_driver_braking_notification.cc @@ -64,4 +64,4 @@ void OnVIDriverBrakingNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc index 735a225225..4c2fb94400 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_engine_torque_notification.cc @@ -64,4 +64,4 @@ void OnVIEngineTorqueNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc index 0b4bfa893f..6ac26a74fc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_external_temperature_notification.cc @@ -64,4 +64,4 @@ void OnVIExternalTemperatureNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc index a5e84f1108..1f1cad5b8b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_notification.cc @@ -64,4 +64,4 @@ void OnVIFuelLevelNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc index 950b5a36f1..31c80860fd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_fuel_level_state_notification.cc @@ -64,4 +64,4 @@ void OnVIFuelLevelStateNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc index 0d94194f76..43ae3524ad 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_gps_data_notification.cc @@ -64,4 +64,4 @@ void OnVIGpsDataNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc index 80edb88e38..282a173b69 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_head_lamp_status_notification.cc @@ -64,4 +64,4 @@ void OnVIHeadLampStatusNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc index a2b0b1a8fd..f9bb3eca3f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc @@ -65,4 +65,4 @@ void OnVIInstantFuelConsumptionNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc index 5e3555bbc4..8f5e845c02 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_my_key_notification.cc @@ -64,4 +64,4 @@ void OnVIMyKeyNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc index 1dbef77fa3..ea5d8be9ca 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_odometer_notification.cc @@ -64,4 +64,4 @@ void OnVIOdometerNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc index d4ae93b324..73231ff4de 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_prndl_notification.cc @@ -64,4 +64,4 @@ void OnVIPrndlNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc index 77f694c92e..4587939b8f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_rpm_notification.cc @@ -64,4 +64,4 @@ void OnVIRpmNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc index e5860c9eec..df0bfd5cd7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_speed_notification.cc @@ -64,4 +64,4 @@ void OnVISpeedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc index db591d9da3..b7eaad7edf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc @@ -64,4 +64,4 @@ void OnVISteeringWheelAngleNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc index b5c7e18803..5f438ef8d1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_tire_pressure_notification.cc @@ -64,4 +64,4 @@ void OnVITirePressureNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc index 323fe5b885..1b40da4c40 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_vin_notification.cc @@ -64,4 +64,4 @@ void OnVIVinNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc index 6a3b863e7c..7221e88ef1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vi_wiper_status_notification.cc @@ -64,4 +64,4 @@ void OnVIWiperStatusNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc index 701dee5385..7d5c0165aa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_video_data_streaming_notification.cc @@ -59,4 +59,4 @@ void OnVideoDataStreamingNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc index 386ef1d1c7..7680b74426 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_command_notification.cc @@ -32,13 +32,13 @@ #include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h" -#include "application_manager/policies/policy_handler.h" #include "application_manager/message_helper.h" +#include "application_manager/policies/policy_handler.h" #include "application_manager/state_controller.h" -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" #include "application_manager/event_engine/event.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -110,4 +110,4 @@ void OnVRCommandNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc index 6a58ab9ffa..55c6eb8881 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc @@ -33,9 +33,9 @@ #include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h" #include "application_manager/application_impl.h" -#include "application_manager/state_controller.h" #include "application_manager/message_helper.h" #include "application_manager/rpc_service.h" +#include "application_manager/state_controller.h" #include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { @@ -98,4 +98,4 @@ void OnVRLanguageChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc index 04eb9a9ed0..bfc033a865 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_started_notification.cc @@ -61,4 +61,4 @@ void OnVRStartedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc index 8fea5ddd1c..ede1efab85 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_stopped_notification.cc @@ -61,4 +61,4 @@ void OnVRStoppedNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc index 5947454517..d8ad6087a6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_request.cc @@ -59,4 +59,4 @@ void RCGetCapabilitiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc index b14c28426c..f4651ee0cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_get_capabilities_response.cc @@ -66,4 +66,4 @@ void RCGetCapabilitiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc index d538878dc8..5e4af1503a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc @@ -105,4 +105,4 @@ void RCIsReadyRequest::SendMessageToHMI() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc index 7534567204..71e16a831c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_response.cc @@ -58,4 +58,4 @@ void RCIsReadyResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc index f89ae1f697..30184be7a1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc @@ -31,8 +31,8 @@ */ #include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h" -#include "application_manager/state_controller.h" #include "application_manager/message_helper.h" +#include "application_manager/state_controller.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -45,8 +45,7 @@ struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> { ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle) : handle_(handle) {} bool operator()(const ApplicationSharedPtr app) const { - return app - ? handle_ == app->device() && + return app ? handle_ == app->device() && Message::is_sufficient_version( protocol_handler::MajorProtocolVersion:: PROTOCOL_VERSION_4, @@ -80,7 +79,7 @@ struct SendLaunchApp return; } }; -} +} // namespace SDLActivateAppRequest::SDLActivateAppRequest( const application_manager::commands::MessageSharedPtr& message, @@ -115,6 +114,8 @@ void SDLActivateAppRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); using namespace hmi_apis::FunctionID; + ApplicationConstSharedPtr app = + application_manager_.WaitingApplicationByID(app_id()); if (application_manager_.state_controller().IsStateActive( HmiState::STATE_ID_DEACTIVATE_HMI)) { LOG4CXX_DEBUG(logger_, @@ -124,6 +125,16 @@ void SDLActivateAppRequest::Run() { static_cast<eType>(function_id()), hmi_apis::Common_Result::REJECTED, "HMIDeactivate is active"); + } else if (app && !app->IsRegistered() && app->is_cloud_app()) { + LOG4CXX_DEBUG(logger_, "Starting cloud application."); + const ApplicationManagerSettings& settings = + application_manager_.get_settings(); + uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() * + settings.cloud_app_max_retry_attempts()); + application_manager_.updateRequestTimeout( + 0, correlation_id(), default_timeout_ + total_retry_timeout); + subscribe_on_event(BasicCommunication_OnAppRegistered); + application_manager_.connection_handler().ConnectToDevice(app->device()); } else { const uint32_t application_id = app_id(); policy_handler_.OnActivateApp(application_id, correlation_id()); @@ -181,6 +192,18 @@ void SDLActivateAppRequest::Run() { LOG4CXX_DEBUG(logger_, "Application is registered. Activating."); policy_handler_.OnActivateApp(application_id, correlation_id()); return; + } else if (app_to_activate->is_cloud_app()) { + LOG4CXX_DEBUG(logger_, "Starting cloud application."); + const ApplicationManagerSettings& settings = + application_manager_.get_settings(); + uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() * + settings.cloud_app_max_retry_attempts()); + application_manager_.updateRequestTimeout( + 0, correlation_id(), default_timeout_ + total_retry_timeout); + subscribe_on_event(BasicCommunication_OnAppRegistered); + application_manager_.connection_handler().ConnectToDevice( + app_to_activate->device()); + return; } connection_handler::DeviceHandle device_handle = app_to_activate->device(); @@ -225,8 +248,10 @@ void SDLActivateAppRequest::onTimeOut() { using namespace hmi_apis::Common_Result; using namespace application_manager; unsubscribe_from_event(BasicCommunication_OnAppRegistered); - SendErrorResponse( - correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, ""); + SendErrorResponse(correlation_id(), + SDL_ActivateApp, + APPLICATION_NOT_REGISTERED, + "App registration timed out"); } void SDLActivateAppRequest::on_event(const event_engine::Event& event) { @@ -262,7 +287,7 @@ uint32_t SDLActivateAppRequest::hmi_app_id( LOG4CXX_DEBUG(logger_, application << " section is absent in the message."); return 0; } - if (so[msg_params][application].keyExists(strings::app_id)) { + if (!so[msg_params][application].keyExists(strings::app_id)) { LOG4CXX_DEBUG(logger_, strings::app_id << " section is absent in the message."); return 0; @@ -291,4 +316,4 @@ ApplicationSharedPtr SDLActivateAppRequest::get_foreground_app( } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc index 3262b12759..560b75213c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_response.cc @@ -61,4 +61,4 @@ void SDLActivateAppResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc index 6b983d566a..095ffbd9c7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_request.cc @@ -64,4 +64,4 @@ void SDLGetListOfPermissionsRequest::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc index 784b4922d4..280d2cb071 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_list_of_permissions_response.cc @@ -61,4 +61,4 @@ void SDLGetListOfPermissionsResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc index 9a6c0fd520..7200f6918c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_request.cc @@ -59,4 +59,4 @@ void SDLGetStatusUpdateRequest::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc index 8fc85da481..4b0f3d0ca8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_status_update_response.cc @@ -61,4 +61,4 @@ void SDLGetStatusUpdateResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc index ab8ec4e3d9..28167df047 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_request.cc @@ -93,4 +93,4 @@ void SDLGetUserFriendlyMessageRequest::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc index c5b3450723..b95591c4fa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_get_user_friendly_message_response.cc @@ -61,4 +61,4 @@ void SDLGetUserFriendlyMessageResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc index aef2e286d7..5f69903548 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update.cc @@ -64,4 +64,4 @@ void SDLPolicyUpdate::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc index d16fc578ab..12cdfb4ad9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_policy_update_response.cc @@ -56,4 +56,4 @@ void SDLPolicyUpdateResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc index 163d749426..988be68a80 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_request.cc @@ -59,4 +59,4 @@ void TTSChangeRegistrationRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc index 2c28d615d3..e5e38ef34a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_change_registration_response.cc @@ -63,4 +63,4 @@ void TTSChangeRegistratioResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc index 49623e01d7..9baaabf401 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_request.cc @@ -59,4 +59,4 @@ void TTSGetCapabilitiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc index 1cef3daf15..c0581a6380 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_capabilities_response.cc @@ -69,4 +69,4 @@ void TTSGetCapabilitiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc index 5533537b33..7d2c15a9bf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_request.cc @@ -59,4 +59,4 @@ void TTSGetLanguageRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc index ac423a2bf3..627056dce1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_language_response.cc @@ -77,4 +77,4 @@ void TTSGetLanguageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc index 8b87b9c6ea..2cb47380d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_request.cc @@ -59,4 +59,4 @@ void TTSGetSupportedLanguagesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc index a4e97d9d70..a70d1c89a3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_get_supported_languages_response.cc @@ -69,4 +69,4 @@ void TTSGetSupportedLanguagesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc index c7e2c0c4cb..89b5961895 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc @@ -31,8 +31,8 @@ */ #include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h" -#include "application_manager/rpc_service.h" #include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -112,4 +112,4 @@ void TTSIsReadyRequest::SendMessageToHMI() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc index c7d634bee2..67e0fb6396 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_response.cc @@ -59,4 +59,4 @@ void TTSIsReadyResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc index 8c7443d465..0b3d9a77bf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_request.cc @@ -59,4 +59,4 @@ void TTSSetGlobalPropertiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc index dae06d75f9..0901378c4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_set_global_properties_response.cc @@ -63,4 +63,4 @@ void TTSSetGlobalPropertiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc index 96b93b724f..6dce94f931 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_request.cc @@ -59,4 +59,4 @@ void TTSSpeakRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc index cb2346083b..69be5ab160 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_speak_response.cc @@ -32,8 +32,8 @@ #include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h" #include "application_manager/event_engine/event.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -64,4 +64,4 @@ void TTSSpeakResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc index 25a05f085b..43c595040c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_request.cc @@ -59,4 +59,4 @@ void TTSStopSpeakingRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc index a2620c1340..892b3e6295 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_stop_speaking_response.cc @@ -62,4 +62,4 @@ void TTSStopSpeakingResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc index 749b3ad56b..7c95e8a919 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_request.cc @@ -59,4 +59,4 @@ void UIAddCommandRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc index 266dffd225..72d841a878 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_command_response.cc @@ -62,4 +62,4 @@ void UIAddCommandResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc index de338d4670..15342c6ecb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_request.cc @@ -59,4 +59,4 @@ void UIAddSubmenuRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc index 85e600c87d..ae699dc2bd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_add_submenu_response.cc @@ -63,4 +63,4 @@ void UIAddSubmenuResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc index ae5f861ba6..bf449db808 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_request.cc @@ -59,4 +59,4 @@ void UIAlertRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc index 3076eabc4c..f53f14e050 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_alert_response.cc @@ -63,4 +63,4 @@ void UIAlertResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc index d109987009..bb001b37c7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_request.cc @@ -59,4 +59,4 @@ void UIChangeRegistrationRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc index 6557269e49..8acd654488 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_change_registration_response.cc @@ -63,4 +63,4 @@ void UIChangeRegistratioResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc index 9e52f5fc18..1d741bba74 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_request.cc @@ -59,4 +59,4 @@ void UIDeleteCommandRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc index a8f5b59d39..40a5ec8a73 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_command_response.cc @@ -63,4 +63,4 @@ void UIDeleteCommandResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc index 1b84df8bed..fdca37cee6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_request.cc @@ -59,4 +59,4 @@ void UIDeleteSubmenuRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc index ec4025bea1..9d522431dc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_delete_submenu_response.cc @@ -63,4 +63,4 @@ void UIDeleteSubmenuResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc index fe11185c62..92f51bc9cf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_request.cc @@ -59,4 +59,4 @@ void UIEndAudioPassThruRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc index 3a6d4efbe4..b6639dcbb9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_end_audio_pass_thru_response.cc @@ -63,4 +63,4 @@ void UIEndAudioPassThruResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc index 3bd56a0682..5f8704b3e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_request.cc @@ -59,4 +59,4 @@ void UIGetCapabilitiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc index cd5f3c9a42..909e3bae47 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_capabilities_response.cc @@ -118,4 +118,4 @@ void UIGetCapabilitiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc index 8acba42493..d3b44d1168 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_request.cc @@ -59,4 +59,4 @@ void UIGetLanguageRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc index 27e46e52b4..2a5c0ab016 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_language_response.cc @@ -78,4 +78,4 @@ void UIGetLanguageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc index 2f8ef12a25..0665612525 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_request.cc @@ -59,4 +59,4 @@ void UIGetSupportedLanguagesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc index d20dd8545f..19ee62e51d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_get_supported_languages_response.cc @@ -69,4 +69,4 @@ void UIGetSupportedLanguagesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc index 2eab211690..2546b704b2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc @@ -112,4 +112,4 @@ void UIIsReadyRequest::SendMessageToHMI() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc index e25e8ee8ab..96a2d1212c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_response.cc @@ -60,4 +60,4 @@ void UIIsReadyResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc index cca89e3073..18d5376b25 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_request.cc @@ -59,4 +59,4 @@ void UIPerformAudioPassThruRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc index 057448ab33..afbd1bbed7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_audio_pass_thru_response.cc @@ -62,4 +62,4 @@ void UIPerformAudioPassThruResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc index d5696a39e7..aa5878590b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_request.cc @@ -59,4 +59,4 @@ void UIPerformInteractionRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc index 7629faa131..4cbc58d278 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_perform_interaction_response.cc @@ -61,4 +61,4 @@ void UIPerformInteractionResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc index dbe0ceb529..de639420fb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_request.cc @@ -59,4 +59,4 @@ void UIScrollableMessageRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc index a96b9fa3ee..4e844095b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_scrollable_message_response.cc @@ -62,4 +62,4 @@ void UIScrollableMessageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc index f5f8f7bafd..4a538ac992 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_request.cc @@ -58,4 +58,4 @@ void UISendHapticDataRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc index 4555d81a0a..92afdaaa4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_send_haptic_data_response.cc @@ -62,4 +62,4 @@ void UISendHapticDataResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc index d25bbd1cd9..821f78a046 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_request.cc @@ -59,4 +59,4 @@ void UISetAppIconRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc index 711b5767f2..68e96725d4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_app_icon_response.cc @@ -62,4 +62,4 @@ void UISetAppIconResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc index 73b813d0eb..63166157c8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_request.cc @@ -58,4 +58,4 @@ void UiSetDisplayLayoutRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc index d5d2e02e33..f35427895e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_display_layout_response.cc @@ -63,4 +63,4 @@ void UiSetDisplayLayoutResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc index 0664404361..0aaaae7cc7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_request.cc @@ -59,4 +59,4 @@ void UISetGlobalPropertiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc index 2e5fecf2af..48d73d146c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_global_properties_response.cc @@ -62,4 +62,4 @@ void UISetGlobalPropertiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc index 4e87b9ccc3..4c8fcefcdf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_request.cc @@ -59,4 +59,4 @@ void UISetMediaClockTimerRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc index 39e7e1c232..fb5b25fc2b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_set_media_clock_timer_response.cc @@ -62,4 +62,4 @@ void UISetMediaClockTimerResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc index 5b7568abfe..d7160dc70b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_request.cc @@ -59,4 +59,4 @@ void UIShowRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc index 3e3c0b79d8..768069bf3a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_show_response.cc @@ -61,4 +61,4 @@ void UIShowResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc index 4df3adbe14..56fca3d062 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_request.cc @@ -59,4 +59,4 @@ void UISliderRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc index 2431c65ddf..9cf7224ddb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_slider_response.cc @@ -62,4 +62,4 @@ void UISliderResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc index 05b08cb723..c5966fcb36 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_request.cc @@ -59,4 +59,4 @@ void UpdateAppListRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc index 3dd03993ef..7fc830b4e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_app_list_response.cc @@ -59,4 +59,4 @@ void UpdateAppListResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc index 7736f2b1e6..3a014480c1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_request.cc @@ -100,4 +100,4 @@ bool UpdateDeviceListRequest::CleanUp() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc index 25dc9be5bd..d69e683f2b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_device_list_response.cc @@ -58,4 +58,4 @@ void UpdateDeviceListResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc index cafacea28f..96d454d4ee 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_request.cc @@ -61,4 +61,4 @@ void UpdateSDLRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc index a35571ec26..c02cde4111 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/update_sdl_response.cc @@ -61,4 +61,4 @@ void UpdateSDLResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc index 72ce387f77..788eda5a87 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_request.cc @@ -59,4 +59,4 @@ void VRAddCommandRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc index 19d43616ff..37b3e4696d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_add_command_response.cc @@ -63,4 +63,4 @@ void VRAddCommandResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc index 9ba5fa3571..d1be04ad44 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_request.cc @@ -59,4 +59,4 @@ void VRChangeRegistrationRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc index 42c5b6d65b..27bde2bafa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_change_registration_response.cc @@ -62,4 +62,4 @@ void VRChangeRegistrationResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc index efc09dc157..ebcfe78fa9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_request.cc @@ -59,4 +59,4 @@ void VRDeleteCommandRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc index f8f7535e68..d1d725b356 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_delete_command_response.cc @@ -62,4 +62,4 @@ void VRDeleteCommandResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc index 7e9c846857..b06bfa0e77 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_request.cc @@ -59,4 +59,4 @@ void VRGetCapabilitiesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc index 47ffb3a675..80c308ea40 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_capabilities_response.cc @@ -61,4 +61,4 @@ void VRGetCapabilitiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc index d57faa08fd..84179f6357 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_request.cc @@ -59,4 +59,4 @@ void VRGetLanguageRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc index 469452d108..6b7fec736d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_language_response.cc @@ -78,4 +78,4 @@ void VRGetLanguageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc index bb27168a77..351940bf68 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_request.cc @@ -59,4 +59,4 @@ void VRGetSupportedLanguagesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc index 722040388d..4c725267fa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_get_supported_languages_response.cc @@ -31,8 +31,8 @@ */ #include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -69,4 +69,4 @@ void VRGetSupportedLanguagesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc index 22afb03945..12414eab10 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc @@ -112,4 +112,4 @@ void VRIsReadyRequest::SendMessageToHMI() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc index 48d9c3e075..373f97bf80 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_response.cc @@ -59,4 +59,4 @@ void VRIsReadyResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc index 26e308a0bc..ae94019b25 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_request.cc @@ -59,4 +59,4 @@ void VRPerformInteractionRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc index dec371e889..16378ab55a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_perform_interaction_response.cc @@ -60,4 +60,4 @@ void VRPerformInteractionResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc index 155f819761..a57d222765 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc @@ -31,14 +31,14 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include "sdl_rpc_plugin/commands/mobile/add_command_request.h" +#include <string> #include "application_manager/application.h" #include "application_manager/message_helper.h" +#include "utils/custom_string.h" #include "utils/file_system.h" #include "utils/helpers.h" -#include "utils/custom_string.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -126,9 +126,9 @@ void AddCommandRequest::Run() { } if (((*message_)[strings::msg_params][strings::menu_params].keyExists( hmi_request::parent_id)) && - (0 != - (*message_)[strings::msg_params][strings::menu_params] - [hmi_request::parent_id].asUInt())) { + (0 != (*message_)[strings::msg_params][strings::menu_params] + [hmi_request::parent_id] + .asUInt())) { if (!CheckCommandParentId(app)) { SendResponse( false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist"); @@ -224,7 +224,8 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) { if ((*message_)[strings::msg_params][strings::menu_params].keyExists( hmi_request::parent_id)) { parent_id = (*message_)[strings::msg_params][strings::menu_params] - [hmi_request::parent_id].asUInt(); + [hmi_request::parent_id] + .asUInt(); } for (; commands.end() != i; ++i) { @@ -239,7 +240,8 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) { } if (((*i->second)[strings::menu_params][strings::menu_name].asString() == (*message_)[strings::msg_params][strings::menu_params] - [strings::menu_name].asString()) && + [strings::menu_name] + .asString()) && (saved_parent_id == parent_id)) { LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandName received" @@ -293,7 +295,8 @@ bool AddCommandRequest::CheckCommandParentId(ApplicationConstSharedPtr app) { const int32_t parent_id = (*message_)[strings::msg_params][strings::menu_params] - [hmi_request::parent_id].asInt(); + [hmi_request::parent_id] + .asInt(); smart_objects::SmartObject* parent = app->FindSubMenu(parent_id); if (!parent) { @@ -524,7 +527,8 @@ bool AddCommandRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) { str = (*message_)[strings::msg_params][strings::menu_params] - [strings::menu_name].asCharArray(); + [strings::menu_name] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid menu name syntax check failed."); return true; @@ -624,4 +628,4 @@ void AddCommandRequest::RemoveCommand() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc index ccb84cecbb..24ff3b5a28 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_response.cc @@ -61,4 +61,4 @@ void AddCommandResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc index 183b445326..fbfcd4d38a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc @@ -33,8 +33,8 @@ #include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h" -#include "application_manager/message_helper.h" #include "application_manager/application.h" +#include "application_manager/message_helper.h" #include "utils/helpers.h" namespace sdl_rpc_plugin { @@ -114,10 +114,12 @@ void AddSubMenuRequest::Run() { msg_params[strings::menu_params][strings::position] = received_msg_params[strings::position]; } + if (received_msg_params.keyExists(strings::menu_icon)) { + msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon]; + } msg_params[strings::menu_params][strings::menu_name] = received_msg_params[strings::menu_name]; msg_params[strings::app_id] = app->app_id(); - msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon]; StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true); @@ -183,4 +185,4 @@ bool AddSubMenuRequest::CheckSubMenuName() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc index d0ec635dd0..d91f13f1df 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_response.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -62,4 +62,4 @@ void AddSubMenuResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc index 5dda34b743..9f36f260ae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc @@ -25,12 +25,12 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h" #include <cstring> #include <string> -#include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h" #include "application_manager/application_impl.h" -#include "application_manager/policies/policy_handler.h" #include "application_manager/message_helper.h" +#include "application_manager/policies/policy_handler.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -107,9 +107,9 @@ void AlertManeuverRequest::Run() { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -288,4 +288,4 @@ bool AlertManeuverRequest::IsWhiteSpaceExist() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc index d3e527f6ae..97c93d7455 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_response.cc @@ -62,4 +62,4 @@ void AlertManeuverResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc index 2806ac1d93..7173aaf2d0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc @@ -35,12 +35,12 @@ #include <string.h> -#include "application_manager/message_helper.h" #include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" #include "application_manager/policies/policy_handler.h" -#include "utils/helpers.h" #include "smart_objects/smart_object.h" +#include "utils/helpers.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -298,9 +298,9 @@ bool AlertRequest::Validate(uint32_t app_id) { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -450,4 +450,4 @@ bool AlertRequest::HasHmiResponsesToWait() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc index bab5e5a5d8..b709d13958 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_response.cc @@ -32,10 +32,10 @@ */ #include "sdl_rpc_plugin/commands/mobile/alert_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/rpc_service.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -64,4 +64,4 @@ void AlertResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc index 6af930ea53..ef81babdd6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc @@ -31,14 +31,14 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h" #include <string.h> #include <algorithm> -#include "sdl_rpc_plugin/commands/mobile/change_registration_request.h" -#include "application_manager/application_manager.h" #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" +#include "application_manager/application_manager.h" #include "application_manager/message_helper.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace { namespace custom_str = utils::custom_string; @@ -51,7 +51,7 @@ struct IsSameNickname { private: const custom_str::CustomString& app_id_; }; -} +} // namespace namespace sdl_rpc_plugin { using namespace application_manager; @@ -194,9 +194,9 @@ void ChangeRegistrationRequest::Run() { MessageHelper::VerifyTtsFiles(tts_name, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_name are not present"); @@ -216,9 +216,9 @@ void ChangeRegistrationRequest::Run() { hmi_interfaces.GetInterfaceState( HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS); + using helpers::ALL; using helpers::Compare; using helpers::EQ; - using helpers::ALL; if (Compare<HmiInterfaces::InterfaceState, EQ, ALL>( HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE, @@ -638,9 +638,9 @@ bool ChangeRegistrationRequest::IsNicknameAllowed( ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "Can't find appication with connection key " - << connection_key()); + LOG4CXX_ERROR( + logger_, + "Can't find appication with connection key " << connection_key()); return false; } @@ -681,4 +681,4 @@ bool ChangeRegistrationRequest::IsNicknameAllowed( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc index 2dae92cd9b..78c60bc746 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_response.cc @@ -61,4 +61,4 @@ void ChangeRegistrationResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc new file mode 100644 index 0000000000..736f0355dc --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_request.cc @@ -0,0 +1,118 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/mobile/close_application_request.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "interfaces/MOBILE_API.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +CloseApplicationRequest::CloseApplicationRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +CloseApplicationRequest::~CloseApplicationRequest() {} + +void CloseApplicationRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (app.use_count() == 0) { + LOG4CXX_ERROR(logger_, "Application does not exist"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + smart_objects::SmartObject msg_params; + msg_params[strings::app_id] = connection_key(); + SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_CloseApplication, + &msg_params, + true); +} + +void CloseApplicationRequest::on_event(const event_engine::Event& event) { + LOG4CXX_AUTO_TRACE(logger_); + const smart_objects::SmartObject& message = event.smart_object(); + + auto msg_params = message[strings::msg_params]; + + hmi_apis::Common_Result::eType hmi_result = + static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); + + mobile_apis::Result::eType result = + MessageHelper::HMIToMobileResult(hmi_result); + bool success = PrepareResultForMobileResponse( + hmi_result, HmiInterfaces::HMI_INTERFACE_BasicCommunication); + if (success) { + ApplicationSharedPtr app = + application_manager_.application(connection_key()); + + if (app.use_count() == 0) { + LOG4CXX_ERROR(logger_, "Application does not exist"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + auto on_app_exit = [app](plugin_manager::RPCPlugin& plugin) { + plugin.OnApplicationEvent(plugin_manager::kApplicationExit, app); + }; + + application_manager_.GetPluginManager().ForEachPlugin(on_app_exit); + application_manager_.state_controller().SetRegularState( + app, + mobile_apis::HMILevel::HMI_NONE, + mobile_apis::AudioStreamingState::NOT_AUDIBLE, + mobile_apis::VideoStreamingState::NOT_STREAMABLE, + false); + } + + const char* info = msg_params.keyExists(strings::info) + ? msg_params[strings::info].asCharArray() + : NULL; + + SendResponse(success, result, info, &msg_params); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc new file mode 100644 index 0000000000..934804e1b1 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/close_application_response.cc @@ -0,0 +1,61 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/mobile/close_application_response.h" +#include "application_manager/application_impl.h" +#include "interfaces/MOBILE_API.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +CloseApplicationResponse::CloseApplicationResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +CloseApplicationResponse::~CloseApplicationResponse() {} + +void CloseApplicationResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index 416f4f2085..258aefd63f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -31,11 +31,11 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string> -#include <cstring> +#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h" #include <algorithm> +#include <cstring> +#include <string> #include <vector> -#include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h" #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" @@ -218,9 +218,9 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms( CreateInteractionChoiceSetRequest::compareStr); if (it != vr_cmds_1->end()) { - LOG4CXX_INFO(logger_, - "Incoming choice set has duplicated VR synonyms " - << it->asString()); + LOG4CXX_INFO( + logger_, + "Incoming choice set has duplicated VR synonyms " << it->asString()); return true; } @@ -332,9 +332,9 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( VRCommandInfo vr_command(vr_cmd_id); sent_commands_map_[vr_corr_id] = vr_command; - LOG4CXX_DEBUG(logger_, - "VR_command sent corr_id " << vr_corr_id << " cmd_id " - << vr_corr_id); + LOG4CXX_DEBUG( + logger_, + "VR_command sent corr_id " << vr_corr_id << " cmd_id " << vr_corr_id); } expected_chs_count_ = chs_num; LOG4CXX_DEBUG(logger_, "expected_chs_count_ = " << expected_chs_count_); @@ -480,4 +480,4 @@ void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc index 807770ed12..43dba2f238 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_response.cc @@ -72,4 +72,4 @@ void CreateInteractionChoiceSetResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc index 38069c341e..363b14f92f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc @@ -35,8 +35,8 @@ #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "utils/helpers.h" namespace sdl_rpc_plugin { @@ -204,8 +204,9 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { if (!command) { LOG4CXX_ERROR(logger_, - "Command id " << cmd_id << " not found for " - "application with connection key " + "Command id " << cmd_id + << " not found for " + "application with connection key " << connection_key()); return; } @@ -232,4 +233,4 @@ bool DeleteCommandRequest::IsPendingResponseExist() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc index 8f85d50e28..919385ee50 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_response.cc @@ -61,4 +61,4 @@ void DeleteCommandResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc index cf8a6d259f..b2c9a3377f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_request.cc @@ -129,4 +129,4 @@ void DeleteFileRequest::SendFileRemovedNotification( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc index 66c61c9e4a..732a1e56b5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_file_response.cc @@ -72,4 +72,4 @@ void DeleteFileResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc index a9db3975db..7950595b1c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_request.cc @@ -34,9 +34,9 @@ #include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h" #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" #include "application_manager/message_helper.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -63,9 +63,9 @@ void DeleteInteractionChoiceSetRequest::Run() { ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "No application associated with connection key " - << connection_key()); + LOG4CXX_ERROR( + logger_, + "No application associated with connection key " << connection_key()); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -165,4 +165,4 @@ void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc index 18ca60f255..cf5ad3a2c2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_interaction_choice_set_response.cc @@ -34,8 +34,8 @@ #include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h" #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -81,4 +81,4 @@ void DeleteInteractionChoiceSetResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc index 9a01163702..6aaa2406e8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_request.cc @@ -33,8 +33,8 @@ #include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h" -#include "application_manager/message_helper.h" #include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" #include "interfaces/HMI_API.h" #include "utils/helpers.h" @@ -200,4 +200,4 @@ bool DeleteSubMenuRequest::Init() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc index 6831a66e1e..3cefef5c38 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_sub_menu_response.cc @@ -61,4 +61,4 @@ void DeleteSubMenuResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc index ee0297ded6..1de7a3ea03 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_request.cc @@ -30,9 +30,9 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h" #include <algorithm> #include <string> -#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h" #include "application_manager/application_impl.h" @@ -153,4 +153,4 @@ void DialNumberRequest::StripNumberParam(std::string& number) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc index a264f96e0d..4385b3fe90 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/dial_number_response.cc @@ -60,4 +60,4 @@ void DialNumberResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc index 3650a8226c..66ff7b48d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_request.cc @@ -97,4 +97,4 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc index f9f9f89d11..6c9bd05e09 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/end_audio_pass_thru_response.cc @@ -61,4 +61,4 @@ void EndAudioPassThruResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc index b0715225e4..fda6cc64e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/generic_response.cc @@ -63,4 +63,4 @@ void GenericResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc new file mode 100644 index 0000000000..34ed30c243 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_request.cc @@ -0,0 +1,98 @@ +#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + +GetCloudAppPropertiesRequest::GetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetCloudAppPropertiesRequest::~GetCloudAppPropertiesRequest() {} + +void GetCloudAppPropertiesRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + std::string policy_app_id = + (*message_)[strings::msg_params][strings::app_id].asString(); + + bool enabled = true; + std::string endpoint; + std::string auth_token; + std::string certificate; + std::string cloud_transport_type; + std::string hybrid_app_preference; + + bool result = policy_handler_.GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); + + if (!result) { + SendResponse(false, + mobile_apis::Result::DATA_NOT_AVAILABLE, + "Cloud app does not exist on module"); + return; + } + + policy::StringArray nicknames; + policy::StringArray app_hmi_types; + + policy_handler_.GetInitialAppData(policy_app_id, &nicknames, &app_hmi_types); + + smart_objects::SmartObject response_params(smart_objects::SmartType_Map); + smart_objects::SmartObject properties(smart_objects::SmartType_Map); + smart_objects::SmartObject nicknames_array(smart_objects::SmartType_Array); + size_t i = 0; + for (std::string nickname : nicknames) { + nicknames_array[i] = nickname; + ++i; + } + properties[strings::nicknames] = nicknames_array; + properties[strings::app_id] = policy_app_id; + properties[strings::enabled] = enabled; + + if (!auth_token.empty()) { + properties[strings::auth_token] = auth_token; + } + if (!cloud_transport_type.empty()) { + properties[strings::cloud_transport_type] = cloud_transport_type; + } + if (!hybrid_app_preference.empty()) { + properties[strings::hybrid_app_preference] = hybrid_app_preference; + } + if (!endpoint.empty()) { + properties[strings::endpoint] = endpoint; + } + + response_params[strings::properties] = properties; + + SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); +} + +void GetCloudAppPropertiesRequest::on_event( + const app_mngr::event_engine::Event& event) { + LOG4CXX_INFO(logger_, "GetCloudAppPropertiesRequest on_event"); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc new file mode 100644 index 0000000000..f50897303a --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_cloud_app_properties_response.cc @@ -0,0 +1,31 @@ +#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h" +#include "application_manager/application_manager.h" +#include "application_manager/rpc_service.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + +GetCloudAppPropertiesResponse::GetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetCloudAppPropertiesResponse::~GetCloudAppPropertiesResponse() {} + +void GetCloudAppPropertiesResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc new file mode 100644 index 0000000000..75263494c2 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_request.cc @@ -0,0 +1,356 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/mobile/get_file_request.h" + +#include <boost/crc.hpp> +#include "application_manager/app_service_manager.h" +#include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" +#include "utils/file_system.h" + +namespace { +/** + * Calculates CRC32 checksum + * @param binary_data - input data for which CRC32 should be calculated + * @return calculated CRC32 checksum + */ +uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) { + const std::size_t file_size = binary_data.size(); + boost::crc_32_type result; + result.process_bytes(&binary_data[0], file_size); + return result.checksum(); +} + +} // namespace + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +GetFileRequest::GetFileRequest( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) + , file_name_("") + , file_type_(mobile_apis::FileType::INVALID_ENUM) + , length_(0) + , offset_(0) {} + +GetFileRequest::~GetFileRequest() {} + +bool GetFileRequest::GetFilePath(std::string& file_path, bool& forward_to_hmi) { + std::string path = application_manager_.get_settings().app_storage_folder(); + auto connect_key = connection_key(); + forward_to_hmi = false; + + if ((*message_)[strings::msg_params].keyExists(strings::app_service_id)) { + std::string service_id = + (*message_)[strings::msg_params][strings::app_service_id].asString(); + LOG4CXX_DEBUG(logger_, + "Finding storage directory for service id: " << service_id); + + AppService* app_service_info = + application_manager_.GetAppServiceManager().FindServiceByID(service_id); + if (app_service_info) { + if (app_service_info->mobile_service) { + connect_key = app_service_info->connection_key; + } else { + forward_to_hmi = true; + return true; + } + } else { + return false; + } + } else { + LOG4CXX_DEBUG(logger_, "Using current storage directory"); + } + + ApplicationSharedPtr app = application_manager_.application(connect_key); + file_path = path + "/" + app->folder_name(); + return true; +} + +void GetFileRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_INFO(logger_, "Received GetFile request"); + + ApplicationSharedPtr app = application_manager_.application(connection_key()); + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + file_name_ = (*message_)[strings::msg_params][strings::file_name].asString(); + + if (!file_system::IsFileNameValid(file_name_)) { + LOG4CXX_ERROR(logger_, + "File name " << file_name_ << " contains forbidden symbols."); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "File name contains forbidden symbols", + &response_params); + return; + } + + // Initialize other params with default values. If exists overwrite the values + LOG4CXX_DEBUG(logger_, "Intialize non manadatory params with default values"); + + if ((*message_)[strings::msg_params].keyExists(strings::file_type)) { + file_type_ = static_cast<mobile_apis::FileType::eType>( + (*message_)[strings::msg_params][strings::file_type].asInt()); + } + + // Check if file exists on system (may have to use app service id to get the + // correct app folder) + LOG4CXX_DEBUG(logger_, "Check if file exists on system"); + std::string file_path; + bool forward_to_hmi; + + if (GetFilePath(file_path, forward_to_hmi)) { + if (forward_to_hmi) { + LOG4CXX_DEBUG(logger_, "Forwarding GetFile request to HMI"); + application_manager_.IncreaseForwardedRequestTimeout(connection_key(), + correlation_id()); + SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_GetFilePath, + &(*message_)[strings::msg_params], + true); + return; + } + } else { + LOG4CXX_ERROR(logger_, "Could not get file path"); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "Could not get file path", + &response_params); + return; + } + + const std::string full_path = file_path + "/" + file_name_; + if (!file_system::FileExists(full_path)) { + LOG4CXX_ERROR(logger_, "File " << full_path << " does not exist"); + SendResponse(false, + mobile_apis::Result::FILE_NOT_FOUND, + "File does not exist", + &response_params); + return; + } + + // Handle offset + LOG4CXX_DEBUG(logger_, "Handle offset and length parameters"); + const uint64_t file_size = file_system::FileSize(full_path); + + if ((*message_)[strings::msg_params].keyExists(strings::offset)) { + offset_ = (*message_)[strings::msg_params][strings::offset].asUInt(); + } + + length_ = file_size - offset_; + if ((*message_)[strings::msg_params].keyExists(strings::length)) { + length_ = std::min( + static_cast<uint32_t>( + (*message_)[strings::msg_params][strings::length].asUInt()), + length_); + } + + if (offset_ > file_size) { + LOG4CXX_ERROR( + logger_, + "Offset " << offset_ << " greater than file size " << file_size); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "Offset greater than file size", + &response_params); + return; + } + if (length_ > file_size - offset_) { + LOG4CXX_ERROR(logger_, + "Length " << length_ << " greater than file size - offset" + << file_size); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "Length greater than file size - offset", + &response_params); + return; + } + + // Load data from file as binary data + LOG4CXX_DEBUG(logger_, "Load binary data from file"); + std::vector<uint8_t> bin_data; + if (!file_system::ReadBinaryFile(full_path, bin_data, offset_, length_)) { + LOG4CXX_ERROR(logger_, "Failed to read from file: " << full_path); + SendResponse(false, + mobile_apis::Result::GENERIC_ERROR, + "Unable to read from file", + &response_params); + return; + } + + // Construct response message + if ((*message_)[strings::msg_params].keyExists(strings::offset)) { + response_params[strings::offset] = offset_; + } + if ((*message_)[strings::msg_params].keyExists(strings::length)) { + response_params[strings::length] = length_; + } + if ((*message_)[strings::msg_params].keyExists(strings::file_type)) { + response_params[strings::file_type] = file_type_; + } + const uint32_t crc_calculated = GetCrc32CheckSum(bin_data); + response_params[strings::crc32_check_sum] = crc_calculated; + + SendResponse(true, + mobile_apis::Result::SUCCESS, + "File uploaded", + &response_params, + bin_data); +} + +void GetFileRequest::on_event(const app_mngr::event_engine::Event& event) { + LOG4CXX_AUTO_TRACE(logger_); + + if (hmi_apis::FunctionID::BasicCommunication_GetFilePath != event.id()) { + return; + } + const smart_objects::SmartObject& event_message = event.smart_object(); + + hmi_apis::Common_Result::eType hmi_result = + static_cast<hmi_apis::Common_Result::eType>( + event_message[strings::params][hmi_response::code].asInt()); + + mobile_apis::Result::eType result = + MessageHelper::HMIToMobileResult(hmi_result); + bool success = PrepareResultForMobileResponse( + hmi_result, HmiInterfaces::HMI_INTERFACE_AppService); + + if (!success) { + auto msg_params = event_message[strings::msg_params]; + const char* info = msg_params.keyExists(strings::info) + ? msg_params[strings::info].asCharArray() + : NULL; + + SendResponse(false, result, info, &msg_params); + return; + } + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); + std::vector<uint8_t> bin_data; + + if (event_message[strings::msg_params].keyExists(strings::file_type)) { + response_params[strings::file_type] = + event_message[strings::msg_params][strings::file_type]; + } + + if (event_message[strings::msg_params].keyExists(strings::file_path)) { + std::string full_path = + event_message[strings::msg_params][strings::file_path].asString(); + + if (!file_system::FileExists(full_path)) { + LOG4CXX_ERROR(logger_, "File " << full_path << " does not exist"); + SendResponse(false, + mobile_apis::Result::FILE_NOT_FOUND, + "File does not exist", + &response_params); + return; + } + + const uint64_t file_size = file_system::FileSize(full_path); + if ((*message_)[strings::msg_params].keyExists(strings::offset)) { + offset_ = (*message_)[strings::msg_params][strings::offset].asUInt(); + } + + length_ = file_size - offset_; + if ((*message_)[strings::msg_params].keyExists(strings::length)) { + length_ = std::min( + static_cast<uint32_t>( + (*message_)[strings::msg_params][strings::length].asUInt()), + length_); + } + + if (offset_ > file_size) { + LOG4CXX_ERROR( + logger_, + "Offset " << offset_ << " greater than file size " << file_size); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "Offset greater than file size", + &response_params); + return; + } + if (length_ > file_size - offset_) { + LOG4CXX_ERROR(logger_, + "Length " << length_ << " greater than file size - offset" + << file_size); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "Length greater than file size - offset", + &response_params); + return; + } + if (!file_system::ReadBinaryFile(full_path, bin_data, offset_, length_)) { + LOG4CXX_ERROR(logger_, "Failed to read from file: " << full_path); + SendResponse(false, + mobile_apis::Result::GENERIC_ERROR, + "Failed to read from file", + &response_params); + return; + } + + const uint32_t crc_calculated = GetCrc32CheckSum(bin_data); + response_params[strings::crc32_check_sum] = crc_calculated; + + } else { + LOG4CXX_ERROR(logger_, "HMI did not return a file path: "); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + "HMI did not return a file path", + &response_params); + return; + } + + SendResponse(true, result, "File uploaded", &response_params, bin_data); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc new file mode 100644 index 0000000000..2ea8dde02a --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_file_response.cc @@ -0,0 +1,63 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "sdl_rpc_plugin/commands/mobile/get_file_response.h" +#include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" +#include "interfaces/MOBILE_API.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { + +GetFileResponse::GetFileResponse( + const application_manager::commands::MessageSharedPtr& message, + ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +GetFileResponse::~GetFileResponse() {} + +void GetFileResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_INFO(logger_, "Sending GetFile response"); + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc index a6c627aad2..0655da27c0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_request.cc @@ -32,6 +32,11 @@ #include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h" +#include <set> +#include "application_manager/app_service_manager.h" +#include "application_manager/message_helper.h" +#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h" + namespace sdl_rpc_plugin { using namespace application_manager; @@ -80,10 +85,20 @@ void GetSystemCapabilityRequest::Run() { switch (response_type) { case mobile_apis::SystemCapabilityType::NAVIGATION: { + smart_objects::SmartObject nav_capability(smart_objects::SmartType_Map); + bool has_nav_capability = false; if (hmi_capabilities.navigation_capability()) { + has_nav_capability = true; + nav_capability = *hmi_capabilities.navigation_capability(); + } + + has_nav_capability = application_manager_.GetAppServiceManager() + .UpdateNavigationCapabilities(nav_capability) || + has_nav_capability; + + if (has_nav_capability) { response_params[strings::system_capability] - [strings::navigation_capability] = - *hmi_capabilities.navigation_capability(); + [strings::navigation_capability] = nav_capability; } else { SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); return; @@ -128,10 +143,35 @@ void GetSystemCapabilityRequest::Run() { return; } break; + case mobile_apis::SystemCapabilityType::APP_SERVICES: { + auto all_services = + application_manager_.GetAppServiceManager().GetAllServiceRecords(); + response_params[strings::system_capability] + [strings::app_services_capabilities] = + MessageHelper::CreateAppServiceCapabilities( + all_services); + break; + } default: // Return unsupported resource SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; } + + if ((*message_)[app_mngr::strings::msg_params].keyExists( + strings::subscribe)) { + auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); + if ((*message_)[app_mngr::strings::msg_params][strings::subscribe] + .asBool() == true) { + LOG4CXX_DEBUG(logger_, + "Subscribe to system capability: " << response_type); + ext.SubscribeTo(response_type); + } else { + LOG4CXX_DEBUG(logger_, + "Unsubscribe from system capability: " << response_type); + ext.UnsubscribeFrom(response_type); + } + } + SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); } @@ -140,4 +180,4 @@ void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc index dd5461081c..5df0c72607 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_system_capability_response.cc @@ -30,9 +30,9 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" -#include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -61,4 +61,4 @@ void GetSystemCapabilityResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc index 7dc9eb9ad9..cd7d7a37b7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/application_manager.h" #include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h" +#include "application_manager/application_manager.h" #include "application_manager/message_helper.h" namespace sdl_rpc_plugin { @@ -113,4 +113,4 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc index 7581990273..e481c926b8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_response.cc @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/application_manager.h" #include "sdl_rpc_plugin/commands/mobile/get_way_points_response.h" +#include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" namespace sdl_rpc_plugin { @@ -61,4 +61,4 @@ void GetWayPointsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc index e671dab463..46a39513d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_request.cc @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include "sdl_rpc_plugin/commands/mobile/list_files_request.h" +#include <string> #include "application_manager/application_impl.h" @@ -112,4 +112,4 @@ void ListFilesRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc index d025f05358..ffa8a443d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/list_files_response.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/list_files_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -62,4 +62,4 @@ void ListFilesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc index 128ce1e3bf..5714043a51 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_app_interface_unregistered_notification.cc @@ -60,4 +60,4 @@ void OnAppInterfaceUnregisteredNotification::Run() { SendNotification(); } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc index ff88ae96bd..3088c7df33 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_audio_pass_thru_notification.cc @@ -57,4 +57,4 @@ void OnAudioPassThruNotification::Run() { SendNotification(); } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc index 79fb1f4272..f0368a742d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc @@ -79,9 +79,8 @@ void OnButtonEventNotification::Run() { (*message_)[strings::msg_params][strings::app_id].asUInt()); // custom_button_id is mandatory for CUSTOM_BUTTON notification - if (false == - (*message_)[strings::msg_params].keyExists( - hmi_response::custom_button_id)) { + if (false == (*message_)[strings::msg_params].keyExists( + hmi_response::custom_button_id)) { LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonEvent without custom_button_id."); return; @@ -188,4 +187,4 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc index c73f2b4b98..7c77e29298 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc @@ -80,9 +80,8 @@ void OnButtonPressNotification::Run() { (*message_)[strings::msg_params][strings::app_id].asUInt()); // custom_button_id is mandatory for CUSTOM_BUTTON notification - if (false == - (*message_)[strings::msg_params].keyExists( - hmi_response::custom_button_id)) { + if (false == (*message_)[strings::msg_params].keyExists( + hmi_response::custom_button_id)) { LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without custom_button_id."); return; @@ -196,4 +195,4 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc index dff3aa6808..9c7edf74e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_command_notification.cc @@ -84,4 +84,4 @@ void OnCommandNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc index ca5d4bfed4..42a1928f2e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_driver_distraction_notification.cc @@ -67,4 +67,4 @@ void OnDriverDistractionNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc index e252b031e6..c2ce2550b9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hash_change_notification.cc @@ -34,9 +34,9 @@ #include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h" +#include <string> #include "application_manager/application_impl.h" #include "interfaces/MOBILE_API.h" -#include <string> namespace sdl_rpc_plugin { using namespace application_manager; @@ -81,4 +81,4 @@ void OnHashChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc index 6b5838e40a..df3bce0154 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc @@ -33,8 +33,8 @@ #include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h" -#include "application_manager/message_helper.h" #include "application_manager/message.h" +#include "application_manager/message_helper.h" #include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { @@ -92,4 +92,4 @@ void OnHMIStatusNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index c4ee22afed..28325a40f5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h" -#include "application_manager/message_helper.h" #include "application_manager/message.h" +#include "application_manager/message_helper.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -132,4 +132,4 @@ void OnHMIStatusNotificationFromMobile::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc index 04b52f29e1..8ec8a86554 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc @@ -93,4 +93,4 @@ void OnKeyBoardInputNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc index fdbdd910a0..9605fd6074 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_language_change_notification.cc @@ -60,4 +60,4 @@ void OnLanguageChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc index 32d940aca2..f64ca34bf2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_permissions_change_notification.cc @@ -62,4 +62,4 @@ void OnPermissionsChangeNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc new file mode 100644 index 0000000000..515279c5f9 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_capability_updated_notification.cc @@ -0,0 +1,181 @@ +#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h" + +#include "application_manager/app_service_manager.h" +#include "application_manager/application_manager.h" +#include "application_manager/helpers/application_helper.h" +#include "application_manager/message_helper.h" +#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h" +#include "smart_objects/enum_schema_item.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; +namespace commands { +namespace mobile { + +OnSystemCapabilityUpdatedNotification::OnSystemCapabilityUpdatedNotification( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandNotificationImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +OnSystemCapabilityUpdatedNotification:: + ~OnSystemCapabilityUpdatedNotification() {} + +void OnSystemCapabilityUpdatedNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + mobile_apis::SystemCapabilityType::eType system_capability_type = + static_cast<mobile_apis::SystemCapabilityType::eType>( + msg_params[strings::system_capability] + [strings::system_capability_type] + .asInt()); + + switch (system_capability_type) { + case mobile_apis::SystemCapabilityType::NAVIGATION: { + smart_objects::SmartObject nav_capability(smart_objects::SmartType_Map); + bool has_nav_capability = false; + if (hmi_capabilities_.navigation_capability()) { + has_nav_capability = true; + nav_capability = *hmi_capabilities_.navigation_capability(); + } + has_nav_capability = application_manager_.GetAppServiceManager() + .UpdateNavigationCapabilities(nav_capability) || + has_nav_capability; + + if (has_nav_capability) { + msg_params[strings::system_capability][strings::navigation_capability] = + nav_capability; + } else { + return; + } + break; + } + case mobile_apis::SystemCapabilityType::PHONE_CALL: { + if (hmi_capabilities_.phone_capability()) { + msg_params[strings::system_capability][strings::phone_capability] = + *hmi_capabilities_.phone_capability(); + } else { + return; + } + break; + } + case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: { + if (!hmi_capabilities_.is_rc_cooperating()) { + return; + } + if (hmi_capabilities_.rc_capability()) { + msg_params[strings::system_capability][strings::rc_capability] = + *hmi_capabilities_.rc_capability(); + } else { + return; + } + break; + } + case mobile_apis::SystemCapabilityType::VIDEO_STREAMING: + if (hmi_capabilities_.video_streaming_capability()) { + msg_params[strings::system_capability] + [strings::video_streaming_capability] = + *hmi_capabilities_.video_streaming_capability(); + } else { + return; + } + break; + case mobile_apis::SystemCapabilityType::APP_SERVICES: { + auto all_services = + application_manager_.GetAppServiceManager().GetAllServiceRecords(); + auto app_service_caps = + MessageHelper::CreateAppServiceCapabilities(all_services); + + smart_objects::SmartArray* app_services = + app_service_caps[strings::app_services].asArray(); + smart_objects::SmartObject& updated_capabilities = + msg_params[strings::system_capability] + [strings::app_services_capabilities][strings::app_services]; + for (size_t i = 0; i < updated_capabilities.length(); i++) { + std::string service_id = + updated_capabilities[i][strings::updated_app_service_record] + [strings::service_id] + .asString(); + auto matching_service_predicate = + [&service_id]( + const smart_objects::SmartObject& app_service_capability) { + return service_id == + app_service_capability[strings::updated_app_service_record] + [strings::service_id] + .asString(); + }; + + auto it = std::find_if(app_services->begin(), + app_services->end(), + matching_service_predicate); + if (it != app_services->end()) { + LOG4CXX_DEBUG( + logger_, + "Replacing updated record with service_id " << service_id); + app_services->erase(it); + } + app_services->push_back(updated_capabilities[i]); + } + msg_params[strings::system_capability] + [strings::app_services_capabilities] = app_service_caps; + break; + } + default: + return; + } + + const char* capability_type_string; + ns_smart_device_link::ns_smart_objects::EnumConversionHelper< + mobile_apis::SystemCapabilityType::eType>:: + EnumToCString(system_capability_type, &capability_type_string); + + auto subscribed_to_capability_predicate = + [&system_capability_type](const ApplicationSharedPtr app) { + DCHECK_OR_RETURN(app, false); + auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); + return ext.IsSubscribedTo(system_capability_type); + }; + + const std::vector<ApplicationSharedPtr>& applications = FindAllApps( + application_manager_.applications(), subscribed_to_capability_predicate); + + LOG4CXX_DEBUG(logger_, + "Number of Notifications to be sent: " << applications.size()); + + std::vector<ApplicationSharedPtr>::const_iterator app_it = + applications.begin(); + + for (; applications.end() != app_it; ++app_it) { + const ApplicationSharedPtr app = *app_it; + if (system_capability_type == + mobile_apis::SystemCapabilityType::REMOTE_CONTROL && + !app->is_remote_control_supported()) { + LOG4CXX_WARN( + logger_, + "App with connection key: " + << app->app_id() + << " was subcribed to REMOTE_CONTROL system capabilities, but " + "does not have RC permissions. Unsubscribing"); + auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); + ext.UnsubscribeFrom(system_capability_type); + continue; + } + LOG4CXX_INFO(logger_, + "Sending OnSystemCapabilityUpdated " << capability_type_string + << " application id " + << app->app_id()); + (*message_)[strings::params][strings::connection_key] = app->app_id(); + SendNotification(); + } +} + +} // namespace mobile +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc index b78e541f17..a85dec10bb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc @@ -30,15 +30,16 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <cstring> +#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h" #include <cstdio> +#include <cstring> #include <string> -#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h" -#include "interfaces/MOBILE_API.h" -#include "utils/file_system.h" -#include "policy/policy_table/enums.h" #include "application_manager/application_manager.h" #include "application_manager/policies/policy_handler_interface.h" +#include "interfaces/MOBILE_API.h" +#include "policy/policy_table/enums.h" +#include "utils/file_system.h" +#include "utils/helpers.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -65,6 +66,7 @@ void OnSystemRequestNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); using namespace application_manager; using namespace mobile_apis; + using namespace helpers; ApplicationSharedPtr app = application_manager_.application(connection_key()); @@ -106,6 +108,26 @@ void OnSystemRequestNotification::Run() { } } + LOG4CXX_DEBUG(logger_, + "Processing Request type : " << stringified_request_type); + + const bool binary_data_is_required = + Compare<mobile_apis::RequestType::eType, EQ, ONE>( + request_type, + mobile_apis::RequestType::PROPRIETARY, + mobile_apis::RequestType::OEM_SPECIFIC); + + BinaryMessage binary_data; + if (binary_data_is_required) { + const std::string filename = + (*message_)[strings::msg_params][strings::file_name].asString(); + file_system::ReadBinaryFile(filename, binary_data); + } + + if (mobile_apis::RequestType::OEM_SPECIFIC == request_type) { + (*message_)[strings::params][strings::binary_data] = binary_data; + } + if (mobile_apis::RequestType::PROPRIETARY == request_type) { /* According to requirements: "If the requestType = PROPRIETARY, add to mobile API fileType = JSON @@ -113,10 +135,6 @@ void OnSystemRequestNotification::Run() { Also in Genivi SDL we don't save the PT to file - we put it directly in binary_data */ - const std::string filename = - (*message_)[strings::msg_params][strings::file_name].asString(); - BinaryMessage binary_data; - file_system::ReadBinaryFile(filename, binary_data); #if defined(PROPRIETARY_MODE) AddHeader(binary_data); #endif // PROPRIETARY_MODE @@ -126,7 +144,9 @@ void OnSystemRequestNotification::Run() { #endif // PROPRIETARY_MODE (*message_)[strings::msg_params][strings::file_type] = FileType::JSON; - } else if (mobile_apis::RequestType::HTTP == request_type) { + } + + if (mobile_apis::RequestType::HTTP == request_type) { (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY; if ((*message_)[strings::msg_params].keyExists(strings::url)) { (*message_)[strings::msg_params][strings::timeout] = @@ -226,4 +246,4 @@ size_t OnSystemRequestNotification::ParsePTString( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc index 503f1b04d5..ccbdab15c9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_tbt_client_state_notification.cc @@ -76,4 +76,4 @@ void OnTBTClientStateNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc index 502f0ae57d..6ceb381d2e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_touch_event_notification.cc @@ -93,4 +93,4 @@ void OnTouchEventNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc index 2f666ffc03..e89ede53b9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_way_point_change_notification.cc @@ -67,4 +67,4 @@ void OnWayPointChangeNotification::Run() { } } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc index c90038a8b7..8f8e4dbf6f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <cstring> #include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h" +#include <cstring> #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" @@ -113,9 +113,9 @@ void PerformAudioPassThruRequest::Run() { initial_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); SendResponse( false, mobile_apis::Result::FILE_NOT_FOUND, @@ -450,4 +450,4 @@ bool PerformAudioPassThruRequest::IsWaitingHMIResponse() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc index a5eb98f2ba..5dae6327eb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_response.cc @@ -61,4 +61,4 @@ void PerformAudioPassThruResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index 42489fd8bd..6b2f3cbcc5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -31,20 +31,20 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <numeric> +#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h" #include <string.h> +#include <numeric> #include <string> -#include "sdl_rpc_plugin/commands/mobile/perform_interaction_request.h" #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" -#include "utils/file_system.h" -#include "utils/helpers.h" +#include "interfaces/MOBILE_API.h" #include "utils/custom_string.h" +#include "utils/file_system.h" #include "utils/gen_hash.h" +#include "utils/helpers.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -560,9 +560,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_WARN( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); invalid_params.push_back("help_prompt"); } else { msg_params[strings::help_prompt] = help_prompt; @@ -608,9 +608,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( timeout_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_WARN( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); invalid_params.push_back("timeout_prompt"); } else { msg_params[strings::timeout_prompt] = timeout_prompt; @@ -629,9 +629,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( initial_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_WARN( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); invalid_params.push_back("initial_prompt"); } else { msg_params[strings::initial_prompt] = initial_prompt; @@ -1065,4 +1065,4 @@ void PerformInteractionRequest::SendBothModeResponse( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc index 85bef9b2ad..fa02641c2b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_response.cc @@ -61,4 +61,4 @@ void PerformInteractionResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc index b418f52fa3..f68596ce27 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc @@ -31,22 +31,22 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "sdl_rpc_plugin/commands/mobile/put_file_request.h" +#include <algorithm> -#include "application_manager/policies/policy_handler.h" #include "application_manager/application_impl.h" +#include "application_manager/policies/policy_handler.h" #include "application_manager/rpc_service.h" -#include "utils/file_system.h" #include <boost/crc.hpp> +#include "utils/file_system.h" namespace { /** -* Calculates CRC32 checksum -* @param binary_data - input data for which CRC32 should be calculated -* @return calculated CRC32 checksum -*/ + * Calculates CRC32 checksum + * @param binary_data - input data for which CRC32 should be calculated + * @return calculated CRC32 checksum + */ uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) { const std::size_t file_size = binary_data.size(); boost::crc_32_type result; @@ -284,9 +284,7 @@ void PutFileRequest::Run() { } SendResponse(true, save_result, "File was downloaded", &response_params); - if (is_system_file) { - SendOnPutFileNotification(); - } + SendOnPutFileNotification(is_system_file); break; } default: @@ -297,7 +295,7 @@ void PutFileRequest::Run() { } } -void PutFileRequest::SendOnPutFileNotification() { +void PutFileRequest::SendOnPutFileNotification(bool is_system_file) { LOG4CXX_INFO(logger_, "SendOnPutFileNotification"); smart_objects::SmartObjectSPtr notification = std::make_shared<smart_objects::SmartObject>( @@ -316,9 +314,10 @@ void PutFileRequest::SendOnPutFileNotification() { message[strings::msg_params][strings::length] = length_; message[strings::msg_params][strings::persistent_file] = is_persistent_file_; message[strings::msg_params][strings::file_type] = file_type_; + message[strings::msg_params][strings::is_system_file] = is_system_file; rpc_service_.ManageHMICommand(notification); } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc index 8c54970a5c..f9ddbf7717 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_response.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/put_file_response.h" -#include "utils/file_system.h" #include "application_manager/application_impl.h" +#include "utils/file_system.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -70,4 +70,4 @@ void PutFileResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index 7957d9e055..597df26d0a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -33,19 +33,19 @@ #include "sdl_rpc_plugin/commands/mobile/register_app_interface_request.h" +#include <string.h> #include <unistd.h> #include <algorithm> #include <map> -#include <string.h> -#include "application_manager/application_manager.h" -#include "application_manager/policies/policy_handler_interface.h" -#include "application_manager/application_impl.h" #include "application_manager/app_launch/app_launch_ctrl.h" +#include "application_manager/application_impl.h" +#include "application_manager/application_manager.h" +#include "application_manager/helpers/application_helper.h" #include "application_manager/message_helper.h" -#include "application_manager/resumption/resume_ctrl.h" #include "application_manager/policies/policy_handler.h" -#include "application_manager/helpers/application_helper.h" +#include "application_manager/policies/policy_handler_interface.h" +#include "application_manager/resumption/resume_ctrl.h" #include "application_manager/rpc_service.h" #include "config_profile/profile.h" #include "interfaces/MOBILE_API.h" @@ -166,7 +166,7 @@ struct IsSameNickname { private: const custom_str::CustomString& app_id_; }; -} +} // namespace namespace sdl_rpc_plugin { using namespace application_manager; @@ -281,17 +281,51 @@ void RegisterAppInterfaceRequest::Run() { return; } - mobile_apis::Result::eType coincidence_result = CheckCoincidence(); + std::vector<ApplicationSharedPtr> duplicate_apps; + mobile_apis::Result::eType coincidence_result = + CheckCoincidence(duplicate_apps); + + if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result && + duplicate_apps.size() == 1) { + ApplicationSharedPtr duplicate_app = duplicate_apps.front(); + bool error_response = true; + if (duplicate_app->is_cloud_app()) { + if (duplicate_app->hybrid_app_preference() == + mobile_apis::HybridAppPreference::MOBILE) { + // Unregister cloud application and allow mobile application to register + // in it's place + application_manager_.UnregisterApplication( + duplicate_app->app_id(), mobile_apis::Result::USER_DISALLOWED); + error_response = false; + } + } else { + ApplicationSharedPtr cloud_app = + application_manager_.pending_application_by_policy_id(policy_app_id); + // If the duplicate name was not because of a mobile/cloud app pair, go + // through the normal process for handling duplicate names + if (cloud_app.use_count() == 0 || !cloud_app->is_cloud_app()) { + usage_statistics::AppCounter count_of_rejections_duplicate_name( + GetPolicyHandler().GetStatisticManager(), + policy_app_id, + usage_statistics::REJECTIONS_DUPLICATE_NAME); + ++count_of_rejections_duplicate_name; + } else if (cloud_app->hybrid_app_preference() == + mobile_apis::HybridAppPreference::CLOUD) { + // Unregister mobile application and allow cloud application to + // register in it's place + application_manager_.UnregisterApplication( + duplicate_app->app_id(), mobile_apis::Result::USER_DISALLOWED); + error_response = false; + } + } - if (mobile_apis::Result::SUCCESS != coincidence_result) { - LOG4CXX_ERROR(logger_, "Coincidence check failed."); - if (mobile_apis::Result::DUPLICATE_NAME == coincidence_result) { - usage_statistics::AppCounter count_of_rejections_duplicate_name( - GetPolicyHandler().GetStatisticManager(), - policy_app_id, - usage_statistics::REJECTIONS_DUPLICATE_NAME); - ++count_of_rejections_duplicate_name; + if (error_response) { + LOG4CXX_ERROR(logger_, "Coincidence check failed."); + SendResponse(false, coincidence_result); + return; } + } else if (mobile_apis::Result::SUCCESS != coincidence_result) { + LOG4CXX_ERROR(logger_, "Coincidence check failed."); SendResponse(false, coincidence_result); return; } @@ -346,19 +380,6 @@ void RegisterAppInterfaceRequest::Run() { application->set_msg_version(module_version); } - // For resuming application need to restore hmi_app_id from resumeCtrl - resumption::ResumeCtrl& resumer = application_manager_.resume_controller(); - const std::string& device_mac = application->mac_address(); - - // there is side affect with 2 mobile app with the same mobile app_id - if (resumer.IsApplicationSaved(policy_app_id, device_mac)) { - application->set_hmi_application_id( - resumer.GetHMIApplicationID(policy_app_id, device_mac)); - } else { - application->set_hmi_application_id( - application_manager_.GenerateNewHMIAppID()); - } - application->set_is_media_application( msg_params[strings::is_media_application].asBool()); @@ -379,9 +400,9 @@ void RegisterAppInterfaceRequest::Run() { tts_name, application, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_WARN(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_WARN( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); response_info_ = "One or more files needed for tts_name are not present"; result_code_ = mobile_apis::Result::WARNINGS; } @@ -433,17 +454,16 @@ void RegisterAppInterfaceRequest::Run() { // Add device to policy table and set device info, if any policy::DeviceParams dev_params; - if (-1 == - application_manager_.connection_handler() - .get_session_observer() - .GetDataOnDeviceID(application->device(), - &dev_params.device_name, - NULL, - &dev_params.device_mac_address, - &dev_params.device_connection_type)) { - LOG4CXX_ERROR(logger_, - "Failed to extract information for device " - << application->device()); + if (-1 == application_manager_.connection_handler() + .get_session_observer() + .GetDataOnDeviceID(application->device(), + &dev_params.device_name, + NULL, + &dev_params.device_mac_address, + &dev_params.device_connection_type)) { + LOG4CXX_ERROR( + logger_, + "Failed to extract information for device " << application->device()); } policy::DeviceInfo device_info; device_info.AdoptDeviceType(dev_params.device_connection_type); @@ -451,6 +471,8 @@ void RegisterAppInterfaceRequest::Run() { FillDeviceInfo(&device_info); } + const std::string& device_mac = application->mac_address(); + GetPolicyHandler().SetDeviceInfo(device_mac, device_info); SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication); @@ -458,6 +480,9 @@ void RegisterAppInterfaceRequest::Run() { GetLockScreenIconUrlNotification(connection_key(), application); rpc_service_.ManageMobileCommand(so, SOURCE_SDL); application_manager_.SendDriverDistractionState(application); + // Create onSystemRequest to mobile to obtain cloud app icons + application_manager_.SendGetIconUrlNotifications(connection_key(), + application); } smart_objects::SmartObjectSPtr @@ -816,8 +841,6 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( file_system::FileExists(application->app_icon_path()); SendResponse(true, result_code, add_info.c_str(), &response_params); - SendOnAppRegisteredNotificationToHMI( - *(application.get()), resumption, need_restore_vr); if (msg_params.keyExists(strings::app_hmi_type)) { GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(), &(msg_params[strings::app_hmi_type])); @@ -826,6 +849,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile( // Default HMI level should be set before any permissions validation, since it // relies on HMI level. application_manager_.OnApplicationRegistered(application); + SendOnAppRegisteredNotificationToHMI( + application, resumption, need_restore_vr); (*notify_upd_manager)(); // Start PTU after successfull registration @@ -877,9 +902,7 @@ void RegisterAppInterfaceRequest::SendChangeRegistrationOnHMI( } void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( - const app_mngr::Application& application_impl, - bool resumption, - bool need_restore_vr) { + ApplicationConstSharedPtr app, bool resumption, bool need_restore_vr) { using namespace smart_objects; SmartObjectSPtr notification = std::make_shared<SmartObject>(SmartType_Map); if (!notification) { @@ -903,15 +926,15 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( msg_params[strings::resume_vr_grammars] = need_restore_vr; } - if (application_impl.vr_synonyms()) { - msg_params[strings::vr_synonyms] = *(application_impl.vr_synonyms()); + if (app->vr_synonyms()) { + msg_params[strings::vr_synonyms] = *(app->vr_synonyms()); } - if (application_impl.tts_name()) { - msg_params[strings::tts_name] = *(application_impl.tts_name()); + if (app->tts_name()) { + msg_params[strings::tts_name] = *(app->tts_name()); } - const std::string policy_app_id = application_impl.policy_app_id(); + const std::string policy_app_id = app->policy_app_id(); std::string priority; GetPolicyHandler().GetPriority(policy_app_id, &priority); @@ -921,105 +944,19 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( msg_params[strings::msg_params] = SmartObject(SmartType_Map); smart_objects::SmartObject& application = msg_params[strings::application]; - application[strings::app_name] = application_impl.name(); - application[strings::app_id] = application_impl.app_id(); - application[hmi_response::policy_app_id] = policy_app_id; - if (file_system::FileExists(application_impl.app_icon_path())) { - application[strings::icon] = application_impl.app_icon_path(); - } - - const smart_objects::SmartObject* ngn_media_screen_name = - application_impl.ngn_media_screen_name(); - if (ngn_media_screen_name) { - application[strings::ngn_media_screen_app_name] = *ngn_media_screen_name; - } - - application[strings::hmi_display_language_desired] = - static_cast<int32_t>(application_impl.ui_language()); - - application[strings::is_media_application] = - application_impl.is_media_application(); - - const smart_objects::SmartObject* app_type = application_impl.app_types(); - if (app_type) { - application[strings::app_type] = *app_type; - } - - const policy::RequestType::State app_request_types_state = - GetPolicyHandler().GetAppRequestTypeState(policy_app_id); - if (policy::RequestType::State::AVAILABLE == app_request_types_state) { - const auto request_types = - GetPolicyHandler().GetAppRequestTypes(policy_app_id); - application[strings::request_type] = SmartObject(SmartType_Array); - smart_objects::SmartObject& request_types_array = - application[strings::request_type]; - - size_t index = 0; - for (auto it : request_types) { - request_types_array[index] = it; - ++index; - } - } else if (policy::RequestType::State::EMPTY == app_request_types_state) { - application[strings::request_type] = SmartObject(SmartType_Array); - } - - const policy::RequestSubType::State app_request_subtypes_state = - GetPolicyHandler().GetAppRequestSubTypeState(policy_app_id); - if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) { - const auto request_subtypes = - GetPolicyHandler().GetAppRequestSubTypes(policy_app_id); - application[strings::request_subtype] = SmartObject(SmartType_Array); - smart_objects::SmartObject& request_subtypes_array = - application[strings::request_subtype]; - - size_t index = 0; - for (auto it : request_subtypes) { - request_subtypes_array[index] = it; - ++index; - } - } else if (policy::RequestSubType::State::EMPTY == - app_request_subtypes_state) { - application[strings::request_subtype] = SmartObject(SmartType_Array); - } - const protocol_handler::SessionObserver& session_observer = application_manager_.connection_handler().get_session_observer(); - - application[strings::device_info] = SmartObject(SmartType_Map); - smart_objects::SmartObject& device_info = application[strings::device_info]; - MessageHelper::CreateDeviceInfo(application_impl.device(), - session_observer, - GetPolicyHandler(), - application_manager_, - &device_info); - - if (application_impl.secondary_device() != 0) { - application[strings::secondary_device_info] = SmartObject(SmartType_Map); - smart_objects::SmartObject& secondary_device_info = - application[strings::secondary_device_info]; - MessageHelper::CreateDeviceInfo(application_impl.secondary_device(), - session_observer, - GetPolicyHandler(), - application_manager_, - &secondary_device_info); - } - - const smart_objects::SmartObject* day_color_scheme = - application_impl.day_color_scheme(); - if (day_color_scheme) { - application[strings::day_color_scheme] = *day_color_scheme; - } - - const smart_objects::SmartObject* night_color_scheme = - application_impl.night_color_scheme(); - if (night_color_scheme) { - application[strings::night_color_scheme] = *night_color_scheme; - } + MessageHelper::CreateHMIApplicationStruct(app, + session_observer, + GetPolicyHandler(), + &application, + application_manager_); DCHECK(rpc_service_.ManageHMICommand(notification)); } -mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { +mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence( + std::vector<ApplicationSharedPtr>& out_duplicate_apps) { LOG4CXX_AUTO_TRACE(logger_); const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -1035,7 +972,8 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { const custom_str::CustomString& cur_name = (*it)->name(); if (app_name.CompareIgnoreCase(cur_name)) { LOG4CXX_ERROR(logger_, "Application name is known already."); - return mobile_apis::Result::DUPLICATE_NAME; + out_duplicate_apps.push_back(*it); + continue; } const smart_objects::SmartObject* vr = (*it)->vr_synonyms(); @@ -1046,7 +984,8 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { if (0 != std::count_if(curr_vr->begin(), curr_vr->end(), v)) { LOG4CXX_ERROR(logger_, "Application name is known already."); - return mobile_apis::Result::DUPLICATE_NAME; + out_duplicate_apps.push_back(*it); + continue; } } @@ -1058,12 +997,16 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckCoincidence() { CoincidencePredicateVR v(cur_name); if (0 != std::count_if(new_vr->begin(), new_vr->end(), v)) { LOG4CXX_ERROR(logger_, "vr_synonyms duplicated with app_name ."); - return mobile_apis::Result::DUPLICATE_NAME; + out_duplicate_apps.push_back(*it); + continue; } } // end vr check } // application for end + if (!out_duplicate_apps.empty()) { + return mobile_apis::Result::DUPLICATE_NAME; + } return mobile_apis::Result::SUCCESS; } // method end @@ -1268,7 +1211,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params][strings::device_info].keyExists( strings::hardware)) { str = (*message_)[strings::msg_params][strings::device_info] - [strings::hardware].asCharArray(); + [strings::hardware] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid device_info hardware syntax check failed"); @@ -1279,7 +1223,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params][strings::device_info].keyExists( strings::firmware_rev)) { str = (*message_)[strings::msg_params][strings::device_info] - [strings::firmware_rev].asCharArray(); + [strings::firmware_rev] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid device_info firmware_rev syntax check failed"); @@ -1300,7 +1245,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params][strings::device_info].keyExists( strings::os_version)) { str = (*message_)[strings::msg_params][strings::device_info] - [strings::os_version].asCharArray(); + [strings::os_version] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid device_info os_version syntax check failed"); @@ -1311,7 +1257,8 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params][strings::device_info].keyExists( strings::carrier)) { str = (*message_)[strings::msg_params][strings::device_info] - [strings::carrier].asCharArray(); + [strings::carrier] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid device_info carrier syntax check failed"); @@ -1379,18 +1326,18 @@ bool RegisterAppInterfaceRequest::IsApplicationSwitched() { auto app = application_manager_.application_by_policy_id(policy_app_id); if (!app) { - LOG4CXX_DEBUG(logger_, - "Application with policy id " << policy_app_id - << " is not found."); + LOG4CXX_DEBUG( + logger_, + "Application with policy id " << policy_app_id << " is not found."); return false; } LOG4CXX_DEBUG(logger_, "Application with policy id " << policy_app_id << " is found."); if (!application_manager_.IsAppInReconnectMode(policy_app_id)) { - LOG4CXX_DEBUG(logger_, - "Policy id " << policy_app_id - << " is not found in reconnection list."); + LOG4CXX_DEBUG( + logger_, + "Policy id " << policy_app_id << " is not found in reconnection list."); SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY); return false; } @@ -1425,4 +1372,4 @@ RegisterAppInterfaceRequest::GetPolicyHandler() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc index 584d7db075..b5683c62cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_response.cc @@ -32,11 +32,10 @@ */ #include "sdl_rpc_plugin/commands/mobile/register_app_interface_response.h" -#include "interfaces/MOBILE_API.h" #include "application_manager/application_manager.h" #include "application_manager/policies/policy_handler_interface.h" #include "connection_handler/connection_handler.h" -#include "application_manager/policies/policy_handler_interface.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -128,4 +127,4 @@ void RegisterAppInterfaceResponse::SetHeartBeatTimeout( } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc index ab6e1cc143..39363bbad1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_request.cc @@ -36,8 +36,8 @@ #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -333,4 +333,4 @@ bool ResetGlobalPropertiesRequest::IsPendingResponseExist() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc index f5542ab26b..07aa23d9c9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/reset_global_properties_response.cc @@ -61,4 +61,4 @@ void ResetGlobalPropertiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc index 0b28e09210..c1d02c96d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc @@ -31,14 +31,14 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string.h> #include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h" +#include <string.h> #include "application_manager/application_impl.h" -#include "application_manager/policies/policy_handler.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/policies/policy_handler.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "utils/helpers.h" namespace sdl_rpc_plugin { @@ -160,4 +160,4 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc index 4eee819497..6236506c00 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_response.cc @@ -69,4 +69,4 @@ void ScrollableMessageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc index a09434ebb6..6e745fe0db 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_request.cc @@ -105,4 +105,4 @@ void SendHapticDataRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc index f4515472a4..79a0516928 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_haptic_data_response.cc @@ -60,4 +60,4 @@ void SendHapticDataResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc index 2719d0674d..1df4d788d2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc @@ -30,8 +30,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "sdl_rpc_plugin/commands/mobile/send_location_request.h" +#include <algorithm> #include "application_manager/message_helper.h" #include "utils/custom_string.h" @@ -281,4 +281,4 @@ bool SendLocationRequest::CheckHMICapabilities( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc index 59dab4a9a7..934008b816 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_response.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/send_location_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" #include "interfaces/HMI_API.h" namespace sdl_rpc_plugin { @@ -63,4 +63,4 @@ void SendLocationResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc index e79fb315ce..b2363e870f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc @@ -34,10 +34,10 @@ #include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h" #include <algorithm> -#include "application_manager/message_helper.h" #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/message_helper.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "utils/file_system.h" #include "utils/helpers.h" @@ -148,10 +148,12 @@ void SetAppIconRequest::CopyToIconStorage( if (storage_max_size < file_size) { LOG4CXX_ERROR(logger_, - "Icon size (" << file_size << ") is bigger, than " - " icons storage maximum size (" - << storage_max_size << ")." - "Copying skipped."); + "Icon size (" << file_size + << ") is bigger, than " + " icons storage maximum size (" + << storage_max_size + << ")." + "Copying skipped."); return; } @@ -203,12 +205,12 @@ void SetAppIconRequest::CopyToIconStorage( void SetAppIconRequest::RemoveOldestIcons(const std::string& storage, const uint32_t icons_amount) const { const std::vector<std::string> icons_list = file_system::ListFiles(storage); - auto compareTime = [](const time_t t1, const time_t t2) - -> bool { return difftime(t1, t2) > 0; }; - std::map<time_t, - std::string, - std::function<bool(const time_t, const time_t)> > - icon_modification_time(compareTime); + auto compareTime = [](const time_t t1, const time_t t2) -> bool { + return difftime(t1, t2) > 0; + }; + std:: + map<time_t, std::string, std::function<bool(const time_t, const time_t)> > + icon_modification_time(compareTime); std::vector<std::string>::const_iterator it = icons_list.begin(); for (; it != icons_list.end(); ++it) { const std::string file_name = *it; @@ -271,7 +273,8 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { const std::string& path = (*message_)[strings::msg_params][strings::sync_file_name] - [strings::value].asString(); + [strings::value] + .asString(); if (is_icons_saving_enabled_) { CopyToIconStorage(path); @@ -298,4 +301,4 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc index aa8731f062..55255920d0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_response.cc @@ -61,4 +61,4 @@ void SetAppIconResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc new file mode 100644 index 0000000000..5173be56d6 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_request.cc @@ -0,0 +1,43 @@ +#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + +SetCloudAppPropertiesRequest::SetCloudAppPropertiesRequest( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandRequestImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +SetCloudAppPropertiesRequest::~SetCloudAppPropertiesRequest() {} + +void SetCloudAppPropertiesRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + policy_handler_.OnSetCloudAppProperties(*message_); + + SendResponse(true, mobile_apis::Result::SUCCESS); +} + +void SetCloudAppPropertiesRequest::on_event( + const app_mngr::event_engine::Event& event) { + LOG4CXX_INFO(logger_, "SetCloudAppPropertiesRequest on_event"); +} + +} // namespace commands +} // namespace sdl_rpc_plugin
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc new file mode 100644 index 0000000000..39d2ea7f90 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_cloud_app_properties_response.cc @@ -0,0 +1,31 @@ +#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h" +#include "application_manager/application_manager.h" +#include "application_manager/rpc_service.h" + +namespace sdl_rpc_plugin { +using namespace application_manager; + +namespace commands { + +SetCloudAppPropertiesResponse::SetCloudAppPropertiesResponse( + const app_mngr::commands::MessageSharedPtr& message, + app_mngr::ApplicationManager& application_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandResponseImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +SetCloudAppPropertiesResponse::~SetCloudAppPropertiesResponse() {} + +void SetCloudAppPropertiesResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc index 32164b8f0e..2a09a72af2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_request.cc @@ -33,8 +33,8 @@ #include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h" -#include "application_manager/message_helper.h" #include "application_manager/application_impl.h" +#include "application_manager/message_helper.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -145,9 +145,9 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { // in case templates_available is empty copy from hmi capabilities if (msg_params.keyExists(hmi_response::display_capabilities)) { - if (0 == - msg_params[hmi_response::display_capabilities] - [hmi_response::templates_available].length()) { + if (0 == msg_params[hmi_response::display_capabilities] + [hmi_response::templates_available] + .length()) { msg_params[hmi_response::display_capabilities] [hmi_response::templates_available] = hmi_capabilities.display_capabilities()->getElement( @@ -170,4 +170,4 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc index 4bab4a3e5b..0999b596b5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_display_layout_response.cc @@ -62,4 +62,4 @@ void SetDisplayLayoutResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc index 0c217b6b4f..bbfc61d463 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc @@ -30,14 +30,14 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h" #include <string.h> -#include <numeric> #include <algorithm> -#include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h" +#include <numeric> #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "utils/helpers.h" namespace sdl_rpc_plugin { @@ -74,9 +74,9 @@ void SetGlobalPropertiesRequest::Run() { ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, - "No application associated with connection key " - << connection_key()); + LOG4CXX_ERROR( + logger_, + "No application associated with connection key " << connection_key()); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -197,9 +197,9 @@ void SetGlobalPropertiesRequest::Run() { MessageHelper::VerifyTtsFiles(help_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); invalid_params.push_back("help_prompt"); } else { app->set_help_prompt(help_prompt); @@ -215,9 +215,9 @@ void SetGlobalPropertiesRequest::Run() { timeout_prompt, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); invalid_params.push_back("timeout_prompt"); } else { app->set_timeout_prompt(timeout_prompt); @@ -531,7 +531,8 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { strings::limited_character_list)) { const smart_objects::SmartArray* lcl_array = msg_params[strings::keyboard_properties] - [strings::limited_character_list].asArray(); + [strings::limited_character_list] + .asArray(); smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin(); smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end(); @@ -565,4 +566,4 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc index 567a1a088b..1de2b97d3a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_response.cc @@ -61,4 +61,4 @@ void SetGlobalPropertiesResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc index 55bd164368..d610090aa4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc @@ -33,10 +33,10 @@ #include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h" -#include "application_manager/message_helper.h" #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/message_helper.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -163,4 +163,4 @@ bool SetMediaClockRequest::isDataValid() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc index e777533ce4..948ff84156 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_response.cc @@ -61,4 +61,4 @@ void SetMediaClockTimerResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc index 3b2936e6cd..b439c1cb16 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc @@ -31,15 +31,15 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <cstring> #include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h" +#include <cstring> -#include "application_manager/policies/policy_handler.h" #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" +#include "application_manager/policies/policy_handler.h" #include "application_manager/policies/policy_handler_interface.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -228,7 +228,8 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { if ((*message_)[strings::msg_params].keyExists(strings::next_turn_icon)) { str = (*message_)[strings::msg_params][strings::next_turn_icon] - [strings::value].asCharArray(); + [strings::value] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid next_turn_icon value syntax check failed"); @@ -289,4 +290,4 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc index 239040a3b3..d027daf77d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_response.cc @@ -63,4 +63,4 @@ void ShowConstantTBTResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc index e0c3e1da9a..2bf1a81261 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc @@ -30,12 +30,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <string.h> #include "sdl_rpc_plugin/commands/mobile/show_request.h" +#include <string.h> -#include "application_manager/policies/policy_handler.h" #include "application_manager/application.h" #include "application_manager/message_helper.h" +#include "application_manager/policies/policy_handler.h" #include "utils/file_system.h" #include "utils/helpers.h" @@ -138,7 +138,8 @@ void ShowRequest::Run() { mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS; if (((*message_)[strings::msg_params].keyExists(strings::graphic)) && ((*message_)[strings::msg_params][strings::graphic][strings::value] - .asString()).length()) { + .asString()) + .length()) { verification_result = MessageHelper::VerifyImage( (*message_)[strings::msg_params][strings::graphic], app, @@ -398,7 +399,8 @@ bool ShowRequest::CheckStringsOfShowRequest() { if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) { str = (*message_)[strings::msg_params][strings::secondary_graphic] - [strings::value].asCharArray(); + [strings::value] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid secondary_graphic value syntax check failed"); @@ -410,4 +412,4 @@ bool ShowRequest::CheckStringsOfShowRequest() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc index 4e167e7531..f5667189b7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_response.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/show_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" #include "interfaces/HMI_API.h" namespace sdl_rpc_plugin { @@ -63,4 +63,4 @@ void ShowResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc index 08b4775d3f..d80e73ccbf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc @@ -35,8 +35,8 @@ #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "utils/helpers.h" #include "config_profile/profile.h" +#include "utils/helpers.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -204,4 +204,4 @@ bool SliderRequest::IsWhiteSpaceExist() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc index 4d6e714e88..4ac96a272e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_response.cc @@ -61,4 +61,4 @@ void SliderResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc index e14321c488..0730a8730f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string.h> #include "sdl_rpc_plugin/commands/mobile/speak_request.h" +#include <string.h> #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" @@ -84,9 +84,9 @@ void SpeakRequest::Run() { MessageHelper::VerifyTtsFiles(tts_chunks, app, application_manager_); if (mobile_apis::Result::FILE_NOT_FOUND == verification_result) { - LOG4CXX_ERROR(logger_, - "MessageHelper::VerifyTtsFiles return " - << verification_result); + LOG4CXX_ERROR( + logger_, + "MessageHelper::VerifyTtsFiles return " << verification_result); SendResponse(false, mobile_apis::Result::FILE_NOT_FOUND, "One or more files needed for tts_chunks are not present"); @@ -181,4 +181,4 @@ bool SpeakRequest::IsWhiteSpaceExist() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc index f57bd91cd5..69b04977ef 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_response.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/speak_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" #include "interfaces/HMI_API.h" namespace sdl_rpc_plugin { @@ -63,4 +63,4 @@ void SpeakResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc index f76b6ab210..0d3158d841 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_request.cc @@ -144,4 +144,4 @@ void SubscribeButtonRequest::SendSubscribeButtonNotification() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc index 1350cfb66e..e584f84f4c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_button_response.cc @@ -70,4 +70,4 @@ void SubscribeButtonResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc index eb4ca42568..2ee7771833 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_request.cc @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/application_manager.h" #include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h" +#include "application_manager/application_manager.h" #include "application_manager/message_helper.h" namespace sdl_rpc_plugin { @@ -120,4 +120,4 @@ bool SubscribeWayPointsRequest::Init() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc index 7d051df7e9..45486792d7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subscribe_way_points_response.cc @@ -30,9 +30,9 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" -#include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -61,4 +61,4 @@ void SubscribeWayPointsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc index cea00a9d5e..e70433f29b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc @@ -33,19 +33,19 @@ Copyright (c) 2018, Ford Motor Company #include "sdl_rpc_plugin/commands/mobile/system_request.h" -#include <vector> -#include <string> #include <stdio.h> #include <algorithm> #include <sstream> +#include <string> +#include <vector> #include "application_manager/policies/policy_handler_interface.h" -#include "interfaces/MOBILE_API.h" -#include "utils/file_system.h" -#include "policy/policy_table/enums.h" #include "formatters/CFormatterJsonBase.h" +#include "interfaces/MOBILE_API.h" #include "json/json.h" -#include "utils/helpers.h" +#include "policy/policy_table/enums.h" #include "utils/custom_string.h" +#include "utils/file_system.h" +#include "utils/helpers.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -170,17 +170,18 @@ class QueryAppsDataValidator { << "Package name length [" << app_data[json::android][json::packageName] .asString() - .length() << "] exceeds max length [" - << kPackageNameLengthMax << "]in json file."); + .length() + << "] exceeds max length [" << kPackageNameLengthMax + << "]in json file."); return false; } } // Languages verification if (!app_data[os_type].keyExists(json::languages)) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "'languages' doesn't exist"); + LOG4CXX_WARN( + logger_, + kQueryAppsValidationFailedPrefix << "'languages' doesn't exist"); return false; } if (!ValidateLanguages(app_data[os_type][json::languages], @@ -217,9 +218,9 @@ class QueryAppsDataValidator { ApplicationSharedPtr registered_app = manager_.application_by_policy_id(app_id); if (registered_app) { - LOG4CXX_INFO(logger_, - "Application with the id: " << app_id - << " is already registered."); + LOG4CXX_INFO( + logger_, + "Application with the id: " << app_id << " is already registered."); } // And app name length const std::string appName(app_data[json::name].asString()); @@ -250,9 +251,9 @@ class QueryAppsDataValidator { for (size_t idx = 0; idx < languages_array_size; ++idx) { const smart_objects::SmartObject& language = languages.getElement(idx); if (smart_objects::SmartType_Map != language.getType()) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "language is not a map."); + LOG4CXX_WARN( + logger_, + kQueryAppsValidationFailedPrefix << "language is not a map."); return false; } if (language.length() != 1) { @@ -263,9 +264,9 @@ class QueryAppsDataValidator { } const std::string language_name = (*language.map_begin()).first; if (!language_name.length()) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "language name is empty"); + LOG4CXX_WARN( + logger_, + kQueryAppsValidationFailedPrefix << "language name is empty"); return false; } // Verify default language defined @@ -329,9 +330,9 @@ class QueryAppsDataValidator { const smart_objects::SmartArray* synonyms_array = language[language_name][json::vrSynonyms].asArray(); if (!synonyms_array) { - LOG4CXX_WARN(logger_, - kQueryAppsValidationFailedPrefix - << "vrSynonyms is not array."); + LOG4CXX_WARN( + logger_, + kQueryAppsValidationFailedPrefix << "vrSynonyms is not array."); return false; } const size_t synonyms_array_size = synonyms_array->size(); @@ -421,7 +422,7 @@ class QueryAppsDataValidator { DISALLOW_COPY_AND_ASSIGN(QueryAppsDataValidator); }; -} +} // namespace namespace commands { @@ -511,7 +512,8 @@ void SystemRequest::Run() { return; } - if (!file_system::IsFileNameValid(file_name)) { + if (!file_system::IsFileNameValid(file_name) && + mobile_apis::RequestType::ICON_URL != request_type) { const std::string err_msg = "Sync file name contains forbidden symbols."; LOG4CXX_ERROR(logger_, err_msg); SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); @@ -533,8 +535,22 @@ void SystemRequest::Run() { std::string binary_data_folder; if ((*message_)[strings::params].keyExists(strings::binary_data)) { binary_data = (*message_)[strings::params][strings::binary_data].asBinary(); - binary_data_folder = - application_manager_.get_settings().system_files_path(); + if (mobile_apis::RequestType::ICON_URL == request_type) { + binary_data_folder = + application_manager_.get_settings().app_icons_folder(); + // Use the URL file name to identify the policy id. + // Save the icon file with the policy id as the name. + file_name = application_manager_.PolicyIDByIconUrl(file_name); + if (file_name.empty()) { + const std::string err_msg = "Invalid file name"; + SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); + return; + } + LOG4CXX_DEBUG(logger_, "Got ICON_URL Request. File name: " << file_name); + } else { + binary_data_folder = + application_manager_.get_settings().system_files_path(); + } } else { binary_data_folder = application_manager_.get_settings().app_storage_folder(); @@ -581,6 +597,12 @@ void SystemRequest::Run() { LOG4CXX_DEBUG(logger_, "Binary data ok."); + if (mobile_apis::RequestType::ICON_URL == request_type) { + application_manager_.SetIconFileFromSystemRequest(file_name); + SendResponse(true, mobile_apis::Result::SUCCESS); + return; + } + if (mobile_apis::RequestType::HTTP == request_type && (*message_)[strings::msg_params].keyExists(strings::file_name)) { const std::string& file = @@ -678,9 +700,9 @@ void SystemRequest::on_event(const event_engine::Event& event) { bool SystemRequest::ValidateQueryAppData( smart_objects::SmartObject& data) const { if (!data.isValid()) { - LOG4CXX_ERROR(logger_, - kQueryAppsValidationFailedPrefix - << "QueryApps response is not valid."); + LOG4CXX_ERROR( + logger_, + kQueryAppsValidationFailedPrefix << "QueryApps response is not valid."); return false; } if (!data.keyExists(json::response)) { @@ -697,4 +719,4 @@ bool SystemRequest::ValidateQueryAppData( } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc index dc2e3ea3f5..428901a1c5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_response.cc @@ -61,4 +61,4 @@ void SystemResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc index 9119fb48da..3ba0513aeb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_request.cc @@ -32,8 +32,8 @@ */ #include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h" -#include "application_manager/rpc_service.h" #include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" namespace sdl_rpc_plugin { using namespace application_manager; @@ -62,4 +62,4 @@ void UnregisterAppInterfaceRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc index 4e7c879b58..7c90639968 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unregister_app_interface_response.cc @@ -45,4 +45,4 @@ void UnregisterAppInterfaceResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc index 0c30f567b4..ebd463d4fa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_request.cc @@ -123,4 +123,4 @@ void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc index 592b91851e..c69d49bca1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_button_response.cc @@ -71,4 +71,4 @@ void UnsubscribeButtonResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc index 40bb1ddfc9..17326a99a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_request.cc @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/application_manager.h" #include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h" +#include "application_manager/application_manager.h" #include "application_manager/message_helper.h" namespace sdl_rpc_plugin { @@ -71,9 +71,20 @@ void UnsubscribeWayPointsRequest::Run() { return; } - StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); - SendHMIRequest( - hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true); + std::set<uint32_t> subscribed_apps = + application_manager_.GetAppsSubscribedForWayPoints(); + + if (subscribed_apps.size() > 1) { + // More than 1 subscribed app, don't send HMI unsubscribe request + application_manager_.UnsubscribeAppFromWayPoints(app); + SendResponse(true, mobile_apis::Result::SUCCESS, NULL); + return; + } else { + // Only subscribed app, send HMI unsubscribe request + StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); + SendHMIRequest( + hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true); + } } void UnsubscribeWayPointsRequest::on_event(const event_engine::Event& event) { @@ -114,4 +125,4 @@ bool UnsubscribeWayPointsRequest::Init() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc index 67e3466a44..a7a180fb46 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/unsubscribe_way_points_response.cc @@ -30,8 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/application_manager.h" #include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h" +#include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" namespace sdl_rpc_plugin { @@ -61,4 +61,4 @@ void UnsubscribeWayPointsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc index c04ad34f5f..8c2cce9765 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc @@ -31,14 +31,14 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h" +#include <string> -#include "application_manager/policies/policy_handler.h" #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/policies/policy_handler.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "utils/custom_string.h" namespace sdl_rpc_plugin { @@ -240,4 +240,4 @@ bool UpdateTurnListRequest::IsWhiteSpaceExist() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc index 5ddf355f88..eca9e3703c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_response.cc @@ -62,4 +62,4 @@ void UpdateTurnListResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc new file mode 100644 index 0000000000..5ffbbd83bb --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/extensions/system_capability_app_extension.cc @@ -0,0 +1,98 @@ +#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h" + +namespace sdl_rpc_plugin { +CREATE_LOGGERPTR_GLOBAL(logger_, "GetSystemCapabilitiesAppExtension") + +namespace app_mngr_ = application_manager; +const app_mngr_::AppExtensionUID + SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID = 200; + +SystemCapabilityAppExtension::SystemCapabilityAppExtension( + sdl_rpc_plugin::SDLRPCPlugin& plugin, app_mngr_::Application& app) + : app_mngr_::AppExtension( + SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID) + , plugin_(plugin) + , app_(app) {} + +SystemCapabilityAppExtension::~SystemCapabilityAppExtension() {} + +bool SystemCapabilityAppExtension::SubscribeTo( + const SystemCapabilityType system_capability_type) { + LOG4CXX_INFO(logger_, + "Subscribing to System Capability " << system_capability_type); + return subscribed_data_.insert(system_capability_type).second; +} + +bool SystemCapabilityAppExtension::UnsubscribeFrom( + const SystemCapabilityType system_capability_type) { + LOG4CXX_INFO( + logger_, + "Unsubscribing from System Capability " << system_capability_type); + auto it = subscribed_data_.find(system_capability_type); + if (it != subscribed_data_.end()) { + subscribed_data_.erase(it); + return true; + } + return false; +} + +void SystemCapabilityAppExtension::UnsubscribeFromAll() { + LOG4CXX_INFO(logger_, "Unsubscribing from ALL System Capabilities"); + subscribed_data_.clear(); +} + +bool SystemCapabilityAppExtension::IsSubscribedTo( + const SystemCapabilityType system_capability_type) const { + LOG4CXX_DEBUG(logger_, system_capability_type); + return subscribed_data_.find(system_capability_type) != + subscribed_data_.end(); +} + +SystemCapabilitySubscriptions SystemCapabilityAppExtension::Subscriptions() { + return subscribed_data_; +} + +void SystemCapabilityAppExtension::SaveResumptionData( + ns_smart_device_link::ns_smart_objects::SmartObject& resumption_data) { + LOG4CXX_AUTO_TRACE(logger_); + const char* application_system_capability = "systemCapability"; + + resumption_data[application_system_capability] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + int i = 0; + for (const auto& subscription : subscribed_data_) { + resumption_data[application_system_capability][i] = subscription; + i++; + } +} + +void SystemCapabilityAppExtension::ProcessResumption( + const smart_objects::SmartObject& resumption_data) { + LOG4CXX_AUTO_TRACE(logger_); + + const char* application_system_capability = "systemCapability"; + if (resumption_data.keyExists(application_system_capability)) { + const smart_objects::SmartObject& subscriptions = + resumption_data[application_system_capability]; + for (size_t i = 0; i < subscriptions.length(); ++i) { + SystemCapabilityType capability_type = + static_cast<SystemCapabilityType>((resumption_data[i]).asInt()); + SubscribeTo(capability_type); + } + } +} + +SystemCapabilityAppExtension& SystemCapabilityAppExtension::ExtractExtension( + app_mngr_::Application& app) { + LOG4CXX_AUTO_TRACE(logger_); + auto ext_ptr = app.QueryInterface( + SystemCapabilityAppExtension::SystemCapabilityAppExtensionUID); + DCHECK(ext_ptr); + DCHECK(dynamic_cast<SystemCapabilityAppExtension*>(ext_ptr.get())); + auto app_extension = + std::static_pointer_cast<SystemCapabilityAppExtension>(ext_ptr); + DCHECK(app_extension); + return *app_extension; +} +} // namespace sdl_rpc_plugin
\ No newline at end of file diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc index 342263105e..ab169f9c9b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc @@ -35,217 +35,224 @@ #include "application_manager/message.h" #include "interfaces/HMI_API.h" -#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h" -#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h" -#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h" -#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h" -#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h" +#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h" +#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h" #include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h" #include "sdl_rpc_plugin/commands/hmi/allow_all_apps_response.h" #include "sdl_rpc_plugin/commands/hmi/allow_app_request.h" #include "sdl_rpc_plugin/commands/hmi/allow_app_response.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h" -#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h" -#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h" -#include "sdl_rpc_plugin/commands/hmi/activate_app_request.h" -#include "sdl_rpc_plugin/commands/hmi/activate_app_response.h" +#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h" +#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h" +#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h" +#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h" +#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h" +#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h" #include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_request.h" #include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h" #include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_find_applications.h" +#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h" +#include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/get_system_info_request.h" -#include "sdl_rpc_plugin/commands/hmi/get_system_info_response.h" -#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h" -#include "sdl_rpc_plugin/commands/hmi/close_popup_response.h" -#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h" -#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_response.h" +#include "sdl_rpc_plugin/commands/hmi/on_update_device_list.h" +#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_request.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_request.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_request.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h" +#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_add_command_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_delete_command_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_delete_submenu_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_get_capabilities_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_change_registration_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_alert_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_get_language_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_get_language_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_get_supported_languages_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_is_ready_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_end_audio_pass_thru_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_response.h" -#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h" -#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_show_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_show_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_slider_response.h" +#include "sdl_rpc_plugin/commands/hmi/update_app_list_request.h" +#include "sdl_rpc_plugin/commands/hmi/update_app_list_response.h" +#include "sdl_rpc_plugin/commands/hmi/update_device_list_request.h" +#include "sdl_rpc_plugin/commands/hmi/update_device_list_response.h" +#include "sdl_rpc_plugin/commands/hmi/update_sdl_request.h" +#include "sdl_rpc_plugin/commands/hmi/update_sdl_response.h" #include "sdl_rpc_plugin/commands/hmi/vr_add_command_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_add_command_response.h" -#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h" -#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h" #include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_change_registration_response.h" -#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h" -#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h" -#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h" -#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h" +#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h" +#include "sdl_rpc_plugin/commands/hmi/vr_delete_command_response.h" #include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_is_ready_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_language_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_speak_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_response.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_response.h" +#include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h" +#include "sdl_rpc_plugin/commands/hmi/vr_get_language_response.h" +#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h" +#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_response.h" +#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h" +#include "sdl_rpc_plugin/commands/hmi/vr_is_ready_response.h" #include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_response.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_request.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h" #ifdef EXTERNAL_PROPRIETARY_MODE #include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_request.h" #include "sdl_rpc_plugin/commands/hmi/decrypt_certificate_response.h" #endif // EXTERNAL_PROPRIETARY_MODE +#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_request.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_close_application_response.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h" +#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h" +#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h" +#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h" +#include "sdl_rpc_plugin/commands/hmi/get_urls.h" +#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h" #include "sdl_rpc_plugin/commands/hmi/navi_is_ready_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h" #include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h" #include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_is_ready_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h" +#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h" #include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h" #include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_response.h" #include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h" #include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h" +#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h" +#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_response.h" +#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" -#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_set_video_config_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_start_stream_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_audio_start_stream_response.h" -#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h" +#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h" +#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" +#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" -#include "sdl_rpc_plugin/commands/hmi/add_statistics_info_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h" -#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h" -#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_response.h" -#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_request.h" -#include "sdl_rpc_plugin/commands/hmi/basic_communication_get_system_time_response.h" -#include "sdl_rpc_plugin/commands/hmi/basic_communication_on_awake_sdl.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h" #include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h" #include "sdl_rpc_plugin/commands/hmi/sdl_policy_update_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" -#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h" -#include "sdl_rpc_plugin/commands/hmi/get_urls.h" -#include "sdl_rpc_plugin/commands/hmi/get_urls_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_send_location_response.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" -#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h" -#include "sdl_rpc_plugin/commands/hmi/dial_number_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_response.h" #include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_show_app_menu_response.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_response.h" -#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h" -#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h" +#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_request.h" +#include "sdl_rpc_plugin/commands/hmi/bc_get_file_path_response.h" #include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_request.h" #include "sdl_rpc_plugin/commands/hmi/rc_get_capabilities_response.h" +#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_request.h" +#include "sdl_rpc_plugin/commands/hmi/rc_is_ready_response.h" + +#include "sdl_rpc_plugin/commands/hmi/on_bc_system_capability_updated_notification.h" namespace sdl_rpc_plugin { using namespace application_manager; +CREATE_LOGGERPTR_GLOBAL(logger_, "HMICommandFactory") + HMICommandFactory::HMICommandFactory( ApplicationManager& application_manager, rpc_service::RPCService& rpc_service, @@ -289,7 +296,8 @@ bool HMICommandFactory::IsAbleToProcess( return get_creator_factory( static_cast<hmi_apis::FunctionID::eType>(function_id), hmi_apis::messageType::INVALID_ENUM, - message_source).CanBeCreated(); + message_source) + .CanBeCreated(); } CommandCreator& HMICommandFactory::get_creator_factory( @@ -313,6 +321,13 @@ CommandCreator& HMICommandFactory::get_creator_factory( ? factory.GetCreator<commands::ActivateAppRequest>() : factory.GetCreator<commands::ActivateAppResponse>(); } + case hmi_apis::FunctionID::BasicCommunication_CloseApplication: { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator< + commands::BasicCommunicationCloseApplicationRequest>() + : factory.GetCreator< + commands::BasicCommunicationCloseApplicationResponse>(); + } #ifdef EXTERNAL_PROPRIETARY_MODE case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: { return hmi_apis::messageType::request == message_type @@ -847,8 +862,17 @@ CommandCreator& HMICommandFactory::get_creator_factory( ? factory.GetCreator<commands::UISendHapticDataRequest>() : factory.GetCreator<commands::UISendHapticDataResponse>(); } + case hmi_apis::FunctionID::BasicCommunication_GetFilePath: { + return hmi_apis::messageType::request == message_type + ? factory.GetCreator<commands::BCGetFilePathRequest>() + : factory.GetCreator<commands::BCGetFilePathResponse>(); + } + case hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated: { + return factory + .GetCreator<commands::OnBCSystemCapabilityUpdatedNotification>(); + } default: { return factory.GetCreator<InvalidCommand>(); } } } -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index 567707d497..0d24c03382 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -31,29 +31,38 @@ */ #include "sdl_rpc_plugin/mobile_command_factory.h" +#include "interfaces/MOBILE_API.h" #include "sdl_rpc_plugin/commands/mobile/add_command_request.h" #include "sdl_rpc_plugin/commands/mobile/add_command_response.h" -#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h" -#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h" #include "sdl_rpc_plugin/commands/mobile/add_sub_menu_request.h" #include "sdl_rpc_plugin/commands/mobile/add_sub_menu_response.h" -#include "sdl_rpc_plugin/commands/mobile/alert_request.h" -#include "sdl_rpc_plugin/commands/mobile/alert_response.h" #include "sdl_rpc_plugin/commands/mobile/alert_maneuver_request.h" #include "sdl_rpc_plugin/commands/mobile/alert_maneuver_response.h" +#include "sdl_rpc_plugin/commands/mobile/alert_request.h" +#include "sdl_rpc_plugin/commands/mobile/alert_response.h" #include "sdl_rpc_plugin/commands/mobile/change_registration_request.h" #include "sdl_rpc_plugin/commands/mobile/change_registration_response.h" +#include "sdl_rpc_plugin/commands/mobile/close_application_request.h" +#include "sdl_rpc_plugin/commands/mobile/close_application_response.h" #include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h" #include "sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_response.h" +#include "sdl_rpc_plugin/commands/mobile/delete_command_request.h" +#include "sdl_rpc_plugin/commands/mobile/delete_command_response.h" #include "sdl_rpc_plugin/commands/mobile/delete_file_request.h" #include "sdl_rpc_plugin/commands/mobile/delete_file_response.h" #include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_request.h" #include "sdl_rpc_plugin/commands/mobile/delete_interaction_choice_set_response.h" #include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_request.h" #include "sdl_rpc_plugin/commands/mobile/delete_sub_menu_response.h" +#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h" +#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h" #include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_request.h" #include "sdl_rpc_plugin/commands/mobile/end_audio_pass_thru_response.h" #include "sdl_rpc_plugin/commands/mobile/generic_response.h" +#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_request.h" +#include "sdl_rpc_plugin/commands/mobile/get_cloud_app_properties_response.h" +#include "sdl_rpc_plugin/commands/mobile/get_file_request.h" +#include "sdl_rpc_plugin/commands/mobile/get_file_response.h" #include "sdl_rpc_plugin/commands/mobile/get_system_capability_request.h" #include "sdl_rpc_plugin/commands/mobile/get_system_capability_response.h" #include "sdl_rpc_plugin/commands/mobile/get_way_points_request.h" @@ -64,14 +73,18 @@ #include "sdl_rpc_plugin/commands/mobile/on_audio_pass_thru_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_button_event_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_button_press_notification.h" +#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_driver_distraction_notification.h" +#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_hmi_status_notification_from_mobile.h" +#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_language_change_notification.h" -#include "sdl_rpc_plugin/commands/mobile/on_command_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_permissions_change_notification.h" +#include "sdl_rpc_plugin/commands/mobile/on_system_capability_updated_notification.h" +#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_tbt_client_state_notification.h" -#include "sdl_rpc_plugin/commands/mobile/on_hash_change_notification.h" +#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h" #include "sdl_rpc_plugin/commands/mobile/on_way_point_change_notification.h" #include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_request.h" #include "sdl_rpc_plugin/commands/mobile/perform_audio_pass_thru_response.h" @@ -85,12 +98,18 @@ #include "sdl_rpc_plugin/commands/mobile/reset_global_properties_response.h" #include "sdl_rpc_plugin/commands/mobile/scrollable_message_request.h" #include "sdl_rpc_plugin/commands/mobile/scrollable_message_response.h" +#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h" +#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h" +#include "sdl_rpc_plugin/commands/mobile/send_location_request.h" +#include "sdl_rpc_plugin/commands/mobile/send_location_response.h" +#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h" +#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_request.h" +#include "sdl_rpc_plugin/commands/mobile/set_cloud_app_properties_response.h" #include "sdl_rpc_plugin/commands/mobile/set_display_layout_request.h" #include "sdl_rpc_plugin/commands/mobile/set_display_layout_response.h" #include "sdl_rpc_plugin/commands/mobile/set_global_properties_request.h" #include "sdl_rpc_plugin/commands/mobile/set_global_properties_response.h" -#include "sdl_rpc_plugin/commands/mobile/set_app_icon_request.h" -#include "sdl_rpc_plugin/commands/mobile/set_app_icon_response.h" #include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_request.h" #include "sdl_rpc_plugin/commands/mobile/set_media_clock_timer_response.h" #include "sdl_rpc_plugin/commands/mobile/show_constant_tbt_request.h" @@ -105,40 +124,28 @@ #include "sdl_rpc_plugin/commands/mobile/subscribe_button_response.h" #include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_request.h" #include "sdl_rpc_plugin/commands/mobile/subscribe_way_points_response.h" -#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h" -#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h" +#include "sdl_rpc_plugin/commands/mobile/system_request.h" +#include "sdl_rpc_plugin/commands/mobile/system_response.h" #include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_request.h" #include "sdl_rpc_plugin/commands/mobile/unregister_app_interface_response.h" #include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_request.h" #include "sdl_rpc_plugin/commands/mobile/unsubscribe_button_response.h" +#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_request.h" +#include "sdl_rpc_plugin/commands/mobile/unsubscribe_way_points_response.h" #include "sdl_rpc_plugin/commands/mobile/update_turn_list_request.h" #include "sdl_rpc_plugin/commands/mobile/update_turn_list_response.h" -#include "sdl_rpc_plugin/commands/mobile/system_request.h" -#include "sdl_rpc_plugin/commands/mobile/system_response.h" -#include "sdl_rpc_plugin/commands/mobile/on_keyboard_input_notification.h" -#include "sdl_rpc_plugin/commands/mobile/on_touch_event_notification.h" -#include "sdl_rpc_plugin/commands/mobile/on_system_request_notification.h" -#include "sdl_rpc_plugin/commands/mobile/send_location_request.h" -#include "sdl_rpc_plugin/commands/mobile/send_location_response.h" -#include "sdl_rpc_plugin/commands/mobile/dial_number_request.h" -#include "sdl_rpc_plugin/commands/mobile/dial_number_response.h" -#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h" -#include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h" #include "sdl_rpc_plugin/commands/mobile/show_app_menu_request.h" #include "sdl_rpc_plugin/commands/mobile/show_app_menu_response.h" -#include "interfaces/MOBILE_API.h" CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace sdl_rpc_plugin { using namespace application_manager; -CommandCreator& MobileCommandFactory::get_creator_factory( - mobile_apis::FunctionID::eType id, - mobile_apis::messageType::eType message_type, - app_mngr::commands::Command::CommandSource source) const { +CommandCreator& MobileCommandFactory::get_command_creator( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type) const { CommandCreatorFactory factory( application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); - switch (id) { case mobile_apis::FunctionID::RegisterAppInterfaceID: { return mobile_api::messageType::request == message_type @@ -177,7 +184,6 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator<commands::AddSubMenuRequest>() : factory.GetCreator<commands::AddSubMenuResponse>(); } - case mobile_apis::FunctionID::DeleteSubMenuID: { return mobile_api::messageType::request == message_type ? factory.GetCreator<commands::DeleteSubMenuRequest>() @@ -215,7 +221,6 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator<commands::PerformAudioPassThruRequest>() : factory.GetCreator<commands::PerformAudioPassThruResponse>(); } - case mobile_apis::FunctionID::CreateInteractionChoiceSetID: { return mobile_api::messageType::request == message_type ? factory.GetCreator< @@ -238,6 +243,11 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator<commands::PutFileRequest>() : factory.GetCreator<commands::PutFileResponse>(); } + case mobile_apis::FunctionID::GetFileID: { + return mobile_api::messageType::request == message_type + ? factory.GetCreator<commands::GetFileRequest>() + : factory.GetCreator<commands::GetFileResponse>(); + } case mobile_apis::FunctionID::DeleteFileID: { return mobile_api::messageType::request == message_type ? factory.GetCreator<commands::DeleteFileRequest>() @@ -293,7 +303,6 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator<commands::ScrollableMessageRequest>() : factory.GetCreator<commands::ScrollableMessageResponse>(); } - case mobile_apis::FunctionID::AlertManeuverID: { return mobile_api::messageType::request == message_type ? factory.GetCreator<commands::AlertManeuverRequest>() @@ -344,6 +353,37 @@ CommandCreator& MobileCommandFactory::get_creator_factory( ? factory.GetCreator<commands::SendHapticDataRequest>() : factory.GetCreator<commands::SendHapticDataResponse>(); } + case mobile_apis::FunctionID::SetCloudAppPropertiesID: { + return mobile_api::messageType::request == message_type + ? factory.GetCreator<commands::SetCloudAppPropertiesRequest>() + : factory + .GetCreator<commands::SetCloudAppPropertiesResponse>(); + } + case mobile_apis::FunctionID::GetCloudAppPropertiesID: { + return mobile_api::messageType::request == message_type + ? factory.GetCreator<commands::GetCloudAppPropertiesRequest>() + : factory + .GetCreator<commands::GetCloudAppPropertiesResponse>(); + } + case mobile_apis::FunctionID::CloseApplicationID: { + return mobile_api::messageType::request == message_type + ? factory.GetCreator<commands::CloseApplicationRequest>() + : factory.GetCreator<commands::CloseApplicationResponse>(); + } + case mobile_apis::FunctionID::GenericResponseID: { + using app_mngr::commands::Command; + return factory.GetCreator<commands::GenericResponse>(); + } + default: {} + } + return factory.GetCreator<InvalidCommand>(); +} + +CommandCreator& MobileCommandFactory::get_notification_creator( + const mobile_apis::FunctionID::eType id) const { + CommandCreatorFactory factory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + switch (id) { case mobile_apis::FunctionID::OnButtonEventID: { return factory.GetCreator<commands::mobile::OnButtonEventNotification>(); } @@ -374,11 +414,7 @@ CommandCreator& MobileCommandFactory::get_creator_factory( return factory.GetCreator<commands::OnPermissionsChangeNotification>(); } case mobile_apis::FunctionID::OnHMIStatusID: { - using app_mngr::commands::Command; - return Command::CommandSource::SOURCE_MOBILE == source - ? factory.GetCreator< - commands::OnHMIStatusNotificationFromMobile>() - : factory.GetCreator<commands::OnHMIStatusNotification>(); + return factory.GetCreator<commands::OnHMIStatusNotification>(); } case mobile_apis::FunctionID::OnKeyboardInputID: { return factory @@ -387,24 +423,69 @@ CommandCreator& MobileCommandFactory::get_creator_factory( case mobile_apis::FunctionID::OnTouchEventID: { return factory.GetCreator<commands::mobile::OnTouchEventNotification>(); } + case mobile_apis::FunctionID::OnSystemCapabilityUpdatedID: { + return factory.GetCreator< + commands::mobile::OnSystemCapabilityUpdatedNotification>(); + } case mobile_apis::FunctionID::OnSystemRequestID: { return factory .GetCreator<commands::mobile::OnSystemRequestNotification>(); } case mobile_apis::FunctionID::OnHashChangeID: { - using app_mngr::commands::Command; return factory.GetCreator<commands::mobile::OnHashChangeNotification>(); } case mobile_apis::FunctionID::OnWayPointChangeID: { - using app_mngr::commands::Command; return factory.GetCreator<commands::OnWayPointChangeNotification>(); } - case mobile_apis::FunctionID::GenericResponseID: { - using app_mngr::commands::Command; - return factory.GetCreator<commands::GenericResponse>(); + default: {} + } + return factory.GetCreator<InvalidCommand>(); +} + +CommandCreator& MobileCommandFactory::get_notification_from_mobile_creator( + const mobile_apis::FunctionID::eType id) const { + CommandCreatorFactory factory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + switch (id) { + case mobile_apis::FunctionID::OnHMIStatusID: { + return factory.GetCreator<commands::OnHMIStatusNotificationFromMobile>(); } - default: { return factory.GetCreator<InvalidCommand>(); } + default: {} } + return factory.GetCreator<InvalidCommand>(); +} + +CommandCreator& MobileCommandFactory::get_creator_factory( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type, + const app_mngr::commands::Command::CommandSource source) const { + switch (message_type) { + case mobile_api::messageType::request: { + if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) { + return get_command_creator(id, message_type); + } + break; + } + case mobile_api::messageType::response: { + if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) { + return get_command_creator(id, message_type); + } + break; + } + case mobile_api::messageType::notification: { + if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) { + return get_notification_creator(id); + } else if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == + source) { + return get_notification_from_mobile_creator(id); + } + break; + } + default: {} + } + CommandCreatorFactory factory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + return factory.GetCreator<InvalidCommand>(); } MobileCommandFactory::MobileCommandFactory( @@ -421,11 +502,10 @@ bool MobileCommandFactory::IsAbleToProcess( const int32_t function_id, const application_manager::commands::Command::CommandSource message_source) const { - using app_mngr::commands::Command; - return get_creator_factory( - static_cast<mobile_apis::FunctionID::eType>(function_id), - mobile_apis::messageType::INVALID_ENUM, - message_source).CanBeCreated(); + auto id = static_cast<mobile_apis::FunctionID::eType>(function_id); + return get_command_creator(id, mobile_apis::messageType::INVALID_ENUM) + .CanBeCreated() || + get_notification_creator(id).CanBeCreated(); } CommandSharedPtr MobileCommandFactory::CreateCommand( @@ -446,4 +526,4 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( return get_creator_factory(function_id, message_type, source).create(message); } -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc index efdcde7526..21f15a33fe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_command_factory.cc @@ -55,7 +55,8 @@ SDLCommandFactory::SDLCommandFactory( app_mngr::CommandSharedPtr SDLCommandFactory::CreateCommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { - if (app_mngr::commands::Command::SOURCE_HMI == source) { + if (app_mngr::commands::Command::SOURCE_HMI == source || + app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) { return hmi_command_factory_->CreateCommand(message, source); } else { return mobile_command_factory_->CreateCommand(message, source); @@ -70,9 +71,10 @@ bool SDLCommandFactory::IsAbleToProcess( bool is_mobile_command_factory_able_to_process = mobile_command_factory_->IsAbleToProcess(FunctionID, source); - return app_mngr::commands::Command::SOURCE_HMI == source + return (app_mngr::commands::Command::SOURCE_HMI == source || + app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) ? is_hmi_command_factory_able_to_process : is_mobile_command_factory_able_to_process; } -} // namespace application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc index 22b818f5e0..b261b20c24 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/sdl_rpc_plugin.cc @@ -31,16 +31,20 @@ */ #include "sdl_rpc_plugin/sdl_rpc_plugin.h" +#include "application_manager/plugin_manager/plugin_keys.h" +#include "sdl_rpc_plugin/extensions/system_capability_app_extension.h" #include "sdl_rpc_plugin/sdl_command_factory.h" namespace sdl_rpc_plugin { +namespace app_mngr = application_manager; namespace plugins = application_manager::plugin_manager; -bool SDLRPCPlugin::Init( - application_manager::ApplicationManager& app_manager, - application_manager::rpc_service::RPCService& rpc_service, - application_manager::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler) { +CREATE_LOGGERPTR_GLOBAL(logger_, "SdlRPCPlugin") + +bool SDLRPCPlugin::Init(app_mngr::ApplicationManager& app_manager, + app_mngr::rpc_service::RPCService& rpc_service, + app_mngr::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) { command_factory_.reset(new sdl_rpc_plugin::SDLCommandFactory( app_manager, rpc_service, hmi_capabilities, policy_handler)); return true; @@ -48,25 +52,35 @@ bool SDLRPCPlugin::Init( bool SDLRPCPlugin::IsAbleToProcess( const int32_t function_id, - const application_manager::commands::Command::CommandSource - message_source) { + const app_mngr::commands::Command::CommandSource message_source) { return command_factory_->IsAbleToProcess(function_id, message_source); } std::string SDLRPCPlugin::PluginName() { - return "SDL RPC Plugin"; + return plugins::plugin_names::sdl_rpc_plugin; } -application_manager::CommandFactory& SDLRPCPlugin::GetCommandFactory() { +app_mngr::CommandFactory& SDLRPCPlugin::GetCommandFactory() { return *command_factory_; } -void SDLRPCPlugin::OnPolicyEvent( - application_manager::plugin_manager::PolicyEvent event) {} +void SDLRPCPlugin::OnPolicyEvent(plugins::PolicyEvent event) {} void SDLRPCPlugin::OnApplicationEvent( - application_manager::plugin_manager::ApplicationEvent event, - application_manager::ApplicationSharedPtr application) {} + plugins::ApplicationEvent event, + app_mngr::ApplicationSharedPtr application) { + if (plugins::ApplicationEvent::kApplicationRegistered == event) { + application->AddExtension( + std::make_shared<SystemCapabilityAppExtension>(*this, *application)); + } else if (plugins::ApplicationEvent::kDeleteApplicationData == event) { + ClearSubscriptions(application); + } +} + +void SDLRPCPlugin::ClearSubscriptions(app_mngr::ApplicationSharedPtr app) { + auto& ext = SystemCapabilityAppExtension::ExtractExtension(*app); + ext.UnsubscribeFromAll(); +} } // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc index 50b7aae42a..7dadad59fe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc @@ -30,12 +30,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/activate_app_request.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" +#include "gtest/gtest.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -47,9 +47,9 @@ using ::testing::_; namespace am = ::application_manager; namespace strings = ::application_manager::strings; +using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::ActivateAppRequest; -using am::commands::CommandImpl; using ::test::components::application_manager_test::MockApplication; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc index a5707488dd..01487284a4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc @@ -30,15 +30,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/add_statistics_info_notification.h" +#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/policies/policy_handler.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/policies/policy_handler.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -49,11 +49,11 @@ namespace add_statistics_info_notification { namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_notification = ::application_manager::hmi_notification; -using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::AddStatisticsInfoNotification; using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; using policy::PolicyHandler; using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::AddStatisticsInfoNotification; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc index a2fcf8f605..251fe230fc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/allow_all_apps_response.h" +#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { namespace commands_test { @@ -53,7 +53,7 @@ typedef std::shared_ptr<AllowAllAppsResponse> ResponsePtr; namespace { const bool kResponseIsAllowed = true; -} // +} // namespace class AllowAllAppsResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc index 2ce400542a..a0e23d7b9d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/allow_app_response.h" +#include "gtest/gtest.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -53,7 +53,7 @@ namespace hmi_response = ::application_manager::hmi_response; namespace { const uint32_t kConnectionKey = 1u; const bool kIsResponseAllowed = true; -} +} // namespace typedef std::shared_ptr<AllowAppResponse> ResponsePtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc index a3f0ab6933..0251c4873d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc @@ -28,7 +28,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #include "hmi/basic_communication_get_system_time_request.h" diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc index 8f56c6462c..0c8e986fc6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc @@ -30,12 +30,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "hmi/basic_communication_get_system_time_response.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" #include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "interfaces/HMI_API.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc index 6ed15bebeb..7d9ed899a6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/button_get_capabilities_response.h" +#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" #include "application_manager/mock_hmi_capabilities.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { namespace commands_test { @@ -45,8 +45,8 @@ namespace button_get_capabilities_response { using application_manager::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::ButtonGetCapabilitiesResponse; -using ::testing::ReturnRef; using ::testing::NiceMock; +using ::testing::ReturnRef; namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; @@ -100,7 +100,8 @@ TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) { EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_)) .Times(0); EXPECT_CALL(mock_hmi_capabilities_, - set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0); + set_preset_bank_capabilities(preset_bank_capabilities_)) + .Times(0); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc index 6914a4ca7e..087109c871 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc @@ -35,13 +35,13 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" -#include "application_manager/commands/response_from_hmi.h" -#include "hmi/close_popup_response.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/commands/response_from_hmi.h" #include "application_manager/mock_application.h" +#include "application_manager/smart_object_keys.h" +#include "hmi/close_popup_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -50,9 +50,9 @@ namespace hmi_commands_test { namespace close_popup_response { namespace am = ::application_manager; +using am::commands::CommandImpl; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::ClosePopupResponse; -using am::commands::CommandImpl; typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc index a6497ca6e1..f5593bf241 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc @@ -37,192 +37,193 @@ #include <vector> #include "gtest/gtest.h" +#include "hmi/activate_app_request.h" +#include "hmi/activate_app_response.h" +#include "hmi/add_statistics_info_notification.h" #include "hmi/allow_all_apps_request.h" #include "hmi/allow_all_apps_response.h" #include "hmi/allow_app_request.h" #include "hmi/allow_app_response.h" +#include "hmi/basic_communication_system_request.h" +#include "hmi/basic_communication_system_response.h" +#include "hmi/bc_get_file_path_request.h" +#include "hmi/bc_get_file_path_response.h" +#include "hmi/button_get_capabilities_request.h" +#include "hmi/button_get_capabilities_response.h" +#include "hmi/close_popup_request.h" +#include "hmi/close_popup_response.h" +#include "hmi/dial_number_request.h" +#include "hmi/dial_number_response.h" +#include "hmi/get_system_info_request.h" +#include "hmi/get_system_info_response.h" +#include "hmi/get_urls.h" +#include "hmi/get_urls_response.h" +#include "hmi/mixing_audio_supported_request.h" +#include "hmi/mixing_audio_supported_response.h" +#include "hmi/navi_alert_maneuver_request.h" +#include "hmi/navi_alert_maneuver_response.h" #include "hmi/navi_audio_start_stream_request.h" #include "hmi/navi_audio_start_stream_response.h" #include "hmi/navi_audio_stop_stream_request.h" #include "hmi/navi_audio_stop_stream_response.h" -#include "hmi/update_device_list_request.h" -#include "hmi/update_device_list_response.h" -#include "hmi/on_update_device_list.h" -#include "hmi/on_start_device_discovery.h" -#include "hmi/update_app_list_request.h" -#include "hmi/update_app_list_response.h" -#include "hmi/on_find_applications.h" -#include "hmi/sdl_get_list_of_permissions_request.h" -#include "hmi/sdl_get_list_of_permissions_response.h" -#include "hmi/sdl_get_user_friendly_message_request.h" -#include "hmi/sdl_get_user_friendly_message_response.h" -#include "hmi/sdl_get_status_update_request.h" -#include "hmi/sdl_get_status_update_response.h" -#include "hmi/on_status_update_notification.h" -#include "hmi/update_sdl_request.h" -#include "hmi/update_sdl_response.h" -#include "hmi/activate_app_request.h" -#include "hmi/activate_app_response.h" -#include "hmi/mixing_audio_supported_request.h" -#include "hmi/mixing_audio_supported_response.h" +#include "hmi/navi_get_way_points_request.h" +#include "hmi/navi_get_way_points_response.h" +#include "hmi/navi_is_ready_request.h" +#include "hmi/navi_is_ready_response.h" +#include "hmi/navi_send_location_request.h" +#include "hmi/navi_send_location_response.h" +#include "hmi/navi_show_constant_tbt_request.h" +#include "hmi/navi_show_constant_tbt_response.h" +#include "hmi/navi_start_stream_request.h" +#include "hmi/navi_start_stream_response.h" +#include "hmi/navi_stop_stream_request.h" +#include "hmi/navi_stop_stream_response.h" +#include "hmi/navi_subscribe_way_points_request.h" +#include "hmi/navi_subscribe_way_points_response.h" +#include "hmi/navi_unsubscribe_way_points_request.h" +#include "hmi/navi_unsubscribe_way_points_response.h" +#include "hmi/navi_update_turn_list_request.h" +#include "hmi/navi_update_turn_list_response.h" #include "hmi/on_allow_sdl_functionality_notification.h" +#include "hmi/on_app_activated_notification.h" +#include "hmi/on_app_deactivated_notification.h" #include "hmi/on_app_permission_changed_notification.h" #include "hmi/on_app_permission_consent_notification.h" -#include "hmi/on_app_activated_notification.h" +#include "hmi/on_app_registered_notification.h" +#include "hmi/on_app_unregistered_notification.h" #include "hmi/on_audio_data_streaming_notification.h" -#include "hmi/on_video_data_streaming_notification.h" -#include "hmi/on_sdl_consent_needed_notification.h" +#include "hmi/on_button_event_notification.h" +#include "hmi/on_button_press_notification.h" +#include "hmi/on_button_subscription_notification.h" +#include "hmi/on_device_chosen_notification.h" +#include "hmi/on_device_state_changed_notification.h" +#include "hmi/on_driver_distraction_notification.h" +#include "hmi/on_event_changed_notification.h" #include "hmi/on_exit_all_applications_notification.h" #include "hmi/on_exit_application_notification.h" +#include "hmi/on_file_removed_notification.h" +#include "hmi/on_find_applications.h" +#include "hmi/on_ignition_cycle_over_notification.h" +#include "hmi/on_navi_tbt_client_state_notification.h" +#include "hmi/on_navi_way_point_change_notification.h" +#include "hmi/on_policy_update.h" #include "hmi/on_put_file_notification.h" +#include "hmi/on_ready_notification.h" +#include "hmi/on_received_policy_update.h" +#include "hmi/on_record_start_notification.h" #include "hmi/on_resume_audio_source_notification.h" -#include "hmi/on_ignition_cycle_over_notification.h" +#include "hmi/on_sdl_close_notification.h" +#include "hmi/on_sdl_consent_needed_notification.h" +#include "hmi/on_sdl_persistence_complete_notification.h" +#include "hmi/on_start_device_discovery.h" +#include "hmi/on_status_update_notification.h" +#include "hmi/on_system_context_notification.h" +#include "hmi/on_system_error_notification.h" #include "hmi/on_system_info_changed_notification.h" -#include "hmi/get_system_info_request.h" -#include "hmi/get_system_info_response.h" -#include "hmi/close_popup_request.h" -#include "hmi/close_popup_response.h" -#include "hmi/button_get_capabilities_request.h" -#include "hmi/button_get_capabilities_response.h" +#include "hmi/on_system_request_notification.h" +#include "hmi/on_tts_language_change_notification.h" +#include "hmi/on_tts_reset_timeout_notification.h" +#include "hmi/on_tts_started_notification.h" +#include "hmi/on_tts_stopped_notification.h" +#include "hmi/on_ui_command_notification.h" +#include "hmi/on_ui_keyboard_input_notification.h" +#include "hmi/on_ui_language_change_notification.h" +#include "hmi/on_ui_reset_timeout_notification.h" +#include "hmi/on_ui_touch_event_notification.h" +#include "hmi/on_update_device_list.h" +#include "hmi/on_video_data_streaming_notification.h" +#include "hmi/on_vr_command_notification.h" +#include "hmi/on_vr_language_change_notification.h" +#include "hmi/on_vr_started_notification.h" +#include "hmi/on_vr_stopped_notification.h" +#include "hmi/sdl_activate_app_request.h" +#include "hmi/sdl_activate_app_response.h" +#include "hmi/sdl_get_list_of_permissions_request.h" +#include "hmi/sdl_get_list_of_permissions_response.h" +#include "hmi/sdl_get_status_update_request.h" +#include "hmi/sdl_get_status_update_response.h" +#include "hmi/sdl_get_user_friendly_message_request.h" +#include "hmi/sdl_get_user_friendly_message_response.h" +#include "hmi/sdl_policy_update.h" +#include "hmi/sdl_policy_update_response.h" +#include "hmi/tts_change_registration_request.h" +#include "hmi/tts_change_registration_response.h" +#include "hmi/tts_get_capabilities_request.h" +#include "hmi/tts_get_capabilities_response.h" +#include "hmi/tts_get_language_request.h" +#include "hmi/tts_get_language_response.h" +#include "hmi/tts_get_supported_languages_request.h" +#include "hmi/tts_get_supported_languages_response.h" +#include "hmi/tts_is_ready_request.h" +#include "hmi/tts_is_ready_response.h" +#include "hmi/tts_set_global_properties_request.h" +#include "hmi/tts_set_global_properties_response.h" +#include "hmi/tts_speak_request.h" +#include "hmi/tts_speak_response.h" +#include "hmi/tts_stop_speaking_request.h" +#include "hmi/tts_stop_speaking_response.h" #include "hmi/ui_add_command_request.h" #include "hmi/ui_add_command_response.h" -#include "hmi/ui_delete_command_request.h" -#include "hmi/ui_delete_command_response.h" #include "hmi/ui_add_submenu_request.h" #include "hmi/ui_add_submenu_response.h" +#include "hmi/ui_alert_request.h" +#include "hmi/ui_alert_response.h" +#include "hmi/ui_change_registration_request.h" +#include "hmi/ui_change_registration_response.h" +#include "hmi/ui_delete_command_request.h" +#include "hmi/ui_delete_command_response.h" #include "hmi/ui_delete_submenu_request.h" #include "hmi/ui_delete_submenu_response.h" -#include "hmi/ui_get_supported_languages_request.h" -#include "hmi/ui_get_supported_languages_response.h" -#include "hmi/ui_get_language_request.h" -#include "hmi/ui_get_language_response.h" +#include "hmi/ui_end_audio_pass_thru_request.h" +#include "hmi/ui_end_audio_pass_thru_response.h" #include "hmi/ui_get_capabilities_request.h" #include "hmi/ui_get_capabilities_response.h" -#include "hmi/ui_change_registration_request.h" -#include "hmi/ui_change_registration_response.h" -#include "hmi/ui_show_request.h" -#include "hmi/ui_show_response.h" -#include "hmi/ui_alert_request.h" -#include "hmi/ui_alert_response.h" +#include "hmi/ui_get_language_request.h" +#include "hmi/ui_get_language_response.h" +#include "hmi/ui_get_supported_languages_request.h" +#include "hmi/ui_get_supported_languages_response.h" #include "hmi/ui_is_ready_request.h" #include "hmi/ui_is_ready_response.h" -#include "hmi/ui_slider_request.h" -#include "hmi/ui_slider_response.h" -#include "hmi/ui_set_media_clock_timer_request.h" -#include "hmi/ui_set_media_clock_timer_response.h" -#include "hmi/ui_set_global_properties_request.h" -#include "hmi/ui_set_global_properties_response.h" +#include "hmi/ui_perform_audio_pass_thru_request.h" +#include "hmi/ui_perform_audio_pass_thru_response.h" +#include "hmi/ui_perform_interaction_request.h" +#include "hmi/ui_perform_interaction_response.h" #include "hmi/ui_scrollable_message_request.h" #include "hmi/ui_scrollable_message_response.h" #include "hmi/ui_set_app_icon_request.h" #include "hmi/ui_set_app_icon_response.h" -#include "hmi/ui_perform_audio_pass_thru_response.h" -#include "hmi/ui_perform_audio_pass_thru_request.h" -#include "hmi/ui_end_audio_pass_thru_request.h" -#include "hmi/ui_end_audio_pass_thru_response.h" -#include "hmi/ui_perform_interaction_request.h" -#include "hmi/ui_perform_interaction_response.h" -#include "hmi/vr_is_ready_request.h" -#include "hmi/vr_is_ready_response.h" +#include "hmi/ui_set_display_layout_request.h" +#include "hmi/ui_set_display_layout_response.h" +#include "hmi/ui_set_global_properties_request.h" +#include "hmi/ui_set_global_properties_response.h" +#include "hmi/ui_set_media_clock_timer_request.h" +#include "hmi/ui_set_media_clock_timer_response.h" +#include "hmi/ui_show_request.h" +#include "hmi/ui_show_response.h" +#include "hmi/ui_slider_request.h" +#include "hmi/ui_slider_response.h" +#include "hmi/update_app_list_request.h" +#include "hmi/update_app_list_response.h" +#include "hmi/update_device_list_request.h" +#include "hmi/update_device_list_response.h" +#include "hmi/update_sdl_request.h" +#include "hmi/update_sdl_response.h" #include "hmi/vr_add_command_request.h" #include "hmi/vr_add_command_response.h" -#include "hmi/vr_delete_command_request.h" -#include "hmi/vr_delete_command_response.h" #include "hmi/vr_change_registration_request.h" #include "hmi/vr_change_registration_response.h" -#include "hmi/vr_get_supported_languages_request.h" -#include "hmi/vr_get_supported_languages_response.h" -#include "hmi/vr_get_language_request.h" -#include "hmi/vr_get_language_response.h" +#include "hmi/vr_delete_command_request.h" +#include "hmi/vr_delete_command_response.h" #include "hmi/vr_get_capabilities_request.h" #include "hmi/vr_get_capabilities_response.h" -#include "hmi/tts_is_ready_request.h" -#include "hmi/tts_is_ready_response.h" -#include "hmi/tts_change_registration_request.h" -#include "hmi/tts_change_registration_response.h" -#include "hmi/tts_get_supported_languages_request.h" -#include "hmi/tts_get_supported_languages_response.h" -#include "hmi/tts_get_language_request.h" -#include "hmi/tts_get_language_response.h" -#include "hmi/tts_stop_speaking_request.h" -#include "hmi/tts_stop_speaking_response.h" -#include "hmi/tts_speak_request.h" -#include "hmi/tts_speak_response.h" -#include "hmi/tts_set_global_properties_request.h" -#include "hmi/tts_set_global_properties_response.h" -#include "hmi/tts_get_capabilities_request.h" -#include "hmi/tts_get_capabilities_response.h" +#include "hmi/vr_get_language_request.h" +#include "hmi/vr_get_language_response.h" +#include "hmi/vr_get_supported_languages_request.h" +#include "hmi/vr_get_supported_languages_response.h" +#include "hmi/vr_is_ready_request.h" +#include "hmi/vr_is_ready_response.h" #include "hmi/vr_perform_interaction_request.h" #include "hmi/vr_perform_interaction_response.h" -#include "hmi/sdl_activate_app_request.h" -#include "hmi/sdl_activate_app_response.h" -#include "hmi/on_app_permission_changed_notification.h" -#include "hmi/on_event_changed_notification.h" -#include "hmi/navi_is_ready_request.h" -#include "hmi/navi_show_constant_tbt_request.h" -#include "hmi/navi_show_constant_tbt_response.h" -#include "hmi/navi_is_ready_response.h" -#include "hmi/navi_alert_maneuver_request.h" -#include "hmi/navi_alert_maneuver_response.h" -#include "hmi/navi_update_turn_list_request.h" -#include "hmi/navi_update_turn_list_response.h" -#include "hmi/navi_subscribe_way_points_request.h" -#include "hmi/navi_subscribe_way_points_response.h" -#include "hmi/navi_unsubscribe_way_points_request.h" -#include "hmi/navi_unsubscribe_way_points_response.h" -#include "hmi/navi_get_way_points_request.h" -#include "hmi/navi_get_way_points_response.h" -#include "hmi/on_ready_notification.h" -#include "hmi/on_device_chosen_notification.h" -#include "hmi/on_file_removed_notification.h" -#include "hmi/on_system_context_notification.h" -#include "hmi/on_app_registered_notification.h" -#include "hmi/on_app_unregistered_notification.h" -#include "hmi/on_driver_distraction_notification.h" -#include "hmi/on_tts_started_notification.h" -#include "hmi/on_tts_stopped_notification.h" -#include "hmi/on_vr_started_notification.h" -#include "hmi/on_vr_stopped_notification.h" -#include "hmi/on_vr_command_notification.h" -#include "hmi/on_ui_command_notification.h" -#include "hmi/on_app_deactivated_notification.h" -#include "hmi/on_ui_language_change_notification.h" -#include "hmi/on_vr_language_change_notification.h" -#include "hmi/on_tts_language_change_notification.h" -#include "hmi/on_navi_tbt_client_state_notification.h" -#include "hmi/on_navi_way_point_change_notification.h" -#include "hmi/on_button_event_notification.h" -#include "hmi/on_button_press_notification.h" -#include "hmi/on_button_subscription_notification.h" -#include "hmi/on_ui_keyboard_input_notification.h" -#include "hmi/on_ui_touch_event_notification.h" -#include "hmi/on_ui_reset_timeout_notification.h" -#include "hmi/navi_start_stream_request.h" -#include "hmi/navi_start_stream_response.h" -#include "hmi/navi_stop_stream_request.h" -#include "hmi/navi_stop_stream_response.h" -#include "hmi/on_system_request_notification.h" -#include "hmi/ui_set_display_layout_request.h" -#include "hmi/ui_set_display_layout_response.h" -#include "hmi/on_sdl_close_notification.h" -#include "hmi/on_sdl_persistence_complete_notification.h" -#include "hmi/on_record_start_notification.h" -#include "hmi/add_statistics_info_notification.h" -#include "hmi/on_system_error_notification.h" -#include "hmi/basic_communication_system_request.h" -#include "hmi/basic_communication_system_response.h" -#include "hmi/sdl_policy_update.h" -#include "hmi/sdl_policy_update_response.h" -#include "hmi/on_received_policy_update.h" -#include "hmi/on_policy_update.h" -#include "hmi/get_urls.h" -#include "hmi/get_urls_response.h" -#include "hmi/on_device_state_changed_notification.h" -#include "hmi/navi_send_location_request.h" -#include "hmi/navi_send_location_response.h" -#include "hmi/on_tts_reset_timeout_notification.h" -#include "hmi/dial_number_request.h" -#include "hmi/dial_number_response.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -240,16 +241,16 @@ namespace dummy_hmi_commands_test { namespace commands = sdl_rpc_plugin::commands; -using ::testing::_; -using ::testing::NotNull; -using ::testing::Types; +using ::application_manager::ApplicationSharedPtr; using application_manager::commands::MessageSharedPtr; -using ::test::components::event_engine_test::MockEventDispatcher; +using ::test::components::application_manager_test::MockApplication; using ::test::components::application_manager_test::MockApplicationManager; using ::test::components::application_manager_test:: MockApplicationManagerSettings; -using ::application_manager::ApplicationSharedPtr; -using ::test::components::application_manager_test::MockApplication; +using ::test::components::event_engine_test::MockEventDispatcher; +using ::testing::_; +using ::testing::NotNull; +using ::testing::Types; template <class Command> class HMICommandsTest : public components::commands_test::CommandRequestTest< @@ -357,7 +358,8 @@ typedef Types<commands::OnStartDeviceDiscovery, commands::UIGetLanguageRequest, commands::UIGetCapabilitiesResponse, commands::UIGetCapabilitiesRequest, - commands::UIChangeRegistratioResponse> HMICommandsListFirst; + commands::UIChangeRegistratioResponse> + HMICommandsListFirst; typedef Types<commands::UIChangeRegistrationRequest, commands::UIPerformAudioPassThruResponse, @@ -407,7 +409,8 @@ typedef Types<commands::UIChangeRegistrationRequest, commands::ClosePopupResponse, commands::ClosePopupRequest, commands::UIIsReadyResponse, - commands::UIIsReadyRequest> HMICommandsListSecond; + commands::UIIsReadyRequest> + HMICommandsListSecond; typedef Types<commands::NaviIsReadyResponse, commands::NaviIsReadyRequest, @@ -445,7 +448,8 @@ typedef Types<commands::NaviIsReadyResponse, commands::OnVRStoppedNotification, commands::OnVRCommandNotification, commands::OnUICommandNotification, - commands::OnAppDeactivatedNotification> HMICommandsListThird; + commands::OnAppDeactivatedNotification> + HMICommandsListThird; typedef Types<commands::hmi::OnButtonEventNotification, commands::hmi::OnButtonPressNotification, @@ -491,12 +495,16 @@ typedef Types<commands::hmi::OnButtonEventNotification, commands::OnNaviWayPointChangeNotification, commands::OnUILanguageChangeNotification, commands::OnVRLanguageChangeNotification, - commands::OnTTSLanguageChangeNotification> HMICommandsListFourth; + commands::OnTTSLanguageChangeNotification> + HMICommandsListFourth; typedef Types<commands::AllowAllAppsRequest, commands::AllowAllAppsResponse, commands::AllowAppRequest, - commands::AllowAppResponse> HMICommandsListFifth; + commands::AllowAppResponse, + commands::BCGetFilePathRequest, + commands::BCGetFilePathResponse> + HMICommandsListFifth; TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst); TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond); @@ -507,30 +515,30 @@ TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth); TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } } // namespace dummy_hmi_commands_test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc index 4cbe7305ea..5b860499dd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc @@ -35,13 +35,13 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/commands/request_to_hmi.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/smart_object_keys.h" #include "hmi/get_system_info_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -51,9 +51,9 @@ namespace get_system_info_request { namespace am = ::application_manager; namespace strings = ::application_manager::strings; +using am::commands::CommandImpl; using am::commands::RequestToHMI; using sdl_rpc_plugin::commands::GetSystemInfoRequest; -using am::commands::CommandImpl; typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc index 6908e21053..11589683be 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc @@ -33,32 +33,32 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/response_from_hmi.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/commands/response_from_hmi.h" -#include "hmi/get_system_info_response.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "hmi/get_system_info_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { namespace commands_test { namespace hmi_commands_test { namespace get_system_info_response { -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; +using am::commands::CommandImpl; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::GetSystemInfoResponse; using sdl_rpc_plugin::commands::SystemInfo; -using am::commands::CommandImpl; typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; typedef NiceMock< diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc index 339a749909..f030701710 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc @@ -33,15 +33,15 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/application.h" #include "application_manager/commands/command.h" #include "application_manager/commands/commands_test.h" -#include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/commands/response_to_hmi.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/get_urls_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,9 +53,9 @@ using ::testing::_; using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; -using sdl_rpc_plugin::commands::GetUrlsResponse; -using am::commands::ResponseToHMI; using am::commands::CommandImpl; +using am::commands::ResponseToHMI; +using sdl_rpc_plugin::commands::GetUrlsResponse; typedef std::shared_ptr<ResponseToHMI> ResponseToHMIPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc index 2191900750..b19207cc14 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc @@ -33,21 +33,21 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "application_manager/message.h" +#include "application_manager/commands/command.h" +#include "application_manager/commands/command_request_test.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/commands/request_from_hmi.h" +#include "application_manager/event_engine/event_dispatcher.h" +#include "application_manager/message.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "smart_objects/smart_object.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/policies/policy_handler.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/commands/command.h" +#include "gtest/gtest.h" #include "hmi/get_urls.h" -#include "application_manager/policies/policy_handler.h" -#include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/commands/command_request_test.h" -#include "application_manager/commands/request_from_hmi.h" #include "policy/mock_policy_manager.h" -#include "application_manager/event_engine/event_dispatcher.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -57,17 +57,17 @@ namespace get_urls { using namespace hmi_apis; using namespace policy; -using ::testing::NiceMock; +using ::test::components::application_manager_test::MockApplication; using ::testing::_; +using ::testing::NiceMock; using ::testing::SetArgReferee; -using ::test::components::application_manager_test::MockApplication; namespace am = ::application_manager; namespace strings = ::application_manager::strings; -using am::commands::RequestFromHMI; -using sdl_rpc_plugin::commands::GetUrls; using am::commands::CommandImpl; +using am::commands::RequestFromHMI; using policy::PolicyHandler; using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::GetUrls; typedef std::shared_ptr<RequestFromHMI> RequestFromHMIPtr; @@ -110,7 +110,7 @@ TEST_F(GetUrlsTest, RUN_SUCCESS) { TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) { EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _)) .WillOnce(Return(true)); request_command_->Run(); @@ -127,7 +127,7 @@ TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) { .WillOnce(SetArgReferee<1>(endpoints_)); EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _)) .WillOnce(Return(true)); request_command_->Run(); @@ -160,7 +160,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) { EXPECT_CALL(app_mngr_, application(kAppIdForSending)) .WillOnce(Return(mock_app)); EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppIdForSending)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _)) .WillOnce(Return(true)); request_command_->Run(); @@ -175,10 +175,12 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) { EXPECT_EQ(kAppIdForSending, (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] - [strings::app_id].asInt()); + [strings::app_id] + .asInt()); EXPECT_EQ(kDefaultUrl, (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] - [strings::url].asString()); + [strings::url] + .asString()); } TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) { @@ -197,7 +199,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) { EXPECT_CALL(mock_policy_handler_, GetAppIdForSending()) .WillOnce(Return(kInvalidAppId_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _)) .WillOnce(Return(true)); EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0); @@ -226,7 +228,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) { EXPECT_CALL(app_mngr_, application(kAppIdForSending)) .WillOnce(Return(invalid_mock_app)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _)) .WillOnce(Return(true)); request_command_->Run(); @@ -261,7 +263,7 @@ TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) { EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(command_msg_, _)) .WillOnce(Return(true)); request_command_->Run(); @@ -297,10 +299,12 @@ TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) { am::hmi_request::service)); EXPECT_EQ(kDefaultUrl, (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] - [am::strings::url].asString()); + [am::strings::url] + .asString()); EXPECT_EQ(endpoints_[0].app_id, (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] - [am::hmi_response::policy_app_id].asString()); + [am::hmi_response::policy_app_id] + .asString()); } TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc index fe82b16f3f..8f2feed877 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc @@ -33,81 +33,81 @@ #include <stdint.h> #include <string> #include <vector> -#include "gtest/gtest.h" #include "application_manager/commands/commands_test.h" -#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" +#include "gtest/gtest.h" +#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_app_permission_changed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_app_registered_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_audio_data_streaming_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_button_subscription_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_file_removed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h" #include "sdl_rpc_plugin/commands/hmi/on_put_file_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" +#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h" #include "sdl_rpc_plugin/commands/hmi/on_status_update_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_activated_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_deactivated_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_unregistered_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_button_press_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_event_changed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_app_permission_consent_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ignition_cycle_over_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_policy_update.h" -#include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_error_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_allow_sdl_functionality_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_device_state_changed_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_exit_all_applications_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_exit_application_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_vr_command_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_vr_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_start_device_discovery.h" -#include "sdl_rpc_plugin/commands/hmi/on_device_chosen_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_driver_distraction_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_vr_started_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_vr_stopped_notification.h" -#include "utils/lock.h" #include "utils/data_accessor.h" +#include "utils/lock.h" #include "utils/signals.h" -#include "utils/file_system.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_rpc_plugin_manager.h" -#include "application_manager/mock_state_controller.h" +#include "application_manager/hmi_capabilities_impl.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" -#include "application_manager/hmi_capabilities_impl.h" #include "application_manager/mock_hmi_capabilities.h" -#include "transport_manager/mock_transport_manager.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/mock_resume_ctrl.h" +#include "application_manager/mock_rpc_plugin_manager.h" +#include "application_manager/mock_state_controller.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" #include "connection_handler/mock_connection_handler.h" #include "connection_handler/mock_connection_handler_settings.h" -#include "test/application_manager/mock_application_manager_settings.h" -#include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_message_helper.h" #include "protocol_handler/mock_session_observer.h" -#include "application_manager/mock_resume_ctrl.h" +#include "smart_objects/smart_object.h" +#include "test/application_manager/mock_application_manager_settings.h" +#include "transport_manager/mock_transport_manager.h" +#include "utils/file_system.h" namespace am = application_manager; @@ -117,22 +117,22 @@ namespace commands_test { namespace hmi_commands_test { namespace hmi_notifications_test { -using ::testing::_; -using ::testing::Test; -using ::testing::Types; -using ::testing::Return; -using ::testing::ReturnRef; -using ::testing::NiceMock; -using ::testing::InSequence; -using ::smart_objects::SmartObject; +using ::application_manager::ApplicationSharedPtr; +using ::application_manager::MockMessageHelper; using ::application_manager::commands::MessageSharedPtr; +using ::smart_objects::SmartObject; +using ::test::components::application_manager_test::MockApplication; using ::test::components::application_manager_test::MockApplicationManager; using ::test::components::application_manager_test:: MockApplicationManagerSettings; -using ::application_manager::ApplicationSharedPtr; -using ::test::components::application_manager_test::MockApplication; using ::test::components::event_engine_test::MockEventDispatcher; -using ::application_manager::MockMessageHelper; +using ::testing::_; +using ::testing::InSequence; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::Test; +using ::testing::Types; using namespace sdl_rpc_plugin::commands; using namespace am::commands; @@ -319,7 +319,8 @@ typedef Types<OnAppPermissionChangedNotification, OnSDLPersistenceCompleteNotification, OnStatusUpdateNotification, OnVideoDataStreamingNotification, - OnRecordStartdNotification> HMIOnNotificationsListToHMITypes; + OnRecordStartdNotification> + HMIOnNotificationsListToHMITypes; typedef Types< CommandPair<OnAppActivatedNotification, @@ -945,7 +946,7 @@ TEST_F(HMICommandsNotificationsTest, EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationId_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(GetMessage(temp_message)); command->Run(); @@ -973,7 +974,7 @@ TEST_F(HMICommandsNotificationsTest, EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0); EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0); EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); command->Run(); } @@ -1023,7 +1024,8 @@ TEST_F(HMICommandsNotificationsTest, EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_)); EXPECT_CALL(mock_message_helper_, GetOnAppInterfaceUnregisteredNotificationToMobile( - kAppId_, *it_mobile_reason)).WillOnce(Return(notification)); + kAppId_, *it_mobile_reason)) + .WillOnce(Return(notification)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(notification, Command::SOURCE_SDL)); EXPECT_CALL(app_mngr_, @@ -1377,10 +1379,11 @@ TEST_F(HMICommandsNotificationsTest, [am::strings::id] = "2014"; std::shared_ptr<Command> command = CreateCommand<OnDeviceChosenNotification>(message); - EXPECT_CALL(app_mngr_, - ConnectToDevice( - (*message)[am::strings::msg_params][am::strings::device_info] - [am::strings::id].asString())); + EXPECT_CALL( + app_mngr_, + ConnectToDevice((*message)[am::strings::msg_params] + [am::strings::device_info][am::strings::id] + .asString())); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc index 8164f957cb..64bf167f83 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc @@ -33,13 +33,13 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/commands/request_to_hmi.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/mixing_audio_supported_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -51,9 +51,9 @@ using ::testing::_; using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; +using am::commands::CommandImpl; using am::commands::RequestToHMI; using sdl_rpc_plugin::commands::MixingAudioSupportedRequest; -using am::commands::CommandImpl; typedef std::shared_ptr<RequestToHMI> RequestToHMIPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc index aa651c2dca..8c2f07a1d6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc @@ -33,18 +33,18 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/commands/response_from_hmi.h" -#include "interfaces/HMI_API.h" -#include "interfaces/MOBILE_API.h" #include "application_manager/mock_application.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "sdl_rpc_plugin/commands/hmi/mixing_audio_supported_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -52,15 +52,15 @@ namespace commands_test { namespace hmi_commands_test { namespace mixing_audio_supported_response { +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; -using sdl_rpc_plugin::commands::MixingAudioSupportedResponse; -using application_manager::commands::ResponseFromHMI; -using am::commands::CommandImpl; using am::HMICapabilities; +using am::commands::CommandImpl; +using application_manager::commands::ResponseFromHMI; +using sdl_rpc_plugin::commands::MixingAudioSupportedResponse; namespace hmi_response = ::application_manager::hmi_response; typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc index d8454bb98e..926e51446f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc @@ -36,13 +36,13 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_interface.h" -#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -54,9 +54,9 @@ using ::testing::_; using ::testing::ReturnRef; namespace am = ::application_manager; namespace commands = am::commands; +using am::event_engine::Event; using commands::MessageSharedPtr; using sdl_rpc_plugin::commands::AudioStartStreamRequest; -using am::event_engine::Event; namespace { const uint32_t kHmiAppId = 13u; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc index 1a03ecf523..5e13755a32 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc @@ -34,15 +34,15 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/hmi_interfaces.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/commands/commands_test.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -54,8 +54,8 @@ using ::testing::_; using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::NaviIsReadyRequest; using am::event_engine::Event; +using sdl_rpc_plugin::commands::NaviIsReadyRequest; namespace { const hmi_apis::FunctionID::eType kEventID = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc index 23f01fac3f..e166928348 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc @@ -33,12 +33,12 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "gtest/gtest.h" #include "hmi/navi_is_ready_response.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc index 3110a11fd8..d6ef540bc0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc @@ -36,14 +36,14 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/hmi_interfaces.h" -#include "application_manager/mock_hmi_interface.h" #include "application_manager/event_engine/event.h" +#include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -55,8 +55,8 @@ using ::testing::_; using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::NaviSetVideoConfigRequest; using am::event_engine::Event; +using sdl_rpc_plugin::commands::NaviSetVideoConfigRequest; namespace { const uint32_t kAppId = 1u; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc index 06fa61db29..c4e7976bde 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "hmi/navi_set_video_config_response.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -47,8 +47,8 @@ namespace navi_set_video_config_response { using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; -using testing::ReturnRef; using ::testing::NiceMock; +using testing::ReturnRef; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc index a7f50504fb..232d5ab628 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc @@ -36,12 +36,12 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,9 +53,9 @@ using ::testing::_; using ::testing::ReturnRef; namespace am = ::application_manager; namespace commands = am::commands; +using am::event_engine::Event; using commands::MessageSharedPtr; using sdl_rpc_plugin::commands::NaviStartStreamRequest; -using am::event_engine::Event; namespace { const uint32_t kHmiAppId = 13u; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc index e4a79997fd..b32189ce1a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc @@ -30,17 +30,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "hmi/navi_stop_stream_request.h" #include "hmi/navi_audio_stop_stream_request.h" +#include "hmi/navi_stop_stream_request.h" #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -76,7 +76,8 @@ class NaviStopStreamRequestsTest }; typedef testing::Types<commands::AudioStopStreamRequest, - commands::NaviStopStreamRequest> RequestCommandsList; + commands::NaviStopStreamRequest> + RequestCommandsList; TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList); TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc index fc3899e861..802ad01d0b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc @@ -33,17 +33,17 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "utils/lock.h" -#include "utils/data_accessor.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/on_driver_distraction_notification.h" #include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" +#include "utils/data_accessor.h" +#include "utils/lock.h" namespace test { namespace components { @@ -52,8 +52,8 @@ namespace hmi_commands_test { namespace on_driver_distraction_notification { using ::testing::_; -using ::testing::Return; using ::testing::Eq; +using ::testing::Return; namespace am = ::application_manager; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification; @@ -152,7 +152,7 @@ TEST_F(HMIOnDriverDistractionNotificationTest, command->Run(); } -} // on_driver_distraction_notification +} // namespace on_driver_distraction_notification } // namespace hmi_commands_test } // namespace commands_test } // namespace components diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc index 2d50ec2b72..f9dbbf259f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc @@ -30,12 +30,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "hmi/on_system_time_ready_notification.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" #include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "interfaces/HMI_API.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc index 8e62c1a409..67c36dce9c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc @@ -34,13 +34,13 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_impl.h" #include "hmi/rc_get_capabilities_response.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -52,8 +52,8 @@ using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; namespace hmi_response = am::hmi_response; -using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse; using am::commands::CommandImpl; +using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse; typedef std::shared_ptr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr; typedef NiceMock< @@ -139,6 +139,7 @@ TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) { radio_control_capability["hdChannelAvailable"] = true; radio_control_capability["rdsDataAvailable"] = true; radio_control_capability["availableHDsAvailable"] = true; + radio_control_capability["availableHdChannelsAvailable"] = true; radio_control_capability["stateAvailable"] = true; radio_control_capability["signalStrengthAvailable"] = true; radio_control_capability["signalChangeThresholdAvailable"] = true; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc index 030db2f424..539c0efeb3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc @@ -34,15 +34,15 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/event_engine/event.h" #include "application_manager/hmi_interfaces.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -54,8 +54,8 @@ using ::testing::_; using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::RCIsReadyRequest; using am::event_engine::Event; +using sdl_rpc_plugin::commands::RCIsReadyRequest; typedef std::shared_ptr<RCIsReadyRequest> RCIsReadyRequestPtr; @@ -99,7 +99,7 @@ class RCIsReadyRequestTest EXPECT_CALL(mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _)) .WillOnce(Return(capabilities)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities, _)); } void PrepareEvent(bool is_message_contain_param, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc index a1a8c1c87e..4224e82b5f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc @@ -35,11 +35,11 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_hmi_capabilities.h" #include "hmi/rc_is_ready_response.h" -#include "application_manager/mock_event_dispatcher.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc index 0b1f2df491..3e7e6e6f59 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc @@ -32,24 +32,24 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" +#include "application_manager/commands/command.h" +#include "application_manager/commands/response_from_hmi.h" #include "application_manager/smart_object_keys.h" #include "application_manager/test/include/application_manager/commands/commands_test.h" -#include "application_manager/commands/command.h" #include "application_manager/test/include/application_manager/mock_event_dispatcher.h" -#include "application_manager/commands/response_from_hmi.h" +#include "gtest/gtest.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { namespace commands_test { namespace hmi_commands_test { namespace response_from_hmi { +using ::test::components::event_engine_test::MockEventDispatcher; using ::testing::_; +using ::testing::DoAll; using ::testing::Return; using ::testing::SaveArg; -using ::testing::DoAll; -using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; using application_manager::commands::ResponseFromHMI; @@ -86,7 +86,7 @@ TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) { ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>()); MessageSharedPtr result_msg; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true))); const hmi_apis::FunctionID::eType posted_function_id = @@ -115,7 +115,7 @@ TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) { MessageSharedPtr result_msg; ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false))); const hmi_apis::FunctionID::eType posted_function_id = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc index 38cbc7b069..93344f1a0d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc @@ -32,18 +32,19 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "utils/lock.h" -#include "utils/helpers.h" -#include "hmi/sdl_activate_app_request.h" -#include "application_manager/mock_application.h" #include "application_manager/application_manager.h" -#include "application_manager/policies/mock_policy_handler_interface.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/mock_state_controller.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "connection_handler/mock_connection_handler.h" +#include "gtest/gtest.h" +#include "hmi/sdl_activate_app_request.h" +#include "utils/helpers.h" +#include "utils/lock.h" namespace test { namespace components { @@ -54,16 +55,17 @@ namespace sdl_activate_app_request { namespace am = ::application_manager; namespace strings = am::strings; namespace hmi_response = am::hmi_response; +using am::ApplicationSet; using am::commands::MessageSharedPtr; +using am::event_engine::Event; +using connection_handler_test::MockConnectionHandler; +using policy_test::MockPolicyHandlerInterface; using sdl_rpc_plugin::commands::SDLActivateAppRequest; -using am::ApplicationSet; +using testing::Gt; using testing::Mock; +using ::testing::NiceMock; using testing::Return; using testing::ReturnRef; -using testing::Mock; -using ::testing::NiceMock; -using policy_test::MockPolicyHandlerInterface; -using am::event_engine::Event; namespace { const uint32_t kCorrelationID = 1u; @@ -137,6 +139,8 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) { std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); + EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID)) + .WillOnce(Return(ApplicationSharedPtr())); EXPECT_CALL(app_mngr_, state_controller()) .WillOnce(ReturnRef(mock_state_controller_)); EXPECT_CALL(mock_state_controller_, @@ -148,7 +152,7 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) { command->Run(); } -TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) { +TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DeactivateApp_REJECTED) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); (*msg)[strings::msg_params][strings::function_id] = @@ -163,9 +167,9 @@ TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) { IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp), _)) .WillOnce(Return(true)); command->Run(); @@ -189,6 +193,7 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) { .WillOnce(Return(false)); EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false)); + EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(false)); ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle)); MockAppPtr mock_app_first(CreateMockApp()); @@ -250,6 +255,7 @@ TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) { .WillOnce(Return(false)); EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false)); + EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(false)); ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle)); DataAccessor<ApplicationSet> accessor(app_list_, lock_); @@ -336,6 +342,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) { EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle)); EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false)); + EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(false)); EXPECT_CALL(app_mngr_, state_controller()) .WillOnce(ReturnRef(mock_state_controller_)); EXPECT_CALL(mock_state_controller_, @@ -427,6 +434,55 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) { } #endif +TEST_F(SDLActivateAppRequestTest, WaitingCloudApplication_ConnectDevice) { + MessageSharedPtr msg = CreateMessage(); + SetCorrelationAndAppID(msg); + + std::shared_ptr<SDLActivateAppRequest> command( + CreateCommand<SDLActivateAppRequest>(msg)); + + MockAppPtr mock_app(CreateMockApp()); + + EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle)); + EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false)); + EXPECT_CALL(*mock_app, is_cloud_app()).WillOnce(Return(true)); + +#ifndef EXTERNAL_PROPRIETARY_MODE + EXPECT_CALL(app_mngr_, application(kAppID)) + .WillOnce(Return(ApplicationSharedPtr())); +#endif + EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID)) + .WillOnce(Return(mock_app)); + + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(mock_state_controller_)); + EXPECT_CALL(mock_state_controller_, + IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) + .WillOnce(Return(false)); + + const uint16_t kRetries = 3; + const uint32_t kRetryTimeout = 2000; + const uint32_t kMinimumTimeout = kRetries * kRetryTimeout; + + MockApplicationManagerSettings settings; + EXPECT_CALL(settings, cloud_app_max_retry_attempts()) + .WillOnce(Return(kRetries)); + EXPECT_CALL(settings, cloud_app_retry_timeout()) + .WillOnce(Return(kRetryTimeout)); + EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings)); + + EXPECT_CALL(app_mngr_, + updateRequestTimeout(0, kCorrelationID, Gt(kMinimumTimeout))); + + MockConnectionHandler connection_handler; + EXPECT_CALL(connection_handler, ConnectToDevice(kHandle)); + + EXPECT_CALL(app_mngr_, connection_handler()) + .WillOnce(ReturnRef(connection_handler)); + + command->Run(); +} + TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); @@ -434,7 +490,7 @@ TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) { std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); ON_CALL(mock_event_dispatcher_, remove_observer(_, _)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); command->onTimeOut(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc index bca316bcfa..b35ccde314 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc @@ -33,12 +33,12 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/sdl_activate_app_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -48,8 +48,8 @@ namespace sdl_activate_app_response { namespace am = ::application_manager; namespace strings = ::application_manager::strings; -using sdl_rpc_plugin::commands::SDLActivateAppResponse; using am::commands::CommandImpl; +using sdl_rpc_plugin::commands::SDLActivateAppResponse; typedef std::shared_ptr<SDLActivateAppResponse> SDLActivateAppResponsePtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc index 262ac5fc7d..c8cc4bb18c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc @@ -32,11 +32,11 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "hmi/sdl_get_list_of_permissions_request.h" +#include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/commands/command_request_test.h" +#include "gtest/gtest.h" +#include "hmi/sdl_get_list_of_permissions_request.h" namespace test { namespace components { @@ -46,8 +46,8 @@ namespace sdl_get_list_of_permissions_request { using application_manager::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::SDLGetListOfPermissionsRequest; -using test::components::policy_test::MockPolicyHandlerInterface; using smart_objects::SmartObject; +using test::components::policy_test::MockPolicyHandlerInterface; using testing::Return; using testing::ReturnRef; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc index fca8ed840f..021dfc8b1d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc @@ -32,11 +32,11 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "hmi/sdl_get_status_update_request.h" +#include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/commands/command_request_test.h" +#include "gtest/gtest.h" +#include "hmi/sdl_get_status_update_request.h" namespace test { namespace components { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc index b040f8ea40..5cac1c823f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc @@ -34,15 +34,15 @@ #include <string> #include <vector> -#include "gtest/gtest.h" -#include "hmi/sdl_get_user_friendly_message_request.h" +#include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/mock_state_controller.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/mock_hmi_capabilities.h" +#include "gtest/gtest.h" +#include "hmi/sdl_get_user_friendly_message_request.h" #include "smart_objects/smart_object.h" -#include "application_manager/commands/command_request_test.h" namespace test { namespace components { @@ -50,11 +50,11 @@ namespace commands_test { namespace hmi_commands_test { namespace sdl_get_user_friendly_message_request { +using application_manager::MockMessageHelper; using application_manager::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::SDLGetUserFriendlyMessageRequest; -using application_manager::MockMessageHelper; -using test::components::policy_test::MockPolicyHandlerInterface; using test::components::application_manager_test::MockHMICapabilities; +using test::components::policy_test::MockPolicyHandlerInterface; using testing::_; using testing::Return; using testing::ReturnRef; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc index 581913d3a5..57bb018273 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc @@ -34,8 +34,8 @@ #include "application_manager/commands/commands_test.h" -#include "application_manager/commands/notification_to_hmi.h" #include "application_manager/commands/command_notification_impl.h" +#include "application_manager/commands/notification_to_hmi.h" namespace test { namespace components { @@ -45,8 +45,8 @@ namespace simple_notifications_test { using namespace application_manager; -using ::testing::Types; using commands::NotificationToHMI; +using ::testing::Types; template <typename Command> class SimpleNotificationsTest : public CommandsTest<CommandsTestMocks::kIsNice> { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc index 5c42d265c7..fc2cd1cca4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc @@ -30,14 +30,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/request_from_hmi.h" #include "application_manager/event_engine/event.h" #include "application_manager/mock_event_dispatcher.h" -#include "application_manager/commands/request_from_hmi.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -46,12 +46,12 @@ namespace hmi_commands_test { namespace simple_requests_from_hmi_test { using ::testing::_; -using ::testing::Types; -using ::testing::NotNull; using ::testing::NiceMock; +using ::testing::NotNull; +using ::testing::Types; namespace commands = ::application_manager::commands; -using commands::MessageSharedPtr; using ::application_manager::event_engine::EventObserver; +using commands::MessageSharedPtr; using ::test::components::event_engine_test::MockEventDispatcher; class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> { @@ -81,7 +81,7 @@ TEST_F(RequestFromHMITest, SendResponse_SUCCESS) { const bool success = false; const uint32_t correlation_id = 1u; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(NotNull())); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(NotNull(), _)); command->SendResponse(success, correlation_id, @@ -89,7 +89,7 @@ TEST_F(RequestFromHMITest, SendResponse_SUCCESS) { hmi_apis::Common_Result::SUCCESS); } -} // namespace simple_requests_to_hmi_test +} // namespace simple_requests_from_hmi_test } // namespace hmi_commands_test } // namespace commands_test } // namespace components diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc index 599c7e50f2..162e832e9f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc @@ -30,16 +30,18 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/commands/command.h" -#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/request_to_hmi.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h" +#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h" #include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h" #include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h" +#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h" +#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h" #include "sdl_rpc_plugin/commands/hmi/navi_alert_maneuver_request.h" #include "sdl_rpc_plugin/commands/hmi/navi_audio_stop_stream_request.h" #include "sdl_rpc_plugin/commands/hmi/navi_get_way_points_request.h" @@ -53,21 +55,15 @@ #include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h" #include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h" #include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h" -#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h" -#include "application_manager/commands/request_to_hmi.h" -#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h" +#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h" +#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h" +#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h" #include "sdl_rpc_plugin/commands/hmi/tts_is_ready_request.h" #include "sdl_rpc_plugin/commands/hmi/tts_set_global_properties_request.h" #include "sdl_rpc_plugin/commands/hmi/tts_speak_request.h" #include "sdl_rpc_plugin/commands/hmi/tts_stop_speaking_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_supported_languages_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_change_registration_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_capabilities_request.h" -#include "sdl_rpc_plugin/commands/hmi/tts_get_language_request.h" -#include "sdl_rpc_plugin/commands/hmi/close_popup_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_add_command_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_add_submenu_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_alert_request.h" @@ -81,6 +77,11 @@ #include "sdl_rpc_plugin/commands/hmi/ui_is_ready_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_perform_audio_pass_thru_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_perform_interaction_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_scrollable_message_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_app_icon_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_display_layout_request.h" +#include "sdl_rpc_plugin/commands/hmi/ui_set_global_properties_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_set_media_clock_timer_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_show_request.h" #include "sdl_rpc_plugin/commands/hmi/ui_slider_request.h" @@ -88,23 +89,11 @@ #include "sdl_rpc_plugin/commands/hmi/vr_change_registration_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_delete_command_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_get_capabilities_request.h" -#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_get_language_request.h" +#include "sdl_rpc_plugin/commands/hmi/vr_get_supported_languages_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_is_ready_request.h" #include "sdl_rpc_plugin/commands/hmi/vr_perform_interaction_request.h" -#include "sdl_rpc_plugin/commands/hmi/allow_all_apps_request.h" -#include "sdl_rpc_plugin/commands/hmi/basic_communication_system_request.h" -#include "sdl_rpc_plugin/commands/hmi/button_get_capabilities_request.h" -#include "sdl_rpc_plugin/commands/hmi/allow_app_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_send_location_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_unsubscribe_way_points_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_update_turn_list_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_show_constant_tbt_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_stop_stream_request.h" -#include "sdl_rpc_plugin/commands/hmi/navi_subscribe_way_points_request.h" -#include "sdl_rpc_plugin/commands/hmi/sdl_policy_update.h" -#include "sdl_rpc_plugin/commands/hmi/dial_number_request.h" -#include "sdl_rpc_plugin/commands/hmi/ui_send_haptic_data_request.h" +#include "smart_objects/smart_object.h" #include "application_manager/mock_event_dispatcher.h" @@ -115,8 +104,8 @@ namespace hmi_commands_test { namespace simple_requests_to_hmi_test { using ::testing::_; -using ::testing::Types; using ::testing::NotNull; +using ::testing::Types; namespace am_commands = application_manager::commands; using am_commands::MessageSharedPtr; using event_engine_test::MockEventDispatcher; @@ -221,7 +210,8 @@ typedef Types<sdl_rpc_plugin::commands::UIScrollableMessageRequest, typedef Types<sdl_rpc_plugin::commands::TTSIsReadyRequest, sdl_rpc_plugin::commands::UIIsReadyRequest, sdl_rpc_plugin::commands::NaviIsReadyRequest, - sdl_rpc_plugin::commands::VRIsReadyRequest> RequestCommandsList3; + sdl_rpc_plugin::commands::VRIsReadyRequest> + RequestCommandsList3; TYPED_TEST_CASE(RequestToHMICommandsTest, RequestCommandsList); TYPED_TEST_CASE(RequestToHMICommandsTest2, RequestCommandsList2); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc index 4a86fa9458..f232240c28 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc @@ -32,13 +32,18 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/notification_from_hmi.h" +#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/activate_app_response.h" #include "hmi/basic_communication_system_response.h" +#include "hmi/close_popup_response.h" +#include "hmi/dial_number_response.h" #include "hmi/navi_alert_maneuver_response.h" #include "hmi/navi_audio_start_stream_response.h" #include "hmi/navi_audio_stop_stream_response.h" @@ -50,20 +55,13 @@ #include "hmi/navi_subscribe_way_points_response.h" #include "hmi/navi_unsubscribe_way_points_response.h" #include "hmi/navi_update_turn_list_response.h" +#include "hmi/on_find_applications.h" +#include "hmi/on_update_device_list.h" +#include "hmi/sdl_policy_update_response.h" #include "hmi/tts_change_registration_response.h" -#include "hmi/ui_set_app_icon_response.h" -#include "hmi/ui_set_display_layout_response.h" -#include "hmi/ui_set_global_properties_response.h" -#include "hmi/ui_scrollable_message_response.h" -#include "application_manager/mock_event_dispatcher.h" -#include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/policies/mock_policy_handler_interface.h" -#include "hmi/dial_number_response.h" -#include "hmi/close_popup_response.h" #include "hmi/tts_set_global_properties_response.h" #include "hmi/tts_speak_response.h" #include "hmi/tts_stop_speaking_response.h" -#include "hmi/tts_change_registration_response.h" #include "hmi/ui_add_command_response.h" #include "hmi/ui_add_submenu_response.h" #include "hmi/ui_alert_response.h" @@ -73,28 +71,21 @@ #include "hmi/ui_end_audio_pass_thru_response.h" #include "hmi/ui_perform_audio_pass_thru_response.h" #include "hmi/ui_perform_interaction_response.h" +#include "hmi/ui_scrollable_message_response.h" +#include "hmi/ui_send_haptic_data_response.h" +#include "hmi/ui_set_app_icon_response.h" +#include "hmi/ui_set_display_layout_response.h" +#include "hmi/ui_set_global_properties_response.h" #include "hmi/ui_set_media_clock_timer_response.h" #include "hmi/ui_show_response.h" #include "hmi/ui_slider_response.h" +#include "hmi/update_app_list_response.h" +#include "hmi/update_device_list_response.h" #include "hmi/vr_add_command_response.h" #include "hmi/vr_change_registration_response.h" #include "hmi/vr_delete_command_response.h" #include "hmi/vr_perform_interaction_response.h" -#include "hmi/activate_app_response.h" -#include "hmi/basic_communication_system_response.h" -#include "hmi/navi_unsubscribe_way_points_response.h" -#include "hmi/navi_update_turn_list_response.h" -#include "hmi/navi_send_location_response.h" -#include "hmi/navi_show_constant_tbt_response.h" -#include "hmi/navi_start_stream_response.h" -#include "hmi/navi_subscribe_way_points_response.h" -#include "hmi/on_find_applications.h" -#include "hmi/on_update_device_list.h" -#include "hmi/sdl_policy_update_response.h" -#include "hmi/update_app_list_response.h" -#include "hmi/update_device_list_response.h" -#include "application_manager/commands/notification_from_hmi.h" -#include "hmi/ui_send_haptic_data_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -102,12 +93,12 @@ namespace commands_test { namespace hmi_commands_test { namespace simple_response_from_hmi_test { +using ::test::components::event_engine_test::MockEventDispatcher; using ::testing::_; +using ::testing::Eq; using ::testing::Return; using ::testing::ReturnRef; using ::testing::Types; -using ::testing::Eq; -using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; namespace commands = sdl_rpc_plugin::commands; @@ -218,7 +209,8 @@ typedef Types< CommandData<sdl_rpc_plugin::commands::UIScrollableMessageResponse, hmi_apis::FunctionID::UI_ScrollableMessage>, CommandData<sdl_rpc_plugin::commands::UISendHapticDataResponse, - hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList; + hmi_apis::FunctionID::UI_SendHapticData> > + ResponseCommandsList; typedef Types<sdl_rpc_plugin::commands::AudioStopStreamResponse, sdl_rpc_plugin::commands::NaviStopStreamResponse, @@ -310,7 +302,7 @@ TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) { EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(correlation_id)); EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(CheckMsgType(am::MessageType::kRequest))) + ManageHMICommand(CheckMsgType(am::MessageType::kRequest), _)) .WillOnce(Return(false)); command->CreateHMIRequest(hmi_apis::FunctionID::INVALID_ENUM, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc index 643e21d818..910c3f2873 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc @@ -30,16 +30,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/commands/response_to_hmi.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "sdl_rpc_plugin/commands/hmi/sdl_activate_app_response.h" #include "sdl_rpc_plugin/commands/hmi/sdl_get_list_of_permissions_response.h" #include "sdl_rpc_plugin/commands/hmi/sdl_get_status_update_response.h" #include "sdl_rpc_plugin/commands/hmi/sdl_get_user_friendly_message_response.h" -#include "application_manager/commands/response_to_hmi.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -48,8 +48,8 @@ namespace hmi_commands_test { namespace simple_response_to_hmi_test { using ::testing::_; -using ::testing::Types; using ::testing::NotNull; +using ::testing::Types; namespace commands = sdl_rpc_plugin::commands; using application_manager::commands::MessageSharedPtr; @@ -63,7 +63,8 @@ class ResponseToHMICommandsTest typedef Types<commands::SDLActivateAppResponse, commands::SDLGetListOfPermissionsResponse, commands::SDLGetStatusUpdateResponse, - commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList; + commands::SDLGetUserFriendlyMessageResponse> + ResponseCommandsList; TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc index bc9d262e6d..c7b96f1acf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc @@ -32,11 +32,11 @@ #include <string> +#include "application_manager/commands/commands_test.h" +#include "application_manager/mock_hmi_capabilities.h" #include "gtest/gtest.h" #include "hmi/tts_get_capabilities_response.h" -#include "application_manager/mock_hmi_capabilities.h" #include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" namespace test { namespace components { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc index 0d22500f48..c0d23cb34b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc @@ -30,13 +30,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/tts_get_language_response.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" -#include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_event_dispatcher.h" -#include "application_manager/commands/commands_test.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" namespace test { namespace components { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc index 417b8e1898..c0f187a85f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc @@ -33,17 +33,17 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/response_from_hmi.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/commands/response_from_hmi.h" -#include "hmi/tts_get_supported_languages_response.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "hmi/tts_get_supported_languages_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -52,14 +52,14 @@ namespace hmi_commands_test { namespace tts_get_supported_languages_response { using ::testing::_; -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; +using am::commands::CommandImpl; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::TTSGetSupportedLanguagesResponse; -using am::commands::CommandImpl; typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; typedef NiceMock< @@ -113,7 +113,8 @@ TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) { CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg)); EXPECT_CALL(mock_hmi_capabilities_, - set_tts_supported_languages(supported_languages)).Times(0); + set_tts_supported_languages(supported_languages)) + .Times(0); command->Run(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc index 2fae8a6819..a2f4440c86 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc @@ -33,18 +33,18 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/response_from_hmi.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/commands/response_from_hmi.h" -#include "hmi/tts_is_ready_response.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "hmi/tts_is_ready_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,14 +53,14 @@ namespace hmi_commands_test { namespace tts_is_ready_response { using ::testing::_; -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; +using am::commands::CommandImpl; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::TTSIsReadyResponse; -using am::commands::CommandImpl; using test::components::event_engine_test::MockEventDispatcher; typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc index 31e4860d4a..3fd3a39dca 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -32,14 +32,14 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_impl.h" +#include "gtest/gtest.h" #include "hmi/ui_get_capabilities_response.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -51,9 +51,9 @@ using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; namespace hmi_response = am::hmi_response; +using am::commands::CommandImpl; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::UIGetCapabilitiesResponse; -using am::commands::CommandImpl; typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; typedef NiceMock< @@ -113,8 +113,9 @@ TEST_F(UIGetCapabilitiesResponseTest, SetSoftButton_SUCCESS) { ResponseFromHMIPtr command( CreateCommand<UIGetCapabilitiesResponse>(command_msg)); - smart_objects::SmartObject soft_button_capabilities_so = (*command_msg) - [strings::msg_params][hmi_response::soft_button_capabilities]; + smart_objects::SmartObject soft_button_capabilities_so = + (*command_msg)[strings::msg_params] + [hmi_response::soft_button_capabilities]; EXPECT_CALL(mock_hmi_capabilities_, set_soft_button_capabilities(soft_button_capabilities_so)); @@ -149,8 +150,9 @@ TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) { ResponseFromHMIPtr command( CreateCommand<UIGetCapabilitiesResponse>(command_msg)); - smart_objects::SmartObject audio_pass_thru_capabilities_so = (*command_msg) - [strings::msg_params][strings::audio_pass_thru_capabilities]; + smart_objects::SmartObject audio_pass_thru_capabilities_so = + (*command_msg)[strings::msg_params] + [strings::audio_pass_thru_capabilities]; EXPECT_CALL( mock_hmi_capabilities_, set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc index de69c5de5c..7e8040543d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/ui_get_language_response.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" -#include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -47,8 +47,8 @@ namespace ui_get_language_response { using sdl_rpc_plugin::commands::UIGetLanguageResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; -using testing::ReturnRef; using ::testing::NiceMock; +using testing::ReturnRef; namespace strings = application_manager::strings; namespace hmi_response = application_manager::hmi_response; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc index 5626e2b0ee..10cf244bcf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc @@ -33,15 +33,15 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/application.h" #include "application_manager/commands/commands_test.h" -#include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_application_manager.h" -#include "hmi/ui_get_supported_languages_response.h" +#include "application_manager/mock_hmi_capabilities.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "hmi/ui_get_supported_languages_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -49,8 +49,8 @@ namespace commands_test { namespace hmi_commands_test { namespace ui_get_supported_languages_response { -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; @@ -107,7 +107,8 @@ TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) { CreateCommand<UIGetSupportedLanguagesResponse>(command_msg)); EXPECT_CALL(mock_hmi_capabilities_, - set_ui_supported_languages(supported_languages)).Times(0); + set_ui_supported_languages(supported_languages)) + .Times(0); command->Run(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc index fe0d8a8470..837b8438dc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc @@ -34,16 +34,16 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/event_engine/event.h" #include "application_manager/hmi_interfaces.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,12 +53,12 @@ namespace ui_is_ready_request { namespace am = ::application_manager; +using am::commands::MessageSharedPtr; +using am::event_engine::Event; +using sdl_rpc_plugin::commands::UIIsReadyRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::UIIsReadyRequest; -using am::event_engine::Event; typedef std::shared_ptr<UIIsReadyRequest> UIIsReadyRequestPtr; @@ -125,9 +125,9 @@ class UIIsReadyRequestTest .WillOnce(Return(get_capabilities)); EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*get_language)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_language)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_all_language)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_capabilities)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_language, _)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_all_language, _)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(get_capabilities, _)); } void PrepareEvent(bool is_message_contain_param, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc index cccdbdc44d..44b9504055 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc @@ -33,12 +33,12 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_hmi_capabilities.h" +#include "gtest/gtest.h" #include "hmi/ui_is_ready_response.h" -#include "application_manager/mock_event_dispatcher.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -46,8 +46,8 @@ namespace commands_test { namespace hmi_commands_test { namespace ui_is_ready_response { -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc index c566702998..31c03a7ed5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc @@ -32,20 +32,20 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "interfaces/HMI_API.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_impl.h" #include "application_manager/application_manager.h" #include "application_manager/application_manager_impl.h" -#include "application_manager/mock_event_dispatcher.h" -#include "application_manager/mock_application.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" -#include "application_manager/request_controller_settings.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_application_manager_settings.h" +#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/request_controller_settings.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/update_device_list_request.h" +#include "interfaces/HMI_API.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,18 +53,18 @@ namespace commands_test { namespace hmi_commands_test { namespace update_device_list_request { -using testing::_; -using testing::ReturnRef; -using testing::Return; -using test::components::event_engine_test::MockEventDispatcher; using ::test::components::application_manager_test:: MockApplicationManagerSettings; +using test::components::event_engine_test::MockEventDispatcher; +using testing::_; +using testing::Return; +using testing::ReturnRef; namespace am = ::application_manager; namespace strings = am::strings; namespace hmi_response = am::hmi_response; +using am::commands::CommandImpl; using am::event_engine::Event; using sdl_rpc_plugin::commands::UpdateDeviceListRequest; -using am::commands::CommandImpl; typedef std::shared_ptr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc index af3b9bebf6..96f3b38fbf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc @@ -33,13 +33,13 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/update_sdl_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -47,8 +47,8 @@ namespace commands_test { namespace hmi_commands_test { namespace update_sdl_request { -using ::testing::ReturnRef; using ::testing::NiceMock; +using ::testing::ReturnRef; namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::UpdateSDLRequest; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc index 93c49724ce..62ffc6be4d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc @@ -33,12 +33,12 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" #include "hmi/update_sdl_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -48,8 +48,8 @@ namespace update_sdl_response { namespace am = ::application_manager; namespace strings = ::application_manager::strings; -using sdl_rpc_plugin::commands::UpdateSDLResponse; using am::commands::CommandImpl; +using sdl_rpc_plugin::commands::UpdateSDLResponse; typedef std::shared_ptr<UpdateSDLResponse> UpdateSDLResponsePtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc index 15d38d4ef3..21acf2bb70 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc @@ -32,14 +32,14 @@ #include <stdint.h> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_impl.h" +#include "gtest/gtest.h" #include "hmi/vr_get_capabilities_response.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -51,8 +51,8 @@ using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; namespace hmi_response = am::hmi_response; -using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse; using am::commands::CommandImpl; +using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse; typedef std::shared_ptr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr; typedef NiceMock< diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc index 05ed186963..8b00b4dded 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "hmi/vr_get_language_response.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" -#include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -47,8 +47,8 @@ namespace vr_get_language_response { using sdl_rpc_plugin::commands::VRGetLanguageResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; -using testing::ReturnRef; using ::testing::NiceMock; +using testing::ReturnRef; namespace strings = application_manager::strings; namespace hmi_response = application_manager::hmi_response; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc index 56b11ad440..b81823624c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc @@ -33,15 +33,15 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/application.h" #include "application_manager/commands/commands_test.h" -#include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_application_manager.h" -#include "hmi/vr_get_supported_languages_response.h" +#include "application_manager/mock_hmi_capabilities.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "hmi/vr_get_supported_languages_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -49,8 +49,8 @@ namespace commands_test { namespace hmi_commands_test { namespace vr_get_supported_languages_response { -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; @@ -107,7 +107,8 @@ TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) { CreateCommand<VRGetSupportedLanguagesResponse>(command_msg)); EXPECT_CALL(mock_hmi_capabilities_, - set_vr_supported_languages(supported_languages)).Times(0); + set_vr_supported_languages(supported_languages)) + .Times(0); command->Run(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc index 5aa00e0264..9bb8e4c2d5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc @@ -34,15 +34,15 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/event_engine/event.h" #include "application_manager/hmi_interfaces.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -54,8 +54,8 @@ using ::testing::_; using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::VRIsReadyRequest; using am::event_engine::Event; +using sdl_rpc_plugin::commands::VRIsReadyRequest; typedef std::shared_ptr<VRIsReadyRequest> VRIsReadyRequestPtr; @@ -98,7 +98,7 @@ class VRIsReadyRequestTest CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _)) .WillOnce(Return(language)); EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language, _)); smart_objects::SmartObjectSPtr support_language( new smart_objects::SmartObject(smart_objects::SmartType_Map)); @@ -106,14 +106,14 @@ class VRIsReadyRequestTest mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _)) .WillOnce(Return(support_language)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language, _)); smart_objects::SmartObjectSPtr capabilities( new smart_objects::SmartObject(smart_objects::SmartType_Map)); EXPECT_CALL(mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _)) .WillOnce(Return(capabilities)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities, _)); } void PrepareEvent(bool is_message_contain_param, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc index 0e56f5b483..8b7b0a94f4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc @@ -33,12 +33,12 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_hmi_capabilities.h" +#include "gtest/gtest.h" #include "hmi/vr_is_ready_response.h" -#include "application_manager/mock_event_dispatcher.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -46,8 +46,8 @@ namespace commands_test { namespace hmi_commands_test { namespace vr_is_ready_response { -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc index 7c99b5f2b8..b11312eb33 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc @@ -32,8 +32,8 @@ #include <stdint.h> #include <memory> -#include <string> #include <set> +#include <string> #include "mobile/add_command_request.h" @@ -41,16 +41,16 @@ #include "utils/helpers.h" -#include "smart_objects/smart_object.h" -#include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_help_prompt_manager.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" namespace test { namespace components { @@ -60,17 +60,17 @@ namespace add_command_request { namespace am = application_manager; namespace am_test = application_manager_test; -using am::commands::CommandImpl; using am::ApplicationManager; -using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; -using ::testing::_; -using ::testing::Return; -using ::testing::InSequence; -using sdl_rpc_plugin::commands::AddCommandRequest; +using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; +using am::event_engine::EventObserver; using ns_smart_device_link::ns_smart_objects::SmartObjectSPtr; +using sdl_rpc_plugin::commands::AddCommandRequest; using ::test::components::application_manager_test::MockApplication; -using am::event_engine::EventObserver; +using ::testing::_; +using ::testing::InSequence; +using ::testing::Return; using namespace smart_objects; namespace custom_str = utils::custom_string; @@ -190,11 +190,11 @@ class AddCommandRequestTest EXPECT_CALL(mock_rpc_service_, ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(mock_rpc_service_, ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); @@ -207,7 +207,7 @@ class AddCommandRequestTest EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(cmd_to_delete))) + ManageHMICommand(HMIResultCodeIs(cmd_to_delete), _)) .WillOnce(Return(true)); SmartObjectSPtr response = std::make_shared<SmartObject>(SmartType_Map); @@ -276,7 +276,7 @@ TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_WARNINGS) { commands_map, lock_ptr_))); EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -492,13 +492,13 @@ TEST_F(AddCommandRequestTest, { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); @@ -522,7 +522,7 @@ TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -547,7 +547,7 @@ TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(*mock_app_, help_prompt_manager()) @@ -578,7 +578,7 @@ TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(*mock_app_, help_prompt_manager()) @@ -659,7 +659,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -690,13 +690,13 @@ TEST_F(AddCommandRequestTest, { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, @@ -734,13 +734,13 @@ TEST_F( commands_map, lock_ptr_))); { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } @@ -779,13 +779,13 @@ TEST_F( { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } @@ -824,13 +824,13 @@ TEST_F( { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } std::shared_ptr<AddCommandRequest> request_ptr = @@ -873,13 +873,13 @@ TEST_F( commands_map, lock_ptr_))); { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } std::shared_ptr<AddCommandRequest> request_ptr = @@ -921,7 +921,7 @@ TEST_F( commands_map, lock_ptr_))); EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -958,7 +958,7 @@ TEST_F( EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -996,13 +996,13 @@ TEST_F(AddCommandRequestTest, commands_map, lock_ptr_))); { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, @@ -1020,9 +1020,9 @@ TEST_F(AddCommandRequestTest, event_ui.set_smart_object(*msg_ui); Event event_vr(hmi_apis::FunctionID::VR_AddCommand); event_vr.set_smart_object(*msg_); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2); request_ptr->on_event(event_ui); @@ -1044,13 +1044,13 @@ TEST_F(AddCommandRequestTest, commands_map, lock_ptr_))); { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, @@ -1063,9 +1063,9 @@ TEST_F(AddCommandRequestTest, Event event_ui(hmi_apis::FunctionID::UI_AddCommand); event_ui.set_smart_object(*msg_); request_ptr->on_event(event_ui); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2); Event event_vr(hmi_apis::FunctionID::VR_AddCommand); @@ -1119,13 +1119,13 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) { .WillOnce(Return(so_ptr_.get())); { InSequence dummy; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand), _)) .WillOnce(Return(true)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand), _)) .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc index ecaa436529..a88a1ade69 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc @@ -35,14 +35,14 @@ #include "mobile/add_sub_menu_request.h" -#include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" -#include "application_manager/mock_message_helper.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -51,9 +51,9 @@ namespace mobile_commands_test { namespace add_sub_menu_request { namespace am = ::application_manager; -using sdl_rpc_plugin::commands::AddSubMenuRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; +using sdl_rpc_plugin::commands::AddSubMenuRequest; using ::testing::_; using ::testing::Return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc index 7d2dd0b2c2..e726616345 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc @@ -35,20 +35,20 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" -#include "mobile/alert_maneuver_request.h" -#include "interfaces/MOBILE_API.h" -#include "application_manager/policies/policy_handler_interface.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/policies/policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "interfaces/MOBILE_API.h" +#include "mobile/alert_maneuver_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -60,9 +60,9 @@ using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::AlertManeuverRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; +using sdl_rpc_plugin::commands::AlertManeuverRequest; typedef std::shared_ptr<AlertManeuverRequest> CommandPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc index e32cc2b335..113c6d32a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc @@ -31,19 +31,19 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/alert_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -52,12 +52,12 @@ namespace mobile_commands_test { namespace alert_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::AlertRequest; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; using am::event_engine::Event; using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::AlertRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -169,11 +169,11 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { void ExpectManageHmiCommandTTSAndUI() { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert), _)) .WillOnce(Return(true)); EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)) .WillOnce(Return(true)); } sync_primitives::Lock lock_; @@ -452,7 +452,7 @@ TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) { EXPECT_CALL(mock_rpc_service_, ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))); + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)); command->on_event(event); } @@ -479,7 +479,7 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)) .WillOnce(Return(true)); CommandPtr command(CreateCommand<AlertRequest>(msg_)); @@ -511,7 +511,7 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) { .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)) .WillOnce(Return(true)); CommandPtr command(CreateCommand<AlertRequest>(msg_)); @@ -556,9 +556,9 @@ TEST_F(AlertRequestTest, CommandPtr command(CreateCommand<AlertRequest>(msg_)); command->Run(); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)) .WillOnce(Return(true)); Event ui_event(hmi_apis::FunctionID::UI_Alert); @@ -605,9 +605,9 @@ TEST_F(AlertRequestTest, OnEvent_TTSUnsupportedResourceUiAlertSuccess_SUCCESS) { (*msg_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::SUCCESS; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)) .WillOnce(Return(true)); Event ui_event(hmi_apis::FunctionID::UI_Alert); @@ -645,7 +645,7 @@ TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) { .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)) .WillOnce(Return(true)); CommandPtr command(CreateCommand<AlertRequest>(msg_)); @@ -654,9 +654,9 @@ TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) { (*msg_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::INVALID_ENUM; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)) .WillOnce(Return(true)); Event ui_event(hmi_apis::FunctionID::UI_Alert); @@ -695,7 +695,7 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) { .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))) + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)) .WillOnce(Return(true)); CommandPtr command(CreateCommand<AlertRequest>(msg_)); @@ -704,9 +704,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) { (*msg_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::INVALID_ENUM; - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)) .WillOnce(Return(true)); Event ui_event(hmi_apis::FunctionID::UI_Alert); @@ -743,9 +743,9 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) { CommandPtr command(CreateCommand<AlertRequest>(msg_)); command->Run(); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)) .WillOnce(Return(true)); Event ui_event(hmi_apis::FunctionID::UI_Alert); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc index 58755c8b36..4394c6fe5e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc @@ -31,25 +31,25 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/change_registration_request.h" -#include "gtest/gtest.h" -#include "utils/helpers.h" -#include "utils/custom_string.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/smart_object_keys.h" -#include "policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" +#include "utils/helpers.h" namespace test { namespace components { @@ -58,18 +58,18 @@ namespace mobile_commands_test { namespace change_registration_request { namespace am = application_manager; -using am::commands::CommandImpl; using am::ApplicationManager; -using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; +using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; +using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::ChangeRegistrationRequest; +using ::test::components::application_manager_test::MockApplication; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; using ::testing::SetArgPointee; -using sdl_rpc_plugin::commands::ChangeRegistrationRequest; -using policy_test::MockPolicyHandlerInterface; -using ::test::components::application_manager_test::MockApplication; namespace custom_str = utils::custom_string; namespace strings = ::application_manager::strings; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc index c42be48e57..73a0008624 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc @@ -31,24 +31,24 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/create_interaction_choice_set_request.h" #include "mobile/create_interaction_choice_set_response.h" -#include "gtest/gtest.h" -#include "utils/helpers.h" -#include "smart_objects/smart_object.h" -#include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" +#include "utils/helpers.h" namespace test { namespace components { @@ -57,18 +57,18 @@ namespace mobile_commands_test { namespace create_interaction_choice_set_request { namespace am = application_manager; -using am::commands::CommandImpl; using am::ApplicationManager; -using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; -using ::testing::_; -using ::testing::Return; -using ::testing::ReturnRef; -using ::testing::AtLeast; +using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::CreateInteractionChoiceSetRequest; using sdl_rpc_plugin::commands::CreateInteractionChoiceSetResponse; using ::test::components::application_manager_test::MockApplication; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Return; +using ::testing::ReturnRef; namespace custom_str = utils::custom_string; namespace strings = ::application_manager::strings; @@ -232,7 +232,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { .WillByDefault( Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); ON_CALL(mock_message_helper_, CheckChoiceSetVRCommands(_)) .WillByDefault(Return(am::MessageHelper::ChoiceSetVRCommandsStatus::ALL)); req_vr->Run(); @@ -920,4 +920,4 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) { } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc index a87d172923..081058f05a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc @@ -37,15 +37,15 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_help_prompt_manager.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -58,11 +58,11 @@ using ::testing::Return; using ::testing::ReturnRef; namespace am = ::application_manager; namespace am_test = application_manager_test; -using sdl_rpc_plugin::commands::DeleteCommandRequest; +using am::MockHmiInterfaces; +using am::MockMessageHelper; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockMessageHelper; -using am::MockHmiInterfaces; +using sdl_rpc_plugin::commands::DeleteCommandRequest; typedef std::shared_ptr<DeleteCommandRequest> DeleteCommandPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc index 0ed7a92fa4..4081583099 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc @@ -31,32 +31,32 @@ */ #include <stdint.h> -#include <vector> -#include <string> #include <map> +#include <string> +#include <vector> #include "mobile/delete_file_request.h" #include "mobile/delete_file_response.h" #include "gtest/gtest.h" -#include "utils/file_system.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" -#include "application_manager/mock_message_helper.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" +#include "utils/file_system.h" -#include "interfaces/MOBILE_API.h" -#include "application_manager/policies/policy_handler_interface.h" #include "application_manager/policies/policy_handler.h" +#include "application_manager/policies/policy_handler_interface.h" +#include "interfaces/MOBILE_API.h" namespace test { namespace components { @@ -65,17 +65,17 @@ namespace mobile_commands_test { namespace delete_file { using ::testing::_; -using ::testing::Test; +using ::testing::AtLeast; using ::testing::Return; using ::testing::ReturnRef; using ::testing::SetArgReferee; -using ::testing::AtLeast; +using ::testing::Test; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::DeleteFileRequest; -using sdl_rpc_plugin::commands::DeleteFileResponse; +using am::MockMessageHelper; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::DeleteFileRequest; +using sdl_rpc_plugin::commands::DeleteFileResponse; typedef std::shared_ptr<DeleteFileRequest> DeleteFileRequestPtr; typedef std::shared_ptr<DeleteFileResponse> DeleteFileResponsePtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc index 43c30809e5..fa96b21ca7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc @@ -38,13 +38,13 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,15 +53,15 @@ namespace mobile_commands_test { namespace delete_interaction_choice_set { using ::testing::_; -using ::testing::Return; using ::testing::InSequence; +using ::testing::Return; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetRequest; -using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse; using am::commands::MessageSharedPtr; using am::event_engine::Event; +using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetRequest; +using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse; typedef std::shared_ptr<DeleteInteractionChoiceSetRequest> DeleteInteractionChoiceSetRequestPtr; @@ -252,7 +252,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) { EXPECT_CALL(*app_, UpdateHash()); } - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); DeleteInteractionChoiceSetRequestPtr command = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc index f1c44f86ac..04f12568b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc @@ -36,14 +36,14 @@ #include "mobile/delete_sub_menu_request.h" #include "mobile/delete_sub_menu_response.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_help_prompt_manager.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -52,15 +52,15 @@ namespace mobile_commands_test { namespace delete_sub_menu_request { using ::testing::_; +using ::testing::InSequence; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::InSequence; namespace am = ::application_manager; namespace am_test = application_manager_test; -using am::commands::MessageSharedPtr; -using am::event_engine::Event; using am::MockHmiInterfaces; using am::MockMessageHelper; +using am::commands::MessageSharedPtr; +using am::event_engine::Event; using sdl_rpc_plugin::commands::DeleteSubMenuRequest; using sdl_rpc_plugin::commands::DeleteSubMenuResponse; @@ -224,9 +224,9 @@ TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) { EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationId)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteSubMenu), _)) .WillOnce(Return(true)); command_->Run(); } @@ -273,9 +273,9 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey)); EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_)); @@ -284,9 +284,9 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { EXPECT_CALL(*app_, help_prompt_manager()) .WillOnce(ReturnRef(*mock_help_prompt_manager_)); EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandDeleted(kCmdId, false)); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand), _)) .WillOnce(Return(true)); EXPECT_CALL(*app_, RemoveSubMenu(_)); @@ -330,7 +330,7 @@ TEST_F(DeleteSubMenuRequestTest, std::make_pair(0, &((*message_)[am::strings::msg_params]))); EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_)); EXPECT_CALL(*app_, RemoveCommand(_)).Times(0); @@ -357,7 +357,7 @@ TEST_F(DeleteSubMenuRequestTest, std::make_pair(0, &((*message_)[am::strings::msg_params]))); EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_)); EXPECT_CALL(*app_, RemoveCommand(_)).Times(0); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc index 5d6c6dc89e..cf2634b37c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc @@ -36,16 +36,16 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" -#include "mobile/dial_number_request.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/smart_object_keys.h" #include "interfaces/MOBILE_API.h" +#include "mobile/dial_number_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -57,8 +57,8 @@ using ::testing::_; using ::testing::Return; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::DialNumberRequest; using am::event_engine::Event; +using sdl_rpc_plugin::commands::DialNumberRequest; namespace mobile_result = mobile_apis::Result; typedef std::shared_ptr<DialNumberRequest> DialNumberRequestPtr; @@ -131,9 +131,11 @@ TEST_F(DialNumberRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::BasicCommunication_DialNumber))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::BasicCommunication_DialNumber), + _)); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc index 8589cbb6be..8f83a2dd10 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc @@ -62,6 +62,8 @@ #include "mobile/end_audio_pass_thru_request.h" #include "mobile/end_audio_pass_thru_response.h" #include "mobile/generic_response.h" +#include "mobile/get_file_request.h" +#include "mobile/get_file_response.h" #include "mobile/get_way_points_request.h" #include "mobile/get_way_points_response.h" #include "mobile/list_files_request.h" @@ -78,6 +80,7 @@ #include "mobile/on_keyboard_input_notification.h" #include "mobile/on_language_change_notification.h" #include "mobile/on_permissions_change_notification.h" +#include "mobile/on_system_capability_updated_notification.h" #include "mobile/on_system_request_notification.h" #include "mobile/on_tbt_client_state_notification.h" #include "mobile/on_touch_event_notification.h" @@ -128,8 +131,8 @@ #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "test/application_manager/mock_application_manager_settings.h" #include "application_manager/mock_event_dispatcher.h" +#include "test/application_manager/mock_application_manager_settings.h" namespace am = application_manager; @@ -140,16 +143,16 @@ namespace mobile_commands_test { namespace dummy_mobile_commands_test { namespace commands = sdl_rpc_plugin::commands; -using ::testing::_; -using ::testing::NotNull; -using ::testing::Types; using am::commands::MessageSharedPtr; -using ::test::components::event_engine_test::MockEventDispatcher; +using ::application_manager::ApplicationSharedPtr; +using ::test::components::application_manager_test::MockApplication; using ::test::components::application_manager_test::MockApplicationManager; using ::test::components::application_manager_test:: MockApplicationManagerSettings; -using ::application_manager::ApplicationSharedPtr; -using ::test::components::application_manager_test::MockApplication; +using ::test::components::event_engine_test::MockEventDispatcher; +using ::testing::_; +using ::testing::NotNull; +using ::testing::Types; namespace { const std::string kEmptyString_ = ""; @@ -220,6 +223,8 @@ typedef Types<commands::AddCommandRequest, commands::EndAudioPassThruRequest, commands::EndAudioPassThruResponse, commands::GenericResponse, + commands::GetFileRequest, + commands::GetFileResponse, commands::GetWayPointsRequest, commands::GetWayPointsResponse, commands::ListFilesRequest, @@ -236,12 +241,13 @@ typedef Types<commands::AddCommandRequest, commands::mobile::OnKeyBoardInputNotification, commands::OnLanguageChangeNotification, commands::OnPermissionsChangeNotification, - commands::mobile::OnSystemRequestNotification, - commands::OnTBTClientStateNotification, - commands::mobile::OnTouchEventNotification> + commands::mobile::OnSystemCapabilityUpdatedNotification> MobileCommandsListFirst; -typedef Types<commands::OnWayPointChangeNotification, +typedef Types<commands::mobile::OnSystemRequestNotification, + commands::OnTBTClientStateNotification, + commands::mobile::OnTouchEventNotification, + commands::OnWayPointChangeNotification, commands::PerformAudioPassThruRequest, commands::PerformAudioPassThruResponse, commands::PerformInteractionRequest, @@ -277,15 +283,17 @@ typedef Types<commands::OnWayPointChangeNotification, commands::SubscribeWayPointsRequest, commands::SubscribeWayPointsResponse, commands::SystemResponse, - commands::UnregisterAppInterfaceRequest, - commands::UnregisterAppInterfaceResponse, - commands::UnsubscribeButtonRequest, - commands::UnsubscribeButtonResponse> MobileCommandsListSecond; + commands::UnregisterAppInterfaceRequest> + MobileCommandsListSecond; -typedef Types<commands::UnsubscribeWayPointsRequest, +typedef Types<commands::UnregisterAppInterfaceResponse, + commands::UnsubscribeButtonRequest, + commands::UnsubscribeButtonResponse, + commands::UnsubscribeWayPointsRequest, commands::UnsubscribeWayPointsResponse, commands::UpdateTurnListRequest, - commands::UpdateTurnListResponse> MobileCommandsListThird; + commands::UpdateTurnListResponse> + MobileCommandsListThird; TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst); TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond); @@ -294,18 +302,18 @@ TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird); TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); - UNUSED(command); + EXPECT_NE(command.use_count(), 0); } } // namespace dummy_mobile_commands_test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc index 304cf13ffd..ba09e0dabe 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc @@ -36,14 +36,14 @@ #include "mobile/end_audio_pass_thru_request.h" -#include "gtest/gtest.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" -#include "application_manager/mock_message_helper.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -52,13 +52,13 @@ namespace mobile_commands_test { namespace end_audio_pass_thru_request { namespace am = ::application_manager; +using am::MockMessageHelper; +using am::commands::MessageSharedPtr; +using am::event_engine::Event; +using sdl_rpc_plugin::commands::EndAudioPassThruRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -using am::commands::MessageSharedPtr; -using sdl_rpc_plugin::commands::EndAudioPassThruRequest; -using am::event_engine::Event; -using am::MockMessageHelper; typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc index 09a3336a10..7f7a8b55bd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc @@ -32,18 +32,17 @@ #include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" -#include "mobile/get_way_points_request.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" -#include "application_manager/mock_hmi_interface.h" -#include "application_manager/mock_message_helper.h" +#include "mobile/get_way_points_request.h" namespace test { namespace components { @@ -52,11 +51,11 @@ namespace mobile_commands_test { namespace get_way_points_request { using namespace mobile_apis::Result; -using ::testing::Return; -using ::testing::_; -using sdl_rpc_plugin::commands::GetWayPointsRequest; -using application_manager::MockMessageHelper; using application_manager::MockHmiInterfaces; +using application_manager::MockMessageHelper; +using sdl_rpc_plugin::commands::GetWayPointsRequest; +using ::testing::_; +using ::testing::Return; typedef std::shared_ptr<GetWayPointsRequest> CommandPtr; typedef mobile_apis::Result::eType MobileResult; @@ -67,7 +66,7 @@ const uint32_t kCorrelationId = 2u; const uint32_t kAppId = 3u; const uint32_t kConnectionKey = kAppId; const std::string kMethodName = "Navigation.GetWayPoints"; -} +} // namespace class GetWayPointsRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { @@ -205,7 +204,7 @@ TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) { EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); CallOnEvent caller(*command_sptr_, event); caller(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc index 3fcc4225f3..8b6f6696b7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc @@ -35,15 +35,15 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" -#include "mobile/list_files_request.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/smart_object_keys.h" +#include "interfaces/MOBILE_API.h" +#include "mobile/list_files_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -52,13 +52,13 @@ namespace mobile_commands_test { namespace list_files_request { using ::testing::_; +using ::testing::DoAll; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::DoAll; using ::testing::SaveArg; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::ListFilesRequest; using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::ListFilesRequest; class ListFilesRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc index a0e41cf728..1f514e09c5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc @@ -33,16 +33,16 @@ #include <stdint.h> #include <string> +#include "application_manager/smart_object_keys.h" #include "gtest/gtest.h" #include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/commands/command_impl.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "mobile/on_button_event_notification.h" #include "mobile/on_button_press_notification.h" @@ -54,12 +54,12 @@ namespace on_button_notification { namespace am = ::application_manager; namespace commands = am::commands; +using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::mobile::OnButtonEventNotification; using sdl_rpc_plugin::commands::mobile::OnButtonPressNotification; using ::testing::_; -using ::testing::Types; using ::testing::Return; -using am::commands::MessageSharedPtr; +using ::testing::Types; namespace { const uint32_t kAppId = 5u; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc index 2fd6f6137d..1356b1c5fa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc @@ -35,11 +35,11 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" #include "mobile/on_command_notification.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc index 1d6711e36f..15faa5c13f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc @@ -32,12 +32,12 @@ #include <string> -#include "gtest/gtest.h" -#include "mobile/on_hash_change_notification.h" +#include "application_manager/commands/command_impl.h" #include "application_manager/mock_message_helper.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/commands/command_impl.h" #include "application_manager/test/include/application_manager/commands/commands_test.h" +#include "gtest/gtest.h" +#include "mobile/on_hash_change_notification.h" namespace test { namespace components { @@ -47,13 +47,13 @@ namespace on_hash_change_notification { namespace strings = application_manager::strings; -using sdl_rpc_plugin::commands::mobile::OnHashChangeNotification; using application_manager::MockMessageHelper; using application_manager::commands::CommandImpl; +using sdl_rpc_plugin::commands::mobile::OnHashChangeNotification; +using testing::_; using testing::Mock; using testing::Return; using testing::ReturnRef; -using testing::_; class OnHashChangeNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc index 333c204d57..528f1d8618 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "mobile/on_hmi_status_notification_from_mobile.h" -#include "application_manager/commands/commands_test.h" #include <application_manager/smart_object_keys.h> -#include "application_manager/message.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/message.h" #include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -51,12 +51,12 @@ const connection_handler::DeviceHandle kHandle = 2u; namespace strings = application_manager::strings; -using sdl_rpc_plugin::commands::OnHMIStatusNotificationFromMobile; -using protocol_handler::MajorProtocolVersion; using application_manager::ApplicationSet; +using protocol_handler::MajorProtocolVersion; +using sdl_rpc_plugin::commands::OnHMIStatusNotificationFromMobile; +using testing::_; using testing::Mock; using testing::Return; -using testing::_; class OnHMIStatusNotificationFromMobileTest : public CommandsTest<CommandsTestMocks::kIsNice> { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc index ba3b1e8f1d..5bf68414e5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc @@ -30,11 +30,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "mobile/on_hmi_status_notification.h" -#include "application_manager/test/include/application_manager/commands/commands_test.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/commands/command_impl.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/test/include/application_manager/commands/commands_test.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -47,13 +47,13 @@ const uint32_t kConnectionKey = 1u; } // namespace namespace strings = application_manager::strings; -using sdl_rpc_plugin::commands::OnHMIStatusNotification; -using protocol_handler::MajorProtocolVersion; using application_manager::MockMessageHelper; using application_manager::commands::CommandImpl; +using protocol_handler::MajorProtocolVersion; +using sdl_rpc_plugin::commands::OnHMIStatusNotification; +using testing::_; using testing::Mock; using testing::Return; -using testing::_; class OnHMIStatusNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc index 04f88e2b13..501b4d8631 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "mobile/on_keyboard_input_notification.h" -#include "application_manager/commands/commands_test.h" #include <application_manager/smart_object_keys.h> +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/message.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/commands/command_impl.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -50,13 +50,13 @@ namespace { const uint32_t kConnectionKey = 1u; } // namespace -using sdl_rpc_plugin::commands::mobile::OnKeyBoardInputNotification; +using application_manager::ApplicationSet; using application_manager::MockMessageHelper; using application_manager::commands::CommandImpl; -using application_manager::ApplicationSet; +using sdl_rpc_plugin::commands::mobile::OnKeyBoardInputNotification; +using testing::_; using testing::Mock; using testing::Return; -using testing::_; class OnKeyBoardInputNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc index 4981301e07..69ed8fb311 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc @@ -32,14 +32,13 @@ #include <string> -#include "gtest/gtest.h" -#include "mobile/on_system_request_notification.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_impl.h" +#include "gtest/gtest.h" #include "interfaces/MOBILE_API.h" +#include "mobile/on_system_request_notification.h" namespace test { namespace components { @@ -49,16 +48,16 @@ namespace on_system_request_notification { namespace strings = application_manager::strings; -using sdl_rpc_plugin::commands::mobile::OnSystemRequestNotification; -using application_manager::commands::CommandImpl; using application_manager::MockMessageHelper; +using application_manager::commands::CommandImpl; +using sdl_rpc_plugin::commands::mobile::OnSystemRequestNotification; using test::components::policy_test::MockPolicyHandlerInterface; using namespace mobile_apis; -using testing::SaveArg; +using testing::_; using testing::Mock; using testing::Return; using testing::ReturnRef; -using testing::_; +using testing::SaveArg; namespace { const uint32_t kConnectionKey = 1u; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc index 3d989db478..f1e1a291d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc @@ -36,10 +36,10 @@ #include "gtest/gtest.h" #include "mobile/on_tbt_client_state_notification.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" #include "utils/helpers.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc index f69dd5da2e..95020328b4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc @@ -36,10 +36,10 @@ #include "gtest/gtest.h" #include "mobile/on_touch_event_notification.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" #include "utils/helpers.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc index ed0a9b07d2..83958954cd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc @@ -36,10 +36,10 @@ #include "gtest/gtest.h" #include "mobile/on_way_point_change_notification.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" #include "utils/helpers.h" namespace test { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc index f51f1aa655..b0df0e57d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc @@ -31,18 +31,18 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/perform_audio_pass_thru_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -51,14 +51,14 @@ namespace mobile_commands_test { namespace perform_audio_pass_thru_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::PerformAudioPassThruRequest; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::PerformAudioPassThruRequest; using ::testing::_; +using ::testing::InSequence; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::InSequence; namespace { const int32_t kCommandId = 1; @@ -239,7 +239,7 @@ TEST_F(PerformAudioPassThruRequestTest, MessageSharedPtr response_to_mobile; uint32_t app_id = kConnectionKey; EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).WillOnce(Return(false)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillRepeatedly(Return(true)); EXPECT_CALL( mock_rpc_service_, @@ -250,7 +250,8 @@ TEST_F(PerformAudioPassThruRequestTest, VerifyTtsFiles((*mobile_request)[am::strings::msg_params] [am::strings::initial_prompt], _, - _)).WillOnce(Return(mobile_apis::Result::SUCCESS)); + _)) + .WillOnce(Return(mobile_apis::Result::SUCCESS)); command->Run(); command->on_event(event_tts); @@ -342,7 +343,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); // Perform audio path thru request sending @@ -355,7 +356,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); } CallRun run_caller(*command_sptr_); @@ -431,7 +432,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); // Perform audio path thru request sending @@ -444,7 +445,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); } CallRun caller(*command_sptr_); @@ -463,10 +464,12 @@ TEST_F(PerformAudioPassThruRequestTest, .asString(); const std::string result_display_text_1 = perform_msg_params[am::hmi_request::audio_pass_display_texts][0] - [am::hmi_request::field_text].asString(); + [am::hmi_request::field_text] + .asString(); const std::string result_display_text_2 = perform_msg_params[am::hmi_request::audio_pass_display_texts][1] - [am::hmi_request::field_text].asString(); + [am::hmi_request::field_text] + .asString(); EXPECT_EQ(kCorrectPrompt, result_initial_prompt); EXPECT_EQ(kCorrectType, result_prompt_type); @@ -505,7 +508,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); // Perform audio path thru request sending @@ -518,7 +521,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); } CallRun caller(*command_sptr_); @@ -551,7 +554,7 @@ TEST_F( .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Perform audio path thru request sending - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); // Perform audio path thru request sending @@ -564,7 +567,7 @@ TEST_F( .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Start recording notification sending - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&start_record_result_msg), Return(true))); } @@ -579,7 +582,8 @@ TEST_F( const hmi_apis::FunctionID::eType start_record_result_function_id = static_cast<hmi_apis::FunctionID::eType>( (*start_record_result_msg)[am::strings::params] - [am::strings::function_id].asInt()); + [am::strings::function_id] + .asInt()); EXPECT_EQ(hmi_apis::FunctionID::UI_OnRecordStart, start_record_result_function_id); } @@ -613,7 +617,7 @@ TEST_F(PerformAudioPassThruRequestTest, // Start recording notification sending - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); // Start microphone recording cals uint32_t app_id = kConnectionKey; @@ -676,7 +680,7 @@ TEST_F(PerformAudioPassThruRequestTest, msg_params_[am::strings::function_id] = kFunctionId; msg_params_[am::strings::correlation_id] = kCorrelationId; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); uint32_t app_id = kConnectionKey; EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true)); @@ -703,7 +707,7 @@ TEST_F(PerformAudioPassThruRequestTest, msg_params_[am::strings::function_id] = kFunctionId; uint32_t app_id = kConnectionKey; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true)); EXPECT_CALL( @@ -751,7 +755,7 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); command_sptr_->onTimeOut(); } @@ -783,7 +787,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); // Perform audio path thru request sending @@ -796,7 +800,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); @@ -807,7 +811,7 @@ TEST_F(PerformAudioPassThruRequestTest, // For setting is_active_tts_speak -> true - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .Times(2) .WillRepeatedly(Return(false)); CallRun caller(*command_sptr_); @@ -819,9 +823,9 @@ TEST_F(PerformAudioPassThruRequestTest, ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)); command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS); - EXPECT_CALL( - mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking))) + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking), _)) .WillOnce(Return(false)); command_sptr_->onTimeOut(); @@ -831,4 +835,4 @@ TEST_F(PerformAudioPassThruRequestTest, } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc index 3b68d3ea72..f1f7c4c907 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc @@ -31,22 +31,22 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/perform_interaction_request.h" -#include "gtest/gtest.h" -#include "utils/helpers.h" -#include "smart_objects/smart_object.h" -#include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" +#include "utils/helpers.h" namespace test { namespace components { @@ -55,16 +55,16 @@ namespace mobile_commands_test { namespace perform_interaction_request { namespace am = application_manager; -using am::commands::CommandImpl; using am::ApplicationManager; -using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; +using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::PerformInteractionRequest; +using ::test::components::application_manager_test::MockApplication; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -using sdl_rpc_plugin::commands::PerformInteractionRequest; -using ::test::components::application_manager_test::MockApplication; namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; @@ -258,4 +258,4 @@ TEST_F(PerformInteractionRequestTest, } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc index df4f69f0d0..e8e03484ed 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc @@ -36,18 +36,18 @@ #include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" -#include "mobile/put_file_response.h" #include "mobile/put_file_request.h" +#include "mobile/put_file_response.h" -#include "utils/file_system.h" -#include "smart_objects/smart_object.h" -#include "interfaces/MOBILE_API.h" #include "application_manager/application.h" #include "application_manager/mock_application.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" +#include "utils/file_system.h" namespace test { namespace components { @@ -56,16 +56,16 @@ namespace mobile_commands_test { namespace put_file { using ::testing::_; +using ::testing::AtLeast; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::AtLeast; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::PutFileRequest; -using sdl_rpc_plugin::commands::PutFileResponse; using am::commands::MessageSharedPtr; using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::PutFileRequest; +using sdl_rpc_plugin::commands::PutFileResponse; typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr; typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr; @@ -78,7 +78,7 @@ const int64_t kZeroOffset = 0u; const std::string kStorageFolder = "./storage"; const std::string kFolder = "folder"; const std::string kAppFolder = "app_folder"; -} +} // namespace class PutFileRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { @@ -315,9 +315,11 @@ TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) { EXPECT_CALL(app_mngr_, SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::BasicCommunication_OnPutFile))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::BasicCommunication_OnPutFile), + _)) .WillOnce(Return(true)); ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc index 7dab16fe35..0e8374b75a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc @@ -34,25 +34,25 @@ #include <string> #include <vector> -#include "gtest/gtest.h" -#include "mobile/register_app_interface_request.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_helper.h" -#include "interfaces/MOBILE_API.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/policies/mock_policy_handler_interface.h" -#include "protocol_handler/mock_session_observer.h" -#include "connection_handler/mock_connection_handler.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/mock_resume_ctrl.h" #include "application_manager/mock_hmi_interface.h" -#include "utils/data_accessor.h" +#include "application_manager/mock_resume_ctrl.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "connection_handler/mock_connection_handler.h" +#include "gtest/gtest.h" +#include "interfaces/MOBILE_API.h" +#include "mobile/register_app_interface_request.h" +#include "protocol_handler/mock_session_observer.h" +#include "smart_objects/smart_object.h" #include "utils/custom_string.h" +#include "utils/data_accessor.h" #include "utils/lock.h" #include "utils/macro.h" #include "utils/semantic_version.h" @@ -64,9 +64,9 @@ namespace mobile_commands_test { namespace register_app_interface_request { using ::testing::_; +using ::testing::DoAll; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::DoAll; namespace am = ::application_manager; @@ -207,27 +207,38 @@ class RegisterAppInterfaceRequestTest mock_rpc_service_, ManageMobileCommand(MobileResultCodeIs(response_result_code), _)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::BasicCommunication_OnAppRegistered))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs( + hmi_apis::FunctionID::BasicCommunication_OnAppRegistered), + _)) .Times(0); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Buttons_OnButtonSubscription))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription), + _)) .Times(0); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_ChangeRegistration))).Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration), _)) + .Times(0); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_ChangeRegistration))).Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_ChangeRegistration), _)) + .Times(0); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration), _)) + .Times(0); EXPECT_CALL(app_mngr_, OnApplicationSwitched( @@ -297,12 +308,16 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) { EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app)); EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::BasicCommunication_OnAppRegistered))) + ManageHMICommand( + HMIResultCodeIs( + hmi_apis::FunctionID::BasicCommunication_OnAppRegistered), + _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Buttons_OnButtonSubscription))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription), + _)) .WillOnce(Return(true)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) @@ -399,24 +414,31 @@ TEST_F(RegisterAppInterfaceRequestTest, .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::BasicCommunication_OnAppRegistered))) + ManageHMICommand( + HMIResultCodeIs( + hmi_apis::FunctionID::BasicCommunication_OnAppRegistered), + _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Buttons_OnButtonSubscription))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription), + _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VR_ChangeRegistration), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_ChangeRegistration))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_ChangeRegistration), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration), _)) .WillOnce(Return(true)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, am::commands::Command::SOURCE_SDL)) @@ -447,7 +469,8 @@ TEST_F(RegisterAppInterfaceRequestTest, mock_resume_crt_, CheckApplicationHash( std::static_pointer_cast<application_manager::Application>(mock_app), - request_hash_id)).WillOnce(Return(true)); + request_hash_id)) + .WillOnce(Return(true)); EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0); @@ -481,7 +504,8 @@ TEST_F(RegisterAppInterfaceRequestTest, mock_resume_crt_, CheckApplicationHash( std::static_pointer_cast<application_manager::Application>(mock_app), - request_hash_id)).WillOnce(Return(false)); + request_hash_id)) + .WillOnce(Return(false)); EXPECT_CALL( mock_application_helper_, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc index 0e3cd685fa..98c0ad098a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc @@ -37,17 +37,17 @@ #include "mobile/reset_global_properties_request.h" #include "mobile/reset_global_properties_response.h" -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "interfaces/HMI_API.h" -#include "interfaces/MOBILE_API.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/smart_object_keys.h" +#include "gtest/gtest.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -61,11 +61,11 @@ using ::testing::ReturnRef; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::ResetGlobalPropertiesRequest; -using sdl_rpc_plugin::commands::ResetGlobalPropertiesResponse; +using am::MockMessageHelper; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::ResetGlobalPropertiesRequest; +using sdl_rpc_plugin::commands::ResetGlobalPropertiesResponse; typedef std::shared_ptr<ResetGlobalPropertiesRequest> ResetGlobalPropertiesRequestPtr; @@ -170,7 +170,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) { EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); command_->Run(); } @@ -237,13 +237,15 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) { EXPECT_CALL(*mock_app_, timeout_prompt()) .WillOnce(Return(so_help_prompt.get())); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _)) .WillOnce(Return(true)); command_->Run(); @@ -274,9 +276,10 @@ TEST_F(ResetGlobalPropertiesRequestTest, smart_objects::SmartType_Map); EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); command_->Run(); @@ -320,13 +323,15 @@ TEST_F(ResetGlobalPropertiesRequestTest, (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId; (*ui_msg)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::eType::SUCCESS; - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _)) .WillOnce(Return(true)); Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties); ui_event.set_smart_object(*ui_msg); @@ -362,9 +367,10 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { EXPECT_CALL(*mock_app_, reset_vr_help()); EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); smart_objects::SmartObjectSPtr vr_help = std::make_shared<smart_objects::SmartObject>( @@ -412,13 +418,15 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _)) .WillOnce(Return(true)); ResetGlobalPropertiesRequestPtr command = @@ -477,13 +485,15 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _)) .WillOnce(Return(true)); command_->Run(); @@ -541,13 +551,15 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _)) .WillOnce(Return(true)); command_->Run(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc index cf25a82972..3820112ea5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc @@ -31,20 +31,20 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/scrollable_message_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -57,10 +57,10 @@ namespace hmi_response = am::hmi_response; namespace mobile_result = mobile_apis::Result; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::ScrollableMessageRequest; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::ScrollableMessageRequest; using ::testing::_; using ::testing::Eq; using ::testing::Ref; @@ -282,4 +282,4 @@ TEST_F(ScrollableMessageRequestTest, } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc index 6c7127e48c..3cb9642021 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc @@ -32,15 +32,15 @@ #include "gtest/gtest.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "mobile/send_haptic_data_request.h" #include "mobile/send_haptic_data_response.h" -#include "interfaces/MOBILE_API.h" #include "application_manager/application.h" #include "application_manager/mock_application.h" +#include "interfaces/MOBILE_API.h" namespace test { namespace components { @@ -53,9 +53,9 @@ using ::testing::Return; namespace am = ::application_manager; +using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::SendHapticDataRequest; using sdl_rpc_plugin::commands::SendHapticDataResponse; -using am::commands::MessageSharedPtr; typedef std::shared_ptr<SendHapticDataRequest> SendHapticDataRequestPtr; typedef std::shared_ptr<SendHapticDataResponse> SendHapticDataResponsePtr; @@ -102,7 +102,7 @@ TEST_F(SendHapticDataRequestTest, Run_SUCCESS) { EXPECT_CALL(mock_rpc_service_, ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData))) + HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData), _)) .WillOnce(Return(true)); SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc index 4f44293fc9..5d90453278 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc @@ -32,10 +32,10 @@ #include <stdint.h> #include <string> -#include "gtest/gtest.h" -#include "mobile/send_location_request.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" +#include "mobile/send_location_request.h" #include "application_manager/commands/command_request_test.h" @@ -45,11 +45,11 @@ namespace commands_test { namespace mobile_commands_test { namespace send_location_request { +using application_manager::MockMessageHelper; using application_manager::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::SendLocationRequest; -using application_manager::MockMessageHelper; -using test::components::application_manager_test::MockHMICapabilities; using smart_objects::SmartObject; +using test::components::application_manager_test::MockHMICapabilities; using testing::_; using testing::Return; @@ -137,15 +137,16 @@ class SendLocationRequestTest void FinishSetup() { EXPECT_CALL(*mock_app_, hmi_app_id()).WillOnce(Return(kAppID)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Navigation_SendLocation))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Navigation_SendLocation), _)); } void FinishSetupCancelled(mobile_apis::Result::eType result) { EXPECT_CALL(*mock_app_, hmi_app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(MobileResultCodeIs(result), _)); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc index d8d1faca47..116a796312 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc @@ -31,20 +31,20 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/set_app_icon_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" #include "protocol_handler/mock_protocol_handler.h" #include "protocol_handler/mock_protocol_handler_settings.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" namespace test { namespace components { @@ -53,11 +53,11 @@ namespace mobile_commands_test { namespace set_app_icon_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::SetAppIconRequest; +using am::MockHmiInterfaces; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; -using am::MockHmiInterfaces; +using sdl_rpc_plugin::commands::SetAppIconRequest; using test::components::protocol_handler_test::MockProtocolHandler; using test::components::protocol_handler_test::MockProtocolHandlerSettings; using ::testing::_; @@ -170,4 +170,4 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc index cd6af1512d..cc2f042eac 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc @@ -31,19 +31,19 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/set_display_layout_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" -#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -53,10 +53,10 @@ namespace set_display_layout_request { namespace am = application_manager; namespace mobile_result = mobile_apis::Result; -using sdl_rpc_plugin::commands::SetDisplayLayoutRequest; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::SetDisplayLayoutRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -201,7 +201,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(CheckMshCorrId(kCorrelationKey))) + ManageHMICommand(CheckMshCorrId(kCorrelationKey), _)) .WillOnce(Return(true)); command->Run(); @@ -246,4 +246,4 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) { } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc index 03aa5d85a1..3e791aef01 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc @@ -32,19 +32,19 @@ #include <stdint.h> #include <memory> -#include <string> #include <set> +#include <string> #include "mobile/set_global_properties_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" -#include "application_manager/mock_help_prompt_manager.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/mock_help_prompt_manager.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -53,15 +53,15 @@ namespace mobile_commands_test { namespace set_global_properties_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest; +using am::CommandsMap; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; -using am::CommandsMap; -using utils::custom_string::CustomString; +using sdl_rpc_plugin::commands::SetGlobalPropertiesRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; +using utils::custom_string::CustomString; namespace { const int32_t kCommandId = 1; @@ -314,20 +314,23 @@ TEST_F(SetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, help_prompt_manager()) .WillRepeatedly(ReturnRef(*mock_help_prompt_manager_.get())); EXPECT_CALL(*mock_help_prompt_manager_, - OnSetGlobalPropertiesReceived(_, false)).Times(2); + OnSetGlobalPropertiesReceived(_, false)) + .Times(2); EXPECT_CALL( mock_message_helper_, VerifyTtsFiles( (*msg_vr)[am::strings::msg_params][am::strings::help_prompt], _, _)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::UI_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::UI_SetGlobalProperties), _)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::TTS_SetGlobalProperties))) + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::TTS_SetGlobalProperties), _)) .WillOnce(Return(true)); (*msg_vr)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::SUCCESS; @@ -413,7 +416,8 @@ TEST_F(SetGlobalPropertiesRequestTest, command->Run(); EXPECT_CALL(*mock_help_prompt_manager_, - OnSetGlobalPropertiesReceived(_, true)).Times(2); + OnSetGlobalPropertiesReceived(_, true)) + .Times(2); command->on_event(event_ui); command->on_event(event_tts); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc index a69d3d741b..86d15e76f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc @@ -35,13 +35,13 @@ #include "mobile/set_media_clock_timer_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -50,10 +50,10 @@ namespace mobile_commands_test { namespace set_media_clock_timer_request { namespace am = ::application_manager; -using sdl_rpc_plugin::commands::SetMediaClockRequest; +using am::MockMessageHelper; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::SetMediaClockRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -179,7 +179,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); command->Run(); } @@ -217,7 +217,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc index 4725af4671..ed0f52a521 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc @@ -32,19 +32,19 @@ #include <stdint.h> #include <memory> -#include <string> #include <set> +#include <string> #include "mobile/show_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -53,10 +53,10 @@ namespace mobile_commands_test { namespace show_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::ShowRequest; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; +using sdl_rpc_plugin::commands::ShowRequest; using test::components::policy_test::MockPolicyHandlerInterface; using ::testing::_; using ::testing::Return; @@ -125,7 +125,7 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { static_cast<int32_t>(field_name); msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] = text_field_; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); } @@ -143,7 +143,7 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0); } @@ -196,7 +196,7 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { } } - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); } @@ -272,7 +272,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) { EXPECT_CALL( mock_message_helper_, SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -296,7 +296,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) { smart_objects::SmartObject(smart_objects::SmartType_Array); EXPECT_CALL(*mock_app_, UnsubscribeFromSoftButtons(kFunctionID)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -321,7 +321,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) { EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _)) .Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0); command->Run(); @@ -348,7 +348,7 @@ TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) { msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -375,7 +375,7 @@ TEST_F(ShowRequestTest, Run_Graphic_WARNINGS) { msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -398,7 +398,7 @@ TEST_F(ShowRequestTest, Run_Graphic_Canceled) { .WillOnce(Return(mobile_apis::Result::INVALID_DATA)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0); command->Run(); @@ -421,7 +421,7 @@ TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0); command->Run(); @@ -447,7 +447,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) { msg_params[am::strings::app_id] = kAppId; msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -473,7 +473,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WARNINGS) { msg_params[am::strings::app_id] = kAppId; msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -497,7 +497,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0); command->Run(); @@ -520,7 +520,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0); command->Run(); @@ -836,7 +836,7 @@ TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) { msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -859,7 +859,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) { msg_params[am::strings::app_id] = kAppId; msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)); EXPECT_CALL(*mock_app_, set_show_command(msg_params)); command->Run(); @@ -880,7 +880,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0); command->Run(); @@ -895,7 +895,7 @@ TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) { .WillOnce(Return(MockAppPtr())); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0); command->Run(); @@ -910,7 +910,7 @@ TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) { .WillOnce(Return(mock_app_)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); EXPECT_CALL(*mock_app_, app_id()).Times(0); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0); command->Run(); @@ -971,4 +971,4 @@ TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) { } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc index d96a9d7643..6e85aff281 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc @@ -35,16 +35,16 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/commands_test.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" #include "mobile/on_app_interface_unregistered_notification.h" #include "mobile/on_audio_pass_thru_notification.h" #include "mobile/on_driver_distraction_notification.h" #include "mobile/on_language_change_notification.h" #include "mobile/on_permissions_change_notification.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -56,8 +56,8 @@ namespace am = ::application_manager; namespace commands = sdl_rpc_plugin::commands; using ::testing::_; -using ::testing::Types; using ::testing::Return; +using ::testing::Types; template <class Command> class MobileNotificationCommandsTest diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc index bbd39874e0..0034dcf916 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc @@ -38,37 +38,36 @@ #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" -#include "mobile/delete_command_response.h" +#include "mobile/add_command_response.h" +#include "mobile/add_sub_menu_response.h" #include "mobile/alert_maneuver_response.h" #include "mobile/alert_response.h" -#include "mobile/list_files_response.h" -#include "mobile/subscribe_button_response.h" -#include "mobile/add_sub_menu_response.h" +#include "mobile/change_registration_response.h" +#include "mobile/delete_command_response.h" #include "mobile/dial_number_response.h" #include "mobile/end_audio_pass_thru_response.h" -#include "mobile/unregister_app_interface_response.h" -#include "mobile/unsubscribe_button_response.h" -#include "mobile/unsubscribe_way_points_response.h" -#include "mobile/update_turn_list_response.h" -#include "mobile/slider_response.h" -#include "mobile/speak_response.h" -#include "mobile/subscribe_way_points_response.h" -#include "mobile/system_response.h" +#include "mobile/generic_response.h" #include "mobile/get_way_points_response.h" -#include "mobile/perform_interaction_response.h" +#include "mobile/list_files_response.h" #include "mobile/perform_audio_pass_thru_response.h" +#include "mobile/perform_interaction_response.h" +#include "mobile/scrollable_message_response.h" +#include "mobile/send_location_response.h" +#include "mobile/set_app_icon_response.h" +#include "mobile/set_display_layout_response.h" #include "mobile/set_global_properties_response.h" #include "mobile/set_media_clock_timer_response.h" #include "mobile/show_constant_tbt_response.h" #include "mobile/show_response.h" -#include "mobile/add_command_response.h" -#include "mobile/send_location_response.h" -#include "mobile/set_app_icon_response.h" -#include "mobile/set_display_layout_response.h" -#include "mobile/generic_response.h" -#include "mobile/set_app_icon_response.h" -#include "mobile/scrollable_message_response.h" -#include "mobile/change_registration_response.h" +#include "mobile/slider_response.h" +#include "mobile/speak_response.h" +#include "mobile/subscribe_button_response.h" +#include "mobile/subscribe_way_points_response.h" +#include "mobile/system_response.h" +#include "mobile/unregister_app_interface_response.h" +#include "mobile/unsubscribe_button_response.h" +#include "mobile/unsubscribe_way_points_response.h" +#include "mobile/update_turn_list_response.h" namespace test { namespace components { @@ -120,7 +119,8 @@ typedef Types<commands::ListFilesResponse, commands::SendLocationResponse, commands::SetAppIconResponse, commands::SetDisplayLayoutResponse, - commands::ChangeRegistrationResponse> ResponseCommandsList; + commands::ChangeRegistrationResponse> + ResponseCommandsList; TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc index be14aebc8f..0450f06ee1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc @@ -31,19 +31,19 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "mobile/slider_request.h" -#include "gtest/gtest.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -52,11 +52,11 @@ namespace mobile_commands_test { namespace slider_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::SliderRequest; +using am::MockMessageHelper; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockMessageHelper; using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::SliderRequest; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -268,7 +268,7 @@ TEST_F(SliderRequestTest, Run_SUCCESS) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider))); + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider), _)); CommandPtr command(CreateCommand<SliderRequest>(msg_)); command->Run(); @@ -337,4 +337,4 @@ TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) { } // namespace mobile_commands_test } // namespace commands_test } // namespace components -} // namespace tests +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc index 9eb23eeee3..87320d3a7a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc @@ -31,26 +31,26 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "mobile/speak_request.h" #include <string> #include "gtest/gtest.h" -#include "mobile/speak_request.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" #include "utils/helpers.h" -#include "smart_objects/smart_object.h" -#include "utils/custom_string.h" #include "application_manager/application.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" namespace test { namespace components { @@ -62,24 +62,24 @@ namespace am = application_manager; namespace mobile_result = mobile_apis::Result; namespace hmi_response = ::application_manager::hmi_response; namespace strings = ::application_manager::strings; -using am::commands::CommandImpl; using am::ApplicationManager; -using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; +using am::commands::CommandImpl; +using am::commands::MessageSharedPtr; using ::testing::_; -using ::testing::Return; -using ::testing::ReturnRef; using sdl_rpc_plugin::commands::SpeakRequest; using ::test::components::application_manager_test::MockApplication; +using ::testing::Return; +using ::testing::ReturnRef; typedef std::shared_ptr<SpeakRequest> CommandPtr; namespace { const uint32_t kAppId = 10u; const uint32_t kConnectionKey = 5u; -} +} // namespace class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { public: @@ -295,7 +295,7 @@ TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))); + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)); command->Run(); } @@ -315,7 +315,7 @@ TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) { EXPECT_CALL( mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak))); + ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak), _)); command->Run(); } @@ -402,5 +402,5 @@ TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) { } // namespace speak_request } // namespace mobile_commands_test } // namespace commands_test -} // namespace component +} // namespace components } // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc index caca56e297..01f8f313b6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc @@ -35,16 +35,16 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" -#include "mobile/subscribe_button_request.h" -#include "interfaces/MOBILE_API.h" #include "application_manager/smart_object_keys.h" +#include "interfaces/MOBILE_API.h" +#include "mobile/subscribe_button_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -53,13 +53,13 @@ namespace mobile_commands_test { namespace subscribe_button_request { using ::testing::_; +using ::testing::DoAll; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::DoAll; using ::testing::SaveArg; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::SubscribeButtonRequest; using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::SubscribeButtonRequest; typedef std::shared_ptr<SubscribeButtonRequest> CommandPtr; @@ -182,7 +182,7 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) { MessageSharedPtr hmi_result_msg; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true))); MessageSharedPtr mobile_result_msg; @@ -199,7 +199,8 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) { EXPECT_EQ(mobile_apis::Result::SUCCESS, static_cast<mobile_apis::Result::eType>( (*mobile_result_msg)[am::strings::msg_params] - [am::strings::result_code].asInt())); + [am::strings::result_code] + .asInt())); } TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) { @@ -230,7 +231,7 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) { MessageSharedPtr hmi_result_msg; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&hmi_result_msg), Return(true))); MessageSharedPtr mobile_result_msg; @@ -252,7 +253,8 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS_App_Base_RPC_Version) { EXPECT_EQ(mobile_apis::Result::SUCCESS, static_cast<mobile_apis::Result::eType>( (*mobile_result_msg)[am::strings::msg_params] - [am::strings::result_code].asInt())); + [am::strings::result_code] + .asInt())); } } // namespace subscribe_button_request diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc index d08c13b3f3..56e4e05d48 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc @@ -32,17 +32,17 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_message_helper.h" -#include "mobile/subscribe_way_points_request.h" -#include "interfaces/MOBILE_API.h" #include "application_manager/smart_object_keys.h" +#include "interfaces/MOBILE_API.h" +#include "mobile/subscribe_way_points_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -52,14 +52,14 @@ namespace subscribe_way_points_request { using ::testing::_; using ::testing::A; +using ::testing::DoAll; +using ::testing::InSequence; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::DoAll; using ::testing::SaveArg; -using ::testing::InSequence; namespace am = ::application_manager; -using sdl_rpc_plugin::commands::SubscribeWayPointsRequest; using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::SubscribeWayPointsRequest; typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr; @@ -90,7 +90,8 @@ TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) { EXPECT_EQ(mobile_apis::Result::SUCCESS, static_cast<mobile_apis::Result::eType>( (*mobile_result_msg)[am::strings::msg_params] - [am::strings::result_code].asInt())); + [am::strings::result_code] + .asInt())); } TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc index 9e6bc8f505..7351cd67d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc @@ -31,18 +31,18 @@ */ #include <stdint.h> -#include <string> #include <set> +#include <string> #include "gtest/gtest.h" -#include "mobile/system_request.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_hmi_interface.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "mobile/system_request.h" namespace test { namespace components { @@ -51,13 +51,13 @@ namespace mobile_commands_test { namespace system_request { namespace am = application_manager; -using sdl_rpc_plugin::commands::SystemRequest; +using am::MessageType; +using am::MockHmiInterfaces; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; -using am::MockHmiInterfaces; using am::event_engine::Event; -using am::MessageType; using policy_test::MockPolicyHandlerInterface; +using sdl_rpc_plugin::commands::SystemRequest; using ::testing::_; using ::testing::DoAll; @@ -160,7 +160,7 @@ TEST_F(SystemRequestTest, .WillOnce(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObjectSPtr result; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg)); @@ -201,7 +201,7 @@ TEST_F( .WillOnce(Return(false)); ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg)); ASSERT_TRUE(command->Init()); @@ -222,7 +222,38 @@ TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) { .WillOnce(Return(false)); ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); + + std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg)); + ASSERT_TRUE(command->Init()); + command->Run(); +} + +TEST_F(SystemRequestTest, Run_RequestType_IconURL_Success) { + PreConditions(); + MessageSharedPtr msg = CreateIVSUMessage(); + (*msg)[am::strings::msg_params][am::strings::request_type] = + mobile_apis::RequestType::ICON_URL; + + const std::string url = "https://www.appsfakeiconurlendpoint.com/icon.png"; + + (*msg)[am::strings::msg_params][am::strings::file_name] = url; + const std::vector<uint8_t> binary_data = {1u, 2u}; + (*msg)[am::strings::params][am::strings::binary_data] = binary_data; + + EXPECT_CALL( + mock_policy_handler_, + IsRequestTypeAllowed(kAppPolicyId, mobile_apis::RequestType::ICON_URL)) + .WillOnce(Return(true)); + EXPECT_CALL(app_mngr_settings_, app_icons_folder()) + .WillOnce(ReturnRef(kAppStorageFolder)); + EXPECT_CALL(app_mngr_, PolicyIDByIconUrl(url)).WillOnce(Return(kAppPolicyId)); + + EXPECT_CALL(app_mngr_, + SaveBinary(binary_data, kAppStorageFolder, kAppPolicyId, 0u)) + .WillOnce(Return(mobile_apis::Result::SUCCESS)); + + EXPECT_CALL(app_mngr_, SetIconFileFromSystemRequest(kAppPolicyId)).Times(1); std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg)); ASSERT_TRUE(command->Init()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc index 771374348b..f244acb8d6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc @@ -51,8 +51,8 @@ namespace mobile_result = mobile_apis::Result; using ::testing::_; -using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest; using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest; typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc index a848fff2b2..98d20dbbc4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc @@ -5,8 +5,8 @@ #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_message_helper.h" #include "mobile/unsubscribe_button_request.h" namespace test { @@ -20,8 +20,8 @@ namespace mobile_result = mobile_apis::Result; using ::testing::_; -using sdl_rpc_plugin::commands::UnsubscribeButtonRequest; using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::UnsubscribeButtonRequest; typedef std::shared_ptr<UnsubscribeButtonRequest> CommandPtr; @@ -139,9 +139,11 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) { EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Buttons_OnButtonSubscription))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription), + _)); EXPECT_CALL( mock_rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); @@ -182,9 +184,11 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS_Base_RPC_Version) { EXPECT_CALL(*mock_app, UnsubscribeFromButton(mobile_apis::ButtonName::PLAY_PAUSE)) .WillOnce(Return(true)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Buttons_OnButtonSubscription))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::Buttons_OnButtonSubscription), + _)); EXPECT_CALL( mock_rpc_service_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc index f345d719c6..3165d57d44 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc @@ -34,18 +34,18 @@ #include <string> #include "gtest/gtest.h" -#include "mobile/unsubscribe_way_points_request.h" #include "interfaces/MOBILE_API.h" +#include "mobile/unsubscribe_way_points_request.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/event_engine/event.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -59,8 +59,8 @@ namespace mobile_result = mobile_apis::Result; using ::testing::_; using ::testing::Return; -using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest; using am::commands::MessageSharedPtr; +using sdl_rpc_plugin::commands::UnsubscribeWayPointsRequest; namespace { const uint32_t kConnectionKey = 3u; @@ -122,9 +122,16 @@ TEST_F(UnsubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) { ::testing::Matcher<am::ApplicationSharedPtr>(mock_app))) .WillOnce(Return(true)); + const std::set<uint32_t> subscribed_apps{kConnectionKey}; + + EXPECT_CALL(app_mngr_, GetAppsSubscribedForWayPoints()) + .WillOnce(Return(subscribed_apps)); + EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints))); + ManageHMICommand( + HMIResultCodeIs( + hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints), + _)); command_->Run(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc index 78fca8681a..44628a8e89 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc @@ -34,20 +34,20 @@ #include <string> #include "gtest/gtest.h" -#include "mobile/update_turn_list_request.h" #include "interfaces/MOBILE_API.h" +#include "mobile/update_turn_list_request.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" -#include "application_manager/mock_message_helper.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/event_engine/event.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -59,14 +59,14 @@ namespace am = ::application_manager; namespace mobile_result = mobile_apis::Result; using ::testing::_; +using ::testing::Eq; +using ::testing::Ref; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::Ref; -using ::testing::Eq; -using sdl_rpc_plugin::commands::UpdateTurnListRequest; using am::commands::MessageSharedPtr; using application_manager_test::MockHMICapabilities; +using sdl_rpc_plugin::commands::UpdateTurnListRequest; namespace { const uint32_t kConnectionKey = 3u; @@ -208,7 +208,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) { (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0] [am::strings::turn_icon], Eq(mock_app), - Ref(app_mngr_))).WillOnce(Return(mobile_result::SUCCESS)); + Ref(app_mngr_))) + .WillOnce(Return(mobile_result::SUCCESS)); EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, kFunctionId)); @@ -223,8 +224,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) { .keyExists(am::hmi_request::navi_text)); EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0] - [am::hmi_request::navi_text].keyExists( - am::hmi_request::field_name)); + [am::hmi_request::navi_text] + .keyExists(am::hmi_request::field_name)); EXPECT_EQ( hmi_apis::Common_TextFieldName::turnText, (*result_msg)[am::strings::msg_params][am::strings::turn_list][0] @@ -232,8 +233,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) { .asInt()); EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0] - [am::hmi_request::navi_text].keyExists( - am::hmi_request::field_text)); + [am::hmi_request::navi_text] + .keyExists(am::hmi_request::field_text)); EXPECT_EQ( kNavigationText, (*result_msg)[am::strings::msg_params][am::strings::turn_list][0] @@ -268,7 +269,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) { (*command_msg_)[am::strings::msg_params][am::strings::turn_list][0] [am::strings::turn_icon], Eq(mock_app), - Ref(app_mngr_))).WillOnce(Return(mobile_result::WARNINGS)); + Ref(app_mngr_))) + .WillOnce(Return(mobile_result::WARNINGS)); EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, kFunctionId)); @@ -283,8 +285,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) { .keyExists(am::hmi_request::navi_text)); EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0] - [am::hmi_request::navi_text].keyExists( - am::hmi_request::field_name)); + [am::hmi_request::navi_text] + .keyExists(am::hmi_request::field_name)); EXPECT_EQ( hmi_apis::Common_TextFieldName::turnText, (*result_msg)[am::strings::msg_params][am::strings::turn_list][0] @@ -292,8 +294,8 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_WARNINGS) { .asInt()); EXPECT_TRUE((*result_msg)[am::strings::msg_params][am::strings::turn_list][0] - [am::hmi_request::navi_text].keyExists( - am::hmi_request::field_text)); + [am::hmi_request::navi_text] + .keyExists(am::hmi_request::field_text)); EXPECT_EQ( kNavigationText, (*result_msg)[am::strings::msg_params][am::strings::turn_list][0] diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h index 1fb9c0a008..103bfb56dc 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/on_vi_vehicle_data_notification.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_ -#include "application_manager/commands/notification_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/notification_from_hmi.h" namespace vehicle_info_plugin { namespace app_mngr = application_manager; @@ -76,6 +76,6 @@ class OnVIVehicleDataNotification } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_VI_VEHICLE_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h index 0b0a9ef99e..162a6b338a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_request.h @@ -73,6 +73,6 @@ class VIDiagnosticMessageRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h index 31fc73897e..a427bbe362 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_diagnostic_message_response.h @@ -73,6 +73,6 @@ class VIDiagnosticMessageResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_DIAGNOSTIC_MESSAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h index 67308a3898..df9e84eab4 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_request.h @@ -72,6 +72,6 @@ class VIGetDTCsRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h index 0ddf225c93..d8351c1a61 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h @@ -72,6 +72,6 @@ class VIGetDTCsResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_DTCS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h index 1b4669cf24..437e7c8933 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h @@ -72,6 +72,6 @@ class VIGetVehicleDataRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h index df5e630aea..651a0af79c 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_ -#include "application_manager/commands/response_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/response_from_hmi.h" namespace vehicle_info_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class VIGetVehicleDataResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h index 79a5270f8d..1166d3f774 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h @@ -72,6 +72,6 @@ class VIGetVehicleTypeRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h index baa4a936ae..00c1944c0f 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h @@ -73,6 +73,6 @@ class VIGetVehicleTypeResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_GET_VEHICLE_TYPE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h index 3f12a30c8d..7a8ca3a4b6 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_request.h @@ -88,6 +88,6 @@ class VIIsReadyRequest : public app_mngr::commands::RequestToHMI, } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h index 3531aa03c4..e0ff20b8bb 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_is_ready_response.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_ -#include "application_manager/commands/response_from_hmi.h" #include "application_manager/application_manager.h" +#include "application_manager/commands/response_from_hmi.h" namespace vehicle_info_plugin { namespace app_mngr = application_manager; @@ -73,6 +73,6 @@ class VIIsReadyResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_IS_READY_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h index 2d10bbf11d..1e91a4c3af 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_request.h @@ -72,6 +72,6 @@ class VIReadDIDRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h index 5ac655b499..f659f7ae87 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_read_did_response.h @@ -72,6 +72,6 @@ class VIReadDIDResponse : public app_mngr::commands::ResponseFromHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_READ_DID_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h index bd22a313e7..dab5989e9e 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_request.h @@ -73,6 +73,6 @@ class VISubscribeVehicleDataRequest : public app_mngr::commands::RequestToHMI { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h index 1148a8b41a..8eea8d0cfa 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h @@ -74,6 +74,6 @@ class VISubscribeVehicleDataResponse } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h index 3b39835fbf..a8ebf34ea2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h @@ -74,6 +74,6 @@ class VIUnsubscribeVehicleDataRequest } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h index ada6896520..780d1e9eae 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h @@ -74,6 +74,6 @@ class VIUnsubscribeVehicleDataResponse } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h index e2bc7c4dfd..bd9ce31325 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_request.h @@ -80,6 +80,6 @@ class DiagnosticMessageRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h index d69a6a0155..7b6364fe41 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/diagnostic_message_response.h @@ -74,6 +74,6 @@ class DiagnosticMessageResponse }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h index 01f007697d..9175900610 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_request.h @@ -80,6 +80,6 @@ class GetDTCsRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h index 87024b1860..473174fd0d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_dtcs_response.h @@ -73,6 +73,6 @@ class GetDTCsResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h index 04a131da8f..ff04ca1e2c 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h @@ -77,6 +77,6 @@ class GetVehicleDataRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h index 22ec1a5a78..25fd27b67c 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/get_vehicle_data_response.h @@ -73,6 +73,6 @@ class GetVehicleDataResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h index 57c30164e4..ce1b732775 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_ -#include "application_manager/commands/command_notification_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_notification_impl.h" #include "utils/macro.h" namespace vehicle_info_plugin { @@ -83,6 +83,6 @@ class OnVehicleDataNotification }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h index 9a8fbbd62e..d006cf02ef 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_request.h @@ -80,6 +80,6 @@ class ReadDIDRequest : public app_mngr::commands::CommandRequestImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h index 2b7ab04768..d3c0e14c93 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/read_did_response.h @@ -73,6 +73,6 @@ class ReadDIDResponse : public app_mngr::commands::CommandResponseImpl { }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_READ_DID_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h index 7c6e1754da..2671173ba3 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_request.h @@ -37,8 +37,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_ -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" #include "vehicle_info_plugin/vehicle_info_app_extension.h" @@ -153,6 +153,6 @@ class SubscribeVehicleDataRequest }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h index 60670afee1..2212af0846 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h @@ -75,6 +75,6 @@ class SubscribeVehicleDataResponse }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_SUBSCRIBE_VEHICLE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h index e04d1fb97a..b246dbc9ef 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_request.h @@ -34,8 +34,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_ -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" #include "vehicle_info_plugin/vehicle_info_app_extension.h" @@ -115,6 +115,6 @@ class UnsubscribeVehicleDataRequest }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h index 397ae3cbce..67f09a68a8 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/commands/mobile/unsubscribe_vehicle_data_response.h @@ -75,6 +75,6 @@ class UnsubscribeVehicleDataResponse }; } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_MOBILE_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h index ead6af841f..b3ba768b1b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_app_extension.h @@ -61,11 +61,11 @@ class VehicleInfoAppExtension : public app_mngr::AppExtension { virtual ~VehicleInfoAppExtension(); /** - * @brief subscribeToVehicleInfo add vehicle_data to list of subscriptions of - * application extension - * @param vehicle_data data to subscribe - * @return true in case if subscription is successful - */ + * @brief subscribeToVehicleInfo add vehicle_data to list of subscriptions of + * application extension + * @param vehicle_data data to subscribe + * @return true in case if subscription is successful + */ bool subscribeToVehicleInfo(const VehicleDataType vehicle_data); /** @@ -130,6 +130,6 @@ class VehicleInfoAppExtension : public app_mngr::AppExtension { VehicleInfoPlugin& plugin_; app_mngr::Application& app_; }; -} +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_APP_EXTENSION_H diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h index e36611dfa6..58100ba1ae 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_command_factory.h @@ -65,6 +65,6 @@ class VehicleInfoCommandFactory : public app_mngr::CommandFactory { std::unique_ptr<app_mngr::CommandFactory> hmi_command_factory_; std::unique_ptr<app_mngr::CommandFactory> mob_command_factory_; }; -} +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h index 412949eedb..c927f3f2bb 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_hmi_command_factory.h @@ -68,6 +68,6 @@ class VehicleInfoHmiCommandFactory : public app_mngr::CommandFactory { DISALLOW_COPY_AND_ASSIGN(VehicleInfoHmiCommandFactory); }; -} +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h index 6cfc77a41c..41bd355852 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_mobile_command_factory.h @@ -63,11 +63,18 @@ class VehicleInfoMobileCommandFactory : public app_mngr::CommandFactory { app_mngr::HMICapabilities& hmi_capabilities_; policy::PolicyHandlerInterface& policy_handler_; - app_mngr::CommandCreator& buildCommandCreator( - const int32_t function_id, const int32_t message_type) const; + app_mngr::CommandCreator& get_creator_factory( + const mobile_apis::FunctionID::eType function_id, + const mobile_apis::messageType::eType message_type, + const app_mngr::commands::Command::CommandSource source) const; + app_mngr::CommandCreator& get_command_creator( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type) const; + app_mngr::CommandCreator& get_notification_creator( + const mobile_apis::FunctionID::eType id) const; DISALLOW_COPY_AND_ASSIGN(VehicleInfoMobileCommandFactory); }; -} +} // namespace vehicle_info_plugin #endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_MOBILE_COMMAND_FACTORY_H diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h index b15b7006e6..d0e4926a65 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/include/vehicle_info_plugin/vehicle_info_plugin.h @@ -75,7 +75,7 @@ class VehicleInfoPlugin : public plugins::RPCPlugin { std::unique_ptr<app_mngr::CommandFactory> command_factory_; app_mngr::ApplicationManager* application_manager_; }; -} +} // namespace vehicle_info_plugin extern "C" application_manager::plugin_manager::RPCPlugin* Create(); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc index 6125c4ee45..23dd3da879 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/on_vi_vehicle_data_notification.cc @@ -72,4 +72,4 @@ void OnVIVehicleDataNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc index 8d3b9f13fb..97d035a20b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_request.cc @@ -59,4 +59,4 @@ void VIDiagnosticMessageRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc index e22ba7ddb2..f4079fc6fd 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_diagnostic_message_response.cc @@ -63,4 +63,4 @@ void VIDiagnosticMessageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc index 71ce6331ab..d67d0909a9 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_request.cc @@ -59,4 +59,4 @@ void VIGetDTCsRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc index 9d39c60796..494e779c4d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_dtcs_response.cc @@ -62,4 +62,4 @@ void VIGetDTCsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc index 9fc48c8820..e2c1ed4e3a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_request.cc @@ -59,4 +59,4 @@ void VIGetVehicleDataRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc index 73ba1a94fe..a4b778a487 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_data_response.cc @@ -86,4 +86,4 @@ void VIGetVehicleDataResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc index a1a221220a..96d27a120b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_request.cc @@ -59,4 +59,4 @@ void VIGetVehicleTypeRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc index 9f14b4e7ea..add55f9a40 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_get_vehicle_type_response.cc @@ -61,4 +61,4 @@ void VIGetVehicleTypeResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc index 04bcc435ba..6479676094 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc @@ -31,8 +31,8 @@ */ #include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h" -#include "application_manager/rpc_service.h" #include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" namespace vehicle_info_plugin { using namespace application_manager; @@ -109,4 +109,4 @@ void VIIsReadyRequest::SendMessageToHMI() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc index 35907e11d2..0db30afb87 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_response.cc @@ -59,4 +59,4 @@ void VIIsReadyResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc index b55c9e32a0..fbcc59849d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_request.cc @@ -59,4 +59,4 @@ void VIReadDIDRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc index 9d56b2aa78..0b8d0f3055 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_read_did_response.cc @@ -61,4 +61,4 @@ void VIReadDIDResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc index 60e9dc88c3..84e41a26dc 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_request.cc @@ -59,4 +59,4 @@ void VISubscribeVehicleDataRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc index f004d6f3cd..25d876a125 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_subscribe_vehicle_data_response.cc @@ -60,4 +60,4 @@ void VISubscribeVehicleDataResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc index 9056538514..50565e95d2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc @@ -59,4 +59,4 @@ void VIUnsubscribeVehicleDataRequest::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc index 348bc1b269..722073edc7 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc @@ -60,4 +60,4 @@ void VIUnsubscribeVehicleDataResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc index 4eba894025..a1dfe1e936 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_request.cc @@ -31,13 +31,13 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h" +#include <algorithm> #include "application_manager/application_impl.h" -#include "interfaces/HMI_API.h" #include "application_manager/message_helper.h" +#include "interfaces/HMI_API.h" namespace vehicle_info_plugin { using namespace application_manager; @@ -127,4 +127,4 @@ void DiagnosticMessageRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc index 54d8382f5d..f5ad1c89a2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/diagnostic_message_response.cc @@ -61,4 +61,4 @@ void DiagnosticMessageResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc index 6c04e874e8..af941e3ea7 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_request.cc @@ -34,8 +34,8 @@ #include "vehicle_info_plugin/commands/mobile/get_dtcs_request.h" #include "application_manager/application_impl.h" -#include "interfaces/HMI_API.h" #include "application_manager/message_helper.h" +#include "interfaces/HMI_API.h" namespace vehicle_info_plugin { using namespace application_manager; @@ -116,4 +116,4 @@ void GetDTCsRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc index 3686094b73..894c564a0b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_dtcs_response.cc @@ -61,4 +61,4 @@ void GetDTCsResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc index 87a9ace377..8d762e30e5 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_request.cc @@ -31,13 +31,13 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include "vehicle_info_plugin/commands/mobile/get_vehicle_data_request.h" +#include <string> #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace vehicle_info_plugin { using namespace application_manager; @@ -144,4 +144,4 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc index 3a7d663756..f634915354 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/get_vehicle_data_response.cc @@ -62,4 +62,4 @@ void GetVehicleDataResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc index f8553c84f8..7d34bbbe37 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/on_vehicle_data_notification.cc @@ -34,11 +34,11 @@ #include "vehicle_info_plugin/commands/mobile/on_vehicle_data_notification.h" #include "application_manager/application_impl.h" +#include "application_manager/helpers/application_helper.h" #include "application_manager/message_helper.h" #include "interfaces/MOBILE_API.h" -#include "vehicle_info_plugin/vehicle_info_app_extension.h" -#include "application_manager/helpers/application_helper.h" #include "utils/macro.h" +#include "vehicle_info_plugin/vehicle_info_app_extension.h" namespace vehicle_info_plugin { using namespace application_manager; @@ -72,7 +72,7 @@ void OnVehicleDataNotification::Run() { for (; vehicle_data.end() != it; ++it) { if (true == (*message_)[strings::msg_params].keyExists(it->first)) { - LOG4CXX_ERROR(logger_, "vehicle_data nanme" << it->first); + LOG4CXX_DEBUG(logger_, "vehicle_data name" << it->first); auto vehicle_data_value = (*message_)[strings::msg_params][it->first].asInt(); @@ -133,4 +133,4 @@ void OnVehicleDataNotification::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc index 010cce4c63..ed83f53516 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_request.cc @@ -30,13 +30,13 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include "vehicle_info_plugin/commands/mobile/read_did_request.h" +#include <string> #include "application_manager/application_impl.h" -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" #include "application_manager/message_helper.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" namespace vehicle_info_plugin { using namespace application_manager; @@ -131,4 +131,4 @@ void ReadDIDRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc index 82d49574f0..f0b9e3097a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/read_did_response.cc @@ -61,4 +61,4 @@ void ReadDIDResponse::Run() { } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc index 65f4fde0b2..815ffeb3d2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -325,9 +325,8 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions( } const bool is_everything_already_subscribed = - items_to_subscribe == - vi_already_subscribed_by_another_apps_.size() + - vi_already_subscribed_by_this_app_.size(); + items_to_subscribe == vi_already_subscribed_by_another_apps_.size() + + vi_already_subscribed_by_this_app_.size(); if (0 == items_to_subscribe) { if (HasDisallowedParams()) { @@ -357,4 +356,4 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions( } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc index 2bea839320..b0d09e1a5b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_response.cc @@ -32,8 +32,8 @@ */ #include "vehicle_info_plugin/commands/mobile/subscribe_vehicle_data_response.h" -#include "application_manager/rpc_service.h" #include "application_manager/application_impl.h" +#include "application_manager/rpc_service.h" #include "interfaces/MOBILE_API.h" namespace vehicle_info_plugin { @@ -60,4 +60,4 @@ void SubscribeVehicleDataResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc index d0152ea0c3..40bd9182e7 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -36,9 +36,9 @@ #include "application_manager/application_impl.h" #include "application_manager/message_helper.h" -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" #include "application_manager/smart_object_keys.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" #include "utils/helpers.h" #include "vehicle_info_plugin/vehicle_info_app_extension.h" @@ -284,4 +284,4 @@ void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI( } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc index 5f79785784..a4a486a5e7 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_response.cc @@ -67,4 +67,4 @@ void UnsubscribeVehicleDataResponse::Run() { } } // namespace commands -} // namespace application_manager +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc index 3b1d411841..730812e9c8 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc @@ -122,4 +122,4 @@ VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension( DCHECK(vi_app_extension); return *vi_app_extension; } -} +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc index 32959174da..617925589f 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_command_factory.cc @@ -53,7 +53,8 @@ VehicleInfoCommandFactory::~VehicleInfoCommandFactory() {} app_mngr::CommandSharedPtr VehicleInfoCommandFactory::CreateCommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { - if (app_mngr::commands::Command::SOURCE_HMI == source) { + if (app_mngr::commands::Command::SOURCE_HMI == source || + app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) { return hmi_command_factory_->CreateCommand(message, source); } else { return mob_command_factory_->CreateCommand(message, source); @@ -63,8 +64,9 @@ app_mngr::CommandSharedPtr VehicleInfoCommandFactory::CreateCommand( bool VehicleInfoCommandFactory::IsAbleToProcess( const int32_t function_id, const commands::Command::CommandSource source) const { - return commands::Command::SOURCE_HMI == source + return (commands::Command::SOURCE_HMI == source || + app_mngr::commands::Command::SOURCE_SDL_TO_HMI == source) ? hmi_command_factory_->IsAbleToProcess(function_id, source) : mob_command_factory_->IsAbleToProcess(function_id, source); } -} +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc index 9311cea6d7..dd3b43920a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc @@ -41,6 +41,8 @@ #include "vehicle_info_plugin/commands/hmi/vi_get_dtcs_response.h" #include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_request.h" #include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_data_response.h" +#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h" +#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h" #include "vehicle_info_plugin/commands/hmi/vi_is_ready_request.h" #include "vehicle_info_plugin/commands/hmi/vi_is_ready_response.h" #include "vehicle_info_plugin/commands/hmi/vi_read_did_request.h" @@ -49,8 +51,6 @@ #include "vehicle_info_plugin/commands/hmi/vi_subscribe_vehicle_data_response.h" #include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_request.h" #include "vehicle_info_plugin/commands/hmi/vi_unsubscribe_vehicle_data_response.h" -#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_request.h" -#include "vehicle_info_plugin/commands/hmi/vi_get_vehicle_type_response.h" CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") @@ -153,4 +153,4 @@ app_mngr::CommandCreator& VehicleInfoHmiCommandFactory::buildCommandCreator( return factory.GetCreator<app_mngr::InvalidCommand>(); } } -} +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc index 7600afa091..dffc836a89 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc @@ -69,8 +69,6 @@ VehicleInfoMobileCommandFactory::VehicleInfoMobileCommandFactory( app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::commands::Command::CommandSource source) { - UNUSED(source); - const mobile_apis::FunctionID::eType function_id = static_cast<mobile_apis::FunctionID::eType>( (*message)[strings::params][strings::function_id].asInt()); @@ -91,54 +89,102 @@ app_mngr::CommandSharedPtr VehicleInfoMobileCommandFactory::CreateCommand( "HMICommandFactory::CreateCommand function_id: " << function_id << ", message type: " << message_type_str); - return buildCommandCreator(function_id, message_type).create(message); + return get_creator_factory(function_id, message_type, source).create(message); } bool VehicleInfoMobileCommandFactory::IsAbleToProcess( const int32_t function_id, const app_mngr::commands::Command::CommandSource source) const { UNUSED(source); - return buildCommandCreator(function_id, - mobile_apis::messageType::INVALID_ENUM) - .CanBeCreated(); + auto id = static_cast<mobile_apis::FunctionID::eType>(function_id); + return get_command_creator(id, mobile_apis::messageType::INVALID_ENUM) + .CanBeCreated() || + get_notification_creator(id).CanBeCreated(); } -app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::buildCommandCreator( - const int32_t function_id, const int32_t message_type) const { +app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::get_command_creator( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type) const { auto factory = app_mngr::CommandCreatorFactory( application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); - - switch (function_id) { - case mobile_apis::FunctionID::GetVehicleDataID: + switch (id) { + case mobile_apis::FunctionID::GetVehicleDataID: { return mobile_apis::messageType::request == message_type ? factory.GetCreator<commands::GetVehicleDataRequest>() : factory.GetCreator<commands::GetVehicleDataResponse>(); - case mobile_apis::FunctionID::SubscribeVehicleDataID: + } + case mobile_apis::FunctionID::SubscribeVehicleDataID: { return mobile_apis::messageType::request == message_type ? factory.GetCreator<commands::SubscribeVehicleDataRequest>() : factory.GetCreator<commands::SubscribeVehicleDataResponse>(); - case mobile_apis::FunctionID::UnsubscribeVehicleDataID: + } + case mobile_apis::FunctionID::UnsubscribeVehicleDataID: { return mobile_apis::messageType::request == message_type ? factory.GetCreator<commands::UnsubscribeVehicleDataRequest>() : factory .GetCreator<commands::UnsubscribeVehicleDataResponse>(); - case mobile_apis::FunctionID::OnVehicleDataID: - return factory.GetCreator<commands::OnVehicleDataNotification>(); - case mobile_apis::FunctionID::ReadDIDID: + } + case mobile_apis::FunctionID::ReadDIDID: { return mobile_apis::messageType::request == message_type ? factory.GetCreator<commands::ReadDIDRequest>() : factory.GetCreator<commands::ReadDIDResponse>(); - case mobile_apis::FunctionID::GetDTCsID: + } + case mobile_apis::FunctionID::GetDTCsID: { return mobile_apis::messageType::request == message_type ? factory.GetCreator<commands::GetDTCsRequest>() : factory.GetCreator<commands::GetDTCsResponse>(); - case mobile_apis::FunctionID::DiagnosticMessageID: + } + case mobile_apis::FunctionID::DiagnosticMessageID: { return mobile_apis::messageType::request == message_type ? factory.GetCreator<commands::DiagnosticMessageRequest>() : factory.GetCreator<commands::DiagnosticMessageResponse>(); - default: - LOG4CXX_WARN(logger_, "Unsupported function_id: " << function_id); - return factory.GetCreator<app_mngr::InvalidCommand>(); + } + default: {} } + return factory.GetCreator<app_mngr::InvalidCommand>(); } + +app_mngr::CommandCreator& +VehicleInfoMobileCommandFactory::get_notification_creator( + const mobile_apis::FunctionID::eType id) const { + auto factory = app_mngr::CommandCreatorFactory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + switch (id) { + case mobile_apis::FunctionID::OnVehicleDataID: { + return factory.GetCreator<commands::OnVehicleDataNotification>(); + } + default: {} + } + return factory.GetCreator<app_mngr::InvalidCommand>(); +} + +app_mngr::CommandCreator& VehicleInfoMobileCommandFactory::get_creator_factory( + const mobile_apis::FunctionID::eType id, + const mobile_apis::messageType::eType message_type, + const app_mngr::commands::Command::CommandSource source) const { + switch (message_type) { + case mobile_apis::messageType::request: { + if (app_mngr::commands::Command::CommandSource::SOURCE_MOBILE == source) { + return get_command_creator(id, message_type); + } + break; + } + case mobile_apis::messageType::response: { + if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) { + return get_command_creator(id, message_type); + } + break; + } + case mobile_apis::messageType::notification: { + if (app_mngr::commands::Command::CommandSource::SOURCE_SDL == source) { + return get_notification_creator(id); + } + break; + } + default: {} + } + auto factory = app_mngr::CommandCreatorFactory( + application_manager_, rpc_service_, hmi_capabilities_, policy_handler_); + return factory.GetCreator<app_mngr::InvalidCommand>(); } +} // namespace vehicle_info_plugin diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc index d0bcc36ab4..70210f704e 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc @@ -31,16 +31,17 @@ */ #include "vehicle_info_plugin/vehicle_info_plugin.h" -#include "vehicle_info_plugin/vehicle_info_command_factory.h" -#include "vehicle_info_plugin/vehicle_info_app_extension.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/message_helper.h" #include "application_manager/message_helper.h" +#include "application_manager/plugin_manager/plugin_keys.h" +#include "application_manager/smart_object_keys.h" +#include "vehicle_info_plugin/vehicle_info_app_extension.h" +#include "vehicle_info_plugin/vehicle_info_command_factory.h" namespace vehicle_info_plugin { CREATE_LOGGERPTR_GLOBAL(logger_, "VehicleInfoPlugin") namespace strings = application_manager::strings; +namespace plugins = application_manager::plugin_manager; VehicleInfoPlugin::VehicleInfoPlugin() : application_manager_(nullptr) {} @@ -61,7 +62,7 @@ bool VehicleInfoPlugin::IsAbleToProcess( } std::string VehicleInfoPlugin::PluginName() { - return "Vehicle Info Plugin"; + return plugins::plugin_names::vehicle_info_rpc_plugin; } app_mngr::CommandFactory& VehicleInfoPlugin::GetCommandFactory() { @@ -160,7 +161,7 @@ void VehicleInfoPlugin::DeleteSubscriptions( } } } -} +} // namespace vehicle_info_plugin extern "C" application_manager::plugin_manager::RPCPlugin* Create() { return new vehicle_info_plugin::VehicleInfoPlugin(); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc index 0508f0cdd6..575df4ce50 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc @@ -36,17 +36,17 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/application.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/message_helper.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/event_engine/event.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" #include "hmi/vi_get_vehicle_data_response.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -61,9 +61,9 @@ namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; using am::commands::MessageSharedPtr; -using vehicle_info_plugin::commands::VIGetVehicleDataResponse; using am::event_engine::Event; using test::components::event_engine_test::MockEventDispatcher; +using vehicle_info_plugin::commands::VIGetVehicleDataResponse; typedef std::shared_ptr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc index d4477d5d5f..8c77b492ee 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc @@ -34,16 +34,16 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/event_engine/event.h" #include "application_manager/hmi_interfaces.h" -#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_message_helper.h" -#include "application_manager/event_engine/event.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -52,12 +52,12 @@ namespace hmi_commands_test { namespace vi_is_ready_request { using ::testing::_; -using ::testing::ReturnRef; using ::testing::Return; +using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using vehicle_info_plugin::commands::VIIsReadyRequest; using am::event_engine::Event; +using vehicle_info_plugin::commands::VIIsReadyRequest; typedef std::shared_ptr<VIIsReadyRequest> VIIsReadyRequestPtr; @@ -101,7 +101,7 @@ class VIIsReadyRequestTest mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _)) .WillOnce(Return(ivi_type)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(ivi_type)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(ivi_type, _)); } void PrepareEvent(bool is_message_contain_param, diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc index 9cdf60b1ea..3763e033fc 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc @@ -36,16 +36,16 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" #include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" #include "vehicle_info_plugin/commands/mobile/diagnostic_message_request.h" namespace test { @@ -59,8 +59,8 @@ using ::testing::Return; using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using vehicle_info_plugin::commands::DiagnosticMessageRequest; using am::event_engine::Event; +using vehicle_info_plugin::commands::DiagnosticMessageRequest; namespace mobile_result = mobile_apis::Result; typedef std::shared_ptr<DiagnosticMessageRequest> DiagnosticMessageRequestPtr; @@ -141,9 +141,11 @@ TEST_F(DiagnosticMessageRequestTest, Run_SUCCESS) { EXPECT_CALL(app_mngr_settings_, supported_diag_modes()) .WillOnce(ReturnRef(supported_diag_modes)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage), + _)); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc index 4473a36c63..1575fe2bd8 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc @@ -36,17 +36,17 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_application.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/event_engine/event.h" -#include "mobile/get_dtcs_request.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" #include "interfaces/MOBILE_API.h" +#include "mobile/get_dtcs_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -57,11 +57,11 @@ namespace get_dtcs_request { using ::testing::_; using ::testing::Return; namespace am = ::application_manager; +using am::MockMessageHelper; using am::commands::MessageSharedPtr; -using vehicle_info_plugin::commands::GetDTCsRequest; using am::event_engine::Event; -using am::MockMessageHelper; using testing::Mock; +using vehicle_info_plugin::commands::GetDTCsRequest; namespace mobile_result = mobile_apis::Result; typedef std::shared_ptr<GetDTCsRequest> GetDTCsRequestPtr; @@ -98,9 +98,10 @@ TEST_F(GetDTCsRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand( - HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetDTCs), _)); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc index a88d362968..ed9fe9d1c0 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc @@ -36,17 +36,17 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/message_helper.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/event_engine/event.h" -#include "mobile/get_vehicle_data_request.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" #include "interfaces/MOBILE_API.h" +#include "mobile/get_vehicle_data_request.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -59,8 +59,8 @@ using ::testing::Return; using ::testing::ReturnRef; namespace am = ::application_manager; using am::commands::MessageSharedPtr; -using vehicle_info_plugin::commands::GetVehicleDataRequest; using am::event_engine::Event; +using vehicle_info_plugin::commands::GetVehicleDataRequest; namespace mobile_result = mobile_apis::Result; typedef std::shared_ptr<GetVehicleDataRequest> GetVehicleDataRequestPtr; @@ -200,9 +200,11 @@ TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app)); - EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::VehicleInfo_GetVehicleData))); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIResultCodeIs(hmi_apis::FunctionID::VehicleInfo_GetVehicleData), + _)); command->Run(); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc new file mode 100644 index 0000000000..fb14373bcf --- /dev/null +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "gtest/gtest.h" + +#include "application_manager/commands/commands_test.h" +#include "mobile/get_vehicle_data_response.h" +#include "smart_objects/smart_object.h" + +namespace test { +namespace components { +namespace commands_test { +namespace mobile_commands_test { +namespace get_vehicle_data_response { + +namespace am = ::application_manager; +using am::commands::MessageSharedPtr; +using vehicle_info_plugin::commands::GetVehicleDataResponse; + +typedef std::shared_ptr<GetVehicleDataResponse> GetVehicleDataResponsePtr; + +class GetVehicleDataResponseTest + : public CommandsTest<CommandsTestMocks::kIsNice> {}; + +TEST_F(GetVehicleDataResponseTest, GetVehicleDataResponse_SUCCESS) { + MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map)); + GetVehicleDataResponsePtr command( + CreateCommand<GetVehicleDataResponse>(message)); + + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _)); + command->Run(); +} + +} // namespace get_vehicle_data_response +} // namespace mobile_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc index 1e8a289637..8df00521de 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Ford Motor Company + * Copyright (c) 2019, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,21 +30,21 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <stdint.h> -#include <vector> -#include <map> +#include <strings.h> #include "gtest/gtest.h" #include "mobile/on_vehicle_data_notification.h" -#include "utils/custom_string.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/message_helper.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" #include "utils/helpers.h" +#include "vehicle_info_plugin/vehicle_info_app_extension.h" +#include "vehicle_info_plugin/vehicle_info_plugin.h" namespace test { namespace components { @@ -62,49 +62,75 @@ using am::commands::MessageSharedPtr; using vehicle_info_plugin::commands::OnVehicleDataNotification; typedef std::shared_ptr<OnVehicleDataNotification> NotificationPtr; +typedef std::shared_ptr<vehicle_info_plugin::VehicleInfoAppExtension> + VehicleInfoAppExtensionPtr; +typedef DataAccessor<application_manager::ApplicationSet> ApplicationSetDA; namespace { const uint32_t kAppId = 1u; +const utils::custom_string::CustomString kAppName("test_app"); } // namespace class OnVehicleDataNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> { public: - OnVehicleDataNotificationTest() - : command_msg_(CreateMessage(smart_objects::SmartType_Map)) - , command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {} + OnVehicleDataNotificationTest() : mock_app_(CreateMockApp()) {} + + protected: + void SetUp() OVERRIDE { + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId)); + ON_CALL(*mock_app_, name()).WillByDefault(ReturnRef(kAppName)); - MessageSharedPtr command_msg_; - NotificationPtr command_; + ON_CALL(mock_message_helper_, PrintSmartObject(_)) + .WillByDefault(Return(false)); + } + MockAppPtr mock_app_; }; -MATCHER_P2(CheckMessageData, key, value, "") { - const bool kIsMobileProtocolTypeCorrect = - (*arg)[am::strings::params][am::strings::protocol_type].asInt() == - am::commands::CommandImpl::mobile_protocol_type_; - - const bool kIsProtocolVersionCorrect = - (*arg)[am::strings::params][am::strings::protocol_version].asInt() == - am::commands::CommandImpl::protocol_version_; - - const bool kIsNotificationCorrect = - (*arg)[am::strings::params][am::strings::message_type].asInt() == - am::MessageType::kNotification; - - const bool kIsConnectionKeyCorrect = - (*arg)[am::strings::params][am::strings::connection_key].asUInt() == - kAppId; - - const bool kAreMsgParamsCorrect = - (*arg)[am::strings::msg_params][key].asInt() == value; - - using namespace helpers; - return Compare<bool, EQ, ALL>(true, - kIsMobileProtocolTypeCorrect, - kIsProtocolVersionCorrect, - kIsNotificationCorrect, - kIsConnectionKeyCorrect, - kAreMsgParamsCorrect); +TEST_F(OnVehicleDataNotificationTest, OnVehicleDataNotification_SUCCESS) { + MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map)); + smart_objects::SmartObject gps_data; + gps_data[am::strings::longitude_degrees] = 1.0; + gps_data[am::strings::latitude_degrees] = 1.0; + gps_data[am::strings::shifted] = true; + + (*message)[am::strings::msg_params][am::strings::gps] = gps_data; + (*message)[am::strings::msg_params][am::strings::speed] = 0; + + NotificationPtr command(CreateCommand<OnVehicleDataNotification>(message)); + + vehicle_info_plugin::VehicleInfoPlugin vi_plugin; + VehicleInfoAppExtensionPtr vi_app_extention_ptr = + std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>( + vi_plugin, *mock_app_); + vi_app_extention_ptr->subscribeToVehicleInfo( + mobile_apis::VehicleDataType::VEHICLEDATA_GPS); + vi_app_extention_ptr->subscribeToVehicleInfo( + mobile_apis::VehicleDataType::VEHICLEDATA_SPEED); + + EXPECT_CALL(*mock_app_, + QueryInterface(vehicle_info_plugin::VehicleInfoAppExtension:: + VehicleInfoAppExtensionUID)) + .WillOnce(Return(vi_app_extention_ptr)); + + application_manager::ApplicationSet apps; + apps.insert(mock_app_); + std::shared_ptr<sync_primitives::Lock> apps_lock = + std::make_shared<sync_primitives::Lock>(); + ApplicationSetDA apps_da(apps, apps_lock); + EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(apps_da)); + + am::VehicleData vehicle_data; + vehicle_data.insert(am::VehicleData::value_type( + am::strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS)); + vehicle_data.insert(am::VehicleData::value_type( + am::strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED)); + EXPECT_CALL(mock_message_helper_, vehicle_data()) + .WillOnce(ReturnRef(vehicle_data)); + + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(message, _)); + + command->Run(); } } // namespace on_vehicle_data_notification diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc index c0a07fb57c..baf75bd93b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc @@ -35,17 +35,17 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/event_engine/event.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" -#include "interfaces/MOBILE_API.h" -#include "interfaces/HMI_API.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/event_engine/event.h" +#include "interfaces/HMI_API.h" +#include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" #include "vehicle_info_plugin/commands/mobile/read_did_request.h" namespace test { @@ -59,9 +59,9 @@ using ::testing::DoAll; using ::testing::Return; using ::testing::SaveArg; namespace am = ::application_manager; -using vehicle_info_plugin::commands::ReadDIDRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; +using vehicle_info_plugin::commands::ReadDIDRequest; class ReadDIDRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc index 323334de2d..0126e7c762 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc @@ -39,8 +39,8 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" #include "mobile/unsubscribe_vehicle_data_request.h" -#include "vehicle_info_plugin/vehicle_info_plugin.h" #include "vehicle_info_plugin/vehicle_info_app_extension.h" +#include "vehicle_info_plugin/vehicle_info_plugin.h" namespace test { namespace components { @@ -53,8 +53,8 @@ namespace mobile_result = mobile_apis::Result; using ::testing::_; -using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest; using am::commands::MessageSharedPtr; +using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest; typedef std::shared_ptr<UnsubscribeVehicleDataRequest> CommandPtr; @@ -149,8 +149,10 @@ TEST_F(UnsubscribeVehicleRequestTest, .WillOnce(Return(mock_app_)); EXPECT_CALL(mock_rpc_service_, - ManageHMICommand(HMIResultCodeIs( - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData))) + ManageHMICommand( + HMIResultCodeIs( + hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData), + _)) .WillOnce(Return(true)); vehicle_info_plugin::VehicleInfoAppExtension* vi_app_extension = dynamic_cast<vehicle_info_plugin::VehicleInfoAppExtension*>( diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc index a0d4699de8..89dbfe1cdb 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc @@ -30,10 +30,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "mobile/unsubscribe_vehicle_data_response.h" #include <stdint.h> #include <string> #include "gtest/gtest.h" +#include "mobile/unsubscribe_vehicle_data_response.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" @@ -50,8 +50,8 @@ using ::testing::_; using ::testing::NotNull; using ::testing::Types; -using vehicle_info_plugin::commands::UnsubscribeVehicleDataResponse; using commands::MessageSharedPtr; +using vehicle_info_plugin::commands::UnsubscribeVehicleDataResponse; namespace am = ::application_manager; class UnsubscribeVehicleResponseTest diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc index 8df3d436bd..691f8d3259 100644 --- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc +++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc @@ -29,14 +29,14 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include <iterator> +#include "application_manager/app_launch/app_launch_ctrl_impl.h" #include <algorithm> +#include <iterator> #include <utility> #include <vector> -#include "application_manager/app_launch/app_launch_ctrl_impl.h" +#include "application_manager/application.h" #include "application_manager/resumption/resume_ctrl.h" #include "connection_handler/connection_handler.h" -#include "application_manager/application.h" #include "utils/timer_task_impl.h" namespace app_launch { diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc index 393b01c952..a931b96fa1 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc @@ -29,14 +29,14 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <unistd.h> +#include <string> #include "application_manager/app_launch/app_launch_data_db.h" -#include "application_manager/application_manager_impl.h" #include "application_manager/app_launch/app_launch_sql_queries.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/application_manager.h" #include "application_manager/message_helper.h" +#include "application_manager/smart_object_keys.h" namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") @@ -332,9 +332,9 @@ uint32_t AppLaunchDataDB::GetCurentNumberOfAppData() const { "Values of ignition off counts were updated successfully"); number_of_app_data = query.GetInteger(result_query); - LOG4CXX_DEBUG(logger_, - "Total cout saved mobile applications is " - << number_of_app_data); + LOG4CXX_DEBUG( + logger_, + "Total cout saved mobile applications is " << number_of_app_data); } else { LOG4CXX_WARN(logger_, "Failed execute query 'kGetNumberOfApplicationData'. Reson: " @@ -392,4 +392,4 @@ utils::dbms::SQLDatabase* AppLaunchDataDB::db() const { #endif // __QNX__ } -} // namespace resumption +} // namespace app_launch diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc index d3e3b7d445..984997e424 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc @@ -29,13 +29,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "application_manager/app_launch/app_launch_data_json.h" +#include <algorithm> #include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" -#include "utils/date_time.h" #include "json/json.h" +#include "utils/date_time.h" namespace app_launch { @@ -277,4 +277,4 @@ bool AppLaunchDataJson::Persist() { return true; } -} // app_launch +} // namespace app_launch diff --git a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc index cc4765e6c9..7a9402d35e 100644 --- a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc +++ b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc @@ -75,4 +75,4 @@ const std::string kRefreshApplicationDataSessionTime = "SET `last_session` = STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')" "WHERE `deviceMac` = ? AND appID = ? AND bundleID = ?;"; -} // namespace resumption +} // namespace app_launch diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc index f3851482c1..993a57364e 100644 --- a/src/components/application_manager/src/app_launch/apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/apps_launcher.cc @@ -1,8 +1,8 @@ -#include <algorithm> #include "application_manager/app_launch/apps_launcher.h" +#include <algorithm> -#include "utils/timer_task_impl.h" #include <iostream> +#include "utils/timer_task_impl.h" namespace app_launch { struct LauncherGenerator { diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc index a4468d87bc..9a7a6658fe 100644 --- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc @@ -1,15 +1,15 @@ +#include <algorithm> #include <string> #include <vector> -#include <algorithm> -#include "application_manager/app_launch/device_apps_launcher.h" #include "application_manager/app_launch/app_launch_data.h" #include "application_manager/app_launch/apps_launcher.h" +#include "application_manager/app_launch/device_apps_launcher.h" #include "application_manager/resumption/resume_ctrl.h" +#include <iostream> #include "utils/timer.h" #include "utils/timer_task_impl.h" -#include <iostream> namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") @@ -58,9 +58,9 @@ class Launcher { device_launcher_.settings().wait_time_between_apps(), timer::kSingleShot); } else { - LOG4CXX_DEBUG(logger_, - "All Apps on " << apps_on_device_->first - << " postponed launched"); + LOG4CXX_DEBUG( + logger_, + "All Apps on " << apps_on_device_->first << " postponed launched"); device_launcher_.StopLaunchingAppsOnDevice(apps_on_device_->first); } } diff --git a/src/components/application_manager/src/app_service_manager.cc b/src/components/application_manager/src/app_service_manager.cc new file mode 100644 index 0000000000..bab8147d9f --- /dev/null +++ b/src/components/application_manager/src/app_service_manager.cc @@ -0,0 +1,593 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/app_service_manager.h" + +#include <algorithm> +#include <iterator> + +#include "application_manager/application.h" +#include "application_manager/application_manager.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "encryption/hashing.h" +#include "resumption/last_state.h" +#include "smart_objects/enum_schema_item.h" +#include "utils/logger.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "AppServiceManager") + +namespace application_manager { + +const char* kAppServiceSection = "AppServices"; +const char* kDefaults = "defaults"; + +AppServiceManager::AppServiceManager(ApplicationManager& app_manager, + resumption::LastState& last_state) + : app_manager_(app_manager) + , last_state_(last_state) + , rpc_passing_handler_(*this, app_manager_) {} + +AppServiceManager::~AppServiceManager() { + LOG4CXX_AUTO_TRACE(logger_); +} + +smart_objects::SmartObject AppServiceManager::PublishAppService( + const smart_objects::SmartObject& manifest, + const bool mobile_service, + const uint32_t connection_key) { + LOG4CXX_AUTO_TRACE(logger_); + std::string str_to_hash = ""; + std::string service_id = ""; + + std::string service_type = manifest[strings::service_type].asString(); + + if (FindServiceByProvider(connection_key, service_type)) { + LOG4CXX_WARN(logger_, + "Service already exists for this provider, rejecting"); + return smart_objects::SmartObject(); + } + + if (manifest.keyExists(strings::service_name) && + FindServiceByName(manifest[strings::service_name].asString())) { + LOG4CXX_WARN(logger_, "A service already exists with this name, rejecting"); + return smart_objects::SmartObject(); + } + + published_services_lock_.Acquire(); + do { + str_to_hash = manifest[strings::service_type].asString() + + std::to_string(std::rand()); + service_id = encryption::MakeHash(str_to_hash); + } while (published_services_.find(service_id) != published_services_.end()); + + AppService app_service; + app_service.connection_key = connection_key; + app_service.mobile_service = mobile_service; + + smart_objects::SmartObject service_record; + service_record[strings::service_manifest] = manifest; + service_record[strings::service_id] = service_id; + service_record[strings::service_published] = true; + service_record[strings::service_active] = false; + app_service.record = service_record; + + std::string default_app_id = DefaultServiceByType(service_type); + if (default_app_id.empty() && !mobile_service) { + auto embedded_services = app_manager_.get_settings().embedded_services(); + for (auto it = embedded_services.begin(); it != embedded_services.end(); + ++it) { + if (*it == service_type) { + Json::Value& dictionary = last_state_.get_dictionary(); + dictionary[kAppServiceSection][kDefaults][service_type] = + kEmbeddedService; + default_app_id = kEmbeddedService; + } + } + } + app_service.default_service = + !default_app_id.empty() && GetPolicyAppID(app_service) == default_app_id; + + auto ret = published_services_.insert( + std::pair<std::string, AppService>(service_id, app_service)); + smart_objects::SmartObject& published_record = ret.first->second.record; + published_services_lock_.Release(); + + smart_objects::SmartObject msg_params; + msg_params[strings::system_capability][strings::system_capability_type] = + mobile_apis::SystemCapabilityType::APP_SERVICES; + AppServiceUpdated( + service_record, mobile_apis::ServiceUpdateReason::PUBLISHED, msg_params); + + MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_); + + // Activate the new service if it is the default for its service type, or if + // no service is active of its service type + AppService* active_service = ActiveServiceForType(service_type); + if (!active_service || app_service.default_service) { + ActivateAppService(service_id); + } + + return published_record; +} + +bool AppServiceManager::UnpublishAppService(const std::string service_id) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Service id does not exist in published services"); + return false; + } + LOG4CXX_DEBUG(logger_, "Unpublishing app service: " << service_id); + + SetServicePublished(service_id, false); + smart_objects::SmartObject msg_params; + msg_params[strings::system_capability][strings::system_capability_type] = + mobile_apis::SystemCapabilityType::APP_SERVICES; + + auto& record = it->second.record; + if (record[strings::service_active].asBool()) { + record[strings::service_active] = false; + + // Activate embedded service, if available + auto embedded_service = EmbeddedServiceForType( + record[strings::service_manifest][strings::service_type].asString()); + if (embedded_service) { + embedded_service->record[strings::service_active] = true; + AppServiceUpdated(embedded_service->record, + mobile_apis::ServiceUpdateReason::ACTIVATED, + msg_params); + } + } + AppServiceUpdated( + record, mobile_apis::ServiceUpdateReason::REMOVED, msg_params); + MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_); + published_services_.erase(it); + + return true; +} + +void AppServiceManager::UnpublishServices(const uint32_t connection_key) { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Unpublishing all app services: " << connection_key); + sync_primitives::AutoLock lock(published_services_lock_); + for (auto it = published_services_.begin(); it != published_services_.end(); + ++it) { + if (it->second.connection_key == connection_key) { + UnpublishAppService(it->first); + } + } +} + +void AppServiceManager::OnAppActivated(ApplicationConstSharedPtr app) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.begin(); + // Activate all services published by the app + for (; it != published_services_.end(); ++it) { + if (it->second.connection_key == app->app_id()) { + ActivateAppService(it->first); + } + } +} + +std::vector<smart_objects::SmartObject> +AppServiceManager::GetAllServiceRecords() { + LOG4CXX_AUTO_TRACE(logger_); + std::vector<smart_objects::SmartObject> services; + sync_primitives::AutoLock lock(published_services_lock_); + for (auto it = published_services_.begin(); it != published_services_.end(); + ++it) { + services.push_back(it->second.record); + } + return services; +} + +void AppServiceManager::GetProviderByType(const std::string& service_type, + const bool mobile_consumer, + ApplicationSharedPtr& app, + bool& hmi_service) { + LOG4CXX_AUTO_TRACE(logger_); + auto active_service = ActiveServiceForType(service_type); + if (!active_service) { + LOG4CXX_ERROR(logger_, + "There is no active service for the given service type: " + << service_type); + return; + } + + LOG4CXX_DEBUG(logger_, "Found provider for service type: " << service_type); + GetProviderFromService(*active_service, mobile_consumer, app, hmi_service); +} + +void AppServiceManager::GetProviderByID(const std::string& service_id, + const bool mobile_consumer, + ApplicationSharedPtr& app, + bool& hmi_service) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Service id does not exist in published services"); + return; + } + + LOG4CXX_DEBUG(logger_, "Found provider with service ID: " << service_id); + GetProviderFromService(it->second, mobile_consumer, app, hmi_service); +} + +void AppServiceManager::GetProviderFromService(const AppService& service, + const bool mobile_consumer, + ApplicationSharedPtr& app, + bool& hmi_service) { + LOG4CXX_AUTO_TRACE(logger_); + if (mobile_consumer && + !service.record[strings::service_manifest][strings::allow_app_consumers] + .asBool()) { + LOG4CXX_ERROR(logger_, "Service does not support app consumers"); + return; + } + bool mobile_service = service.mobile_service; + if (mobile_service) { + app = app_manager_.application(service.connection_key); + hmi_service = false; + return; + } + hmi_service = true; +} + +bool AppServiceManager::SetDefaultService(const std::string service_id) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id); + return false; + } + AppService& service = it->second; + + std::string service_type = + service.record[strings::service_manifest][strings::service_type] + .asString(); + std::string default_app_id = DefaultServiceByType(service_type); + if (!default_app_id.empty()) { + auto default_service = + FindServiceByPolicyAppID(default_app_id, service_type); + if (default_service) { + default_service->default_service = false; + } + } + service.default_service = true; + + Json::Value& dictionary = last_state_.get_dictionary(); + dictionary[kAppServiceSection][kDefaults][service_type] = + GetPolicyAppID(service); + return true; +} + +bool AppServiceManager::RemoveDefaultService(const std::string service_id) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id); + return false; + } + + AppService& service = it->second; + if (!service.default_service) { + LOG4CXX_ERROR(logger_, "Service was not default " << service_id); + return false; + } + service.default_service = false; + + std::string service_type = + service.record[strings::service_manifest][strings::service_type] + .asString(); + Json::Value& dictionary = last_state_.get_dictionary(); + dictionary[kAppServiceSection][kDefaults].removeMember(service_type); + return true; +} + +bool AppServiceManager::ActivateAppService(const std::string service_id) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id); + return false; + } + + smart_objects::SmartObject& service = it->second.record; + if (service[strings::service_active].asBool()) { + LOG4CXX_DEBUG(logger_, "Service was already active " << service_id); + return true; + } + + smart_objects::SmartObject msg_params; + msg_params[strings::system_capability][strings::system_capability_type] = + mobile_apis::SystemCapabilityType::APP_SERVICES; + + const std::string service_type = + service[strings::service_manifest][strings::service_type].asString(); + auto active_service = ActiveServiceForType(service_type); + if (active_service) { + active_service->record[strings::service_active] = false; + AppServiceUpdated(active_service->record, + mobile_apis::ServiceUpdateReason::DEACTIVATED, + msg_params); + } + service[strings::service_active] = true; + AppServiceUpdated( + service, mobile_apis::ServiceUpdateReason::ACTIVATED, msg_params); + + MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_); + + std::string navi_service_type; + ns_smart_device_link::ns_smart_objects:: + EnumConversionHelper<mobile_apis::AppServiceType::eType>::EnumToString( + mobile_apis::AppServiceType::NAVIGATION, &navi_service_type); + if (service_type == navi_service_type) { + smart_objects::SmartObject msg_params; + msg_params[strings::system_capability][strings::system_capability_type] = + mobile_apis::SystemCapabilityType::NAVIGATION; + MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_); + } + return true; +} + +bool AppServiceManager::DeactivateAppService(const std::string service_id) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Unable to find published service " << service_id); + return false; + } + smart_objects::SmartObject& service = it->second.record; + smart_objects::SmartObject msg_params; + bool send_update = false; + + if (service[strings::service_active].asBool()) { + service[strings::service_active] = false; + AppServiceUpdated( + service, mobile_apis::ServiceUpdateReason::DEACTIVATED, msg_params); + + // Activate embedded service, if available + const std::string service_type = + service[strings::service_manifest][strings::service_type].asString(); + auto embedded_service = EmbeddedServiceForType(service_type); + if (embedded_service && + embedded_service->record[strings::service_id].asString() != + service_id) { + embedded_service->record[strings::service_active] = true; + AppServiceUpdated(embedded_service->record, + mobile_apis::ServiceUpdateReason::ACTIVATED, + msg_params); + } + send_update = true; + } + + if (send_update) { + msg_params[strings::system_capability][strings::system_capability_type] = + mobile_apis::SystemCapabilityType::APP_SERVICES; + MessageHelper::BroadcastCapabilityUpdate(msg_params, app_manager_); + } + return true; +} + +AppService* AppServiceManager::ActiveServiceForType( + const std::string service_type) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + for (auto it = published_services_.begin(); it != published_services_.end(); + ++it) { + if (it->second.record[strings::service_manifest][strings::service_type] + .asString() == service_type && + it->second.record[strings::service_published].asBool() && + it->second.record[strings::service_active].asBool()) { + return &(it->second); + } + } + return NULL; +} + +AppService* AppServiceManager::EmbeddedServiceForType( + const std::string service_type) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + for (auto it = published_services_.begin(); it != published_services_.end(); + ++it) { + if (it->second.record[strings::service_manifest][strings::service_type] + .asString() == service_type && + !it->second.mobile_service) { + return &(it->second); + } + } + return NULL; +} + +AppService* AppServiceManager::FindServiceByPolicyAppID( + const std::string policy_app_id, const std::string type) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + for (auto it = published_services_.begin(); it != published_services_.end(); + ++it) { + if (it->second.record[strings::service_manifest][strings::service_type] + .asString() != type) { + continue; + } + + if (policy_app_id == GetPolicyAppID(it->second)) { + return &(it->second); + } + } + return NULL; +} + +AppService* AppServiceManager::FindServiceByID(const std::string service_id) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Service id does not exist in published services"); + return NULL; + } + return &(it->second); +} + +AppService* AppServiceManager::FindServiceByProvider( + const uint32_t connection_key, const std::string service_type) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + for (auto& service : published_services_) { + if (service.second.connection_key == connection_key && + service.second.record[strings::service_manifest][strings::service_type] + .asString() == service_type) { + return &(service.second); + } + } + return NULL; +} + +AppService* AppServiceManager::FindServiceByName(std::string name) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + for (auto& service : published_services_) { + if (service.second.record[strings::service_manifest][strings::service_name] + .asString() == name) { + return &(service.second); + } + } + return NULL; +} + +std::string AppServiceManager::DefaultServiceByType( + const std::string service_type) { + LOG4CXX_AUTO_TRACE(logger_); + Json::Value& dictionary = last_state_.get_dictionary(); + if (dictionary[kAppServiceSection][kDefaults].isMember(service_type)) { + return dictionary[kAppServiceSection][kDefaults][service_type].asString(); + } + return std::string(); +} + +void AppServiceManager::SetServicePublished(const std::string service_id, + const bool service_published) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(published_services_lock_); + auto it = published_services_.find(service_id); + if (it == published_services_.end()) { + LOG4CXX_ERROR(logger_, "Service id does not exist in published services"); + return; + } + it->second.record[strings::service_published] = service_published; +} + +std::string AppServiceManager::GetPolicyAppID(AppService service) { + if (service.mobile_service) { + auto app = app_manager_.application(service.connection_key); + return app ? app->policy_app_id() : std::string(); + } + return kEmbeddedService; +} + +bool AppServiceManager::UpdateNavigationCapabilities( + smart_objects::SmartObject& out_params) { + LOG4CXX_AUTO_TRACE(logger_); + std::string navi_service_type; + ns_smart_device_link::ns_smart_objects:: + EnumConversionHelper<mobile_apis::AppServiceType::eType>::EnumToString( + mobile_apis::AppServiceType::NAVIGATION, &navi_service_type); + auto service = ActiveServiceForType(navi_service_type); + if (!service) { + return false; + } + + if (!out_params.keyExists(strings::send_location_enabled)) { + out_params[strings::send_location_enabled] = false; + } + if (!out_params.keyExists(strings::get_way_points_enabled)) { + out_params[strings::get_way_points_enabled] = false; + } + + if (!service->record[strings::service_manifest].keyExists( + strings::handled_rpcs)) { + return true; + } + + smart_objects::SmartObject& handled_rpcs = + service->record[strings::service_manifest][strings::handled_rpcs]; + for (size_t i = 0; i < handled_rpcs.length(); ++i) { + if (handled_rpcs[i].asInt() == mobile_apis::FunctionID::SendLocationID) { + out_params[strings::send_location_enabled] = true; + } else if (handled_rpcs[i].asInt() == + mobile_apis::FunctionID::GetWayPointsID) { + out_params[strings::get_way_points_enabled] = true; + } + } + return true; +} + +void AppServiceManager::AppServiceUpdated( + const smart_objects::SmartObject& service_record, + const mobile_apis::ServiceUpdateReason::eType update_reason, + smart_objects::SmartObject& msg_params) { + LOG4CXX_AUTO_TRACE(logger_); + smart_objects::SmartObject& services = + msg_params[strings::system_capability][strings::app_services_capabilities] + [strings::app_services]; + smart_objects::SmartObject service(smart_objects::SmartType_Map); + service[strings::update_reason] = update_reason; + service[strings::updated_app_service_record] = service_record; + services[-1] = service; +} + +std::vector<AppService> AppServiceManager::GetActiveServices() { + std::vector<AppService> active_services; + for (auto it = published_services_.begin(); it != published_services_.end(); + ++it) { + if (it->second.record[strings::service_active].asBool()) { + active_services.push_back(it->second); + } + } + return active_services; +} + +RPCPassingHandler& AppServiceManager::GetRPCPassingHandler() { + return rpc_passing_handler_; +} + +} // namespace application_manager diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 8a611195c7..3b2f51f26c 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -31,21 +31,21 @@ */ #include "application_manager/application_impl.h" -#include <string> #include <strings.h> -#include "application_manager/message_helper.h" -#include "protocol_handler/protocol_handler.h" +#include <string> #include "application_manager/application_manager.h" +#include "application_manager/message_helper.h" #include "config_profile/profile.h" #include "interfaces/MOBILE_API.h" +#include "protocol_handler/protocol_handler.h" #include "utils/file_system.h" -#include "utils/logger.h" #include "utils/gen_hash.h" +#include "utils/logger.h" -#include "utils/timer_task_impl.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/resumption/resume_ctrl.h" #include "transport_manager/common.h" +#include "utils/timer_task_impl.h" namespace { @@ -849,8 +849,9 @@ bool ApplicationImpl::AreCommandLimitsExceeded( "Time Info: " << "\n Current: " << date_time::getSecs(current) << "\n Limit: (" << date_time::getSecs(limit.first) - << "," << limit.second << ")" - "\n frequency_restrictions: (" + << "," << limit.second + << ")" + "\n frequency_restrictions: (" << frequency_restrictions.first << "," << frequency_restrictions.second << ")"); if (date_time::getSecs(current) < @@ -964,7 +965,7 @@ void ApplicationImpl::CleanupFiles() { application_manager_.get_settings().app_storage_folder(); directory_name += "/" + folder_name(); - if (file_system::DirectoryExists(directory_name)) { + if (file_system::DirectoryExists(directory_name) && !folder_name().empty()) { std::vector<std::string> files = file_system::ListFiles(directory_name); AppFilesMap::const_iterator app_files_it; @@ -1152,9 +1153,9 @@ bool ApplicationImpl::AddExtension(AppExtensionPtr extension) { bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) { auto it = std::find_if( - extensions_.begin(), - extensions_.end(), - [uid](AppExtensionPtr extension) { return extension->uid() == uid; }); + extensions_.begin(), extensions_.end(), [uid](AppExtensionPtr extension) { + return extension->uid() == uid; + }); return it != extensions_.end(); } @@ -1163,6 +1164,58 @@ const std::list<AppExtensionPtr>& ApplicationImpl::Extensions() const { return extensions_; } +const std::string& ApplicationImpl::cloud_app_endpoint() const { + return endpoint_; +} + +const std::string& ApplicationImpl::auth_token() const { + return auth_token_; +} + +const std::string& ApplicationImpl::cloud_app_transport_type() const { + return cloud_transport_type_; +} + +const mobile_apis::HybridAppPreference::eType& +ApplicationImpl::hybrid_app_preference() const { + return hybrid_app_preference_; +} + +const std::string& ApplicationImpl::cloud_app_certificate() const { + return certificate_; +} + +bool ApplicationImpl::is_cloud_app() const { +#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + return false; +#else + return !endpoint_.empty(); +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT +} + +void ApplicationImpl::set_cloud_app_endpoint(const std::string& endpoint) { + endpoint_ = endpoint; +} + +void ApplicationImpl::set_auth_token(const std::string& auth_token) { + auth_token_ = auth_token; +} + +void ApplicationImpl::set_cloud_app_transport_type( + const std::string& transport_type) { + cloud_transport_type_ = transport_type; +} + +void ApplicationImpl::set_hybrid_app_preference( + const mobile_apis::HybridAppPreference::eType& hybrid_app_preference) { + hybrid_app_preference_ = hybrid_app_preference; +} + +void ApplicationImpl::set_cloud_app_certificate( + const std::string& certificate) { + certificate_ = certificate; +} + void ApplicationImpl::PushMobileMessage( smart_objects::SmartObjectSPtr mobile_message) { sync_primitives::AutoLock lock(mobile_message_lock_); diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 24f27af2e2..3a92009d4f 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -32,47 +32,48 @@ #include <stdlib.h> // for rand() +#include <bson_object.h> #include <climits> -#include <string> #include <fstream> +#include <string> #include <utility> -#include <bson_object.h> +#include "application_manager/app_launch/app_launch_ctrl_impl.h" +#include "application_manager/app_launch/app_launch_data_db.h" +#include "application_manager/app_launch/app_launch_data_json.h" #include "application_manager/application_manager_impl.h" +#include "application_manager/command_holder_impl.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/command_notification_impl.h" +#include "application_manager/helpers/application_helper.h" +#include "application_manager/hmi_capabilities_impl.h" #include "application_manager/message_helper.h" -#include "application_manager/rpc_service_impl.h" -#include "application_manager/rpc_handler_impl.h" #include "application_manager/mobile_message_handler.h" +#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h" #include "application_manager/policies/policy_handler.h" -#include "application_manager/hmi_capabilities_impl.h" #include "application_manager/resumption/resume_ctrl_impl.h" -#include "application_manager/app_launch/app_launch_ctrl_impl.h" -#include "application_manager/app_launch/app_launch_data_db.h" -#include "application_manager/app_launch/app_launch_data_json.h" -#include "application_manager/helpers/application_helper.h" -#include "application_manager/plugin_manager/rpc_plugin_manager_impl.h" -#include "protocol_handler/protocol_handler.h" -#include "hmi_message_handler/hmi_message_handler.h" -#include "application_manager/command_holder_impl.h" +#include "application_manager/rpc_handler_impl.h" +#include "application_manager/rpc_service_impl.h" #include "connection_handler/connection_handler_impl.h" -#include "formatters/formatter_json_rpc.h" -#include "formatters/CFormatterJsonSDLRPCv2.h" #include "formatters/CFormatterJsonSDLRPCv1.h" +#include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/formatter_json_rpc.h" +#include "hmi_message_handler/hmi_message_handler.h" #include "protocol/bson_object_keys.h" +#include "protocol_handler/protocol_handler.h" -#include "utils/threads/thread.h" -#include "utils/file_system.h" -#include "utils/helpers.h" -#include "utils/timer_task_impl.h" -#include "smart_objects/enum_schema_item.h" -#include "interfaces/HMI_API_schema.h" +#include <time.h> +#include <boost/filesystem.hpp> #include "application_manager/application_impl.h" +#include "interfaces/HMI_API_schema.h" #include "media_manager/media_manager.h" #include "policy/usage_statistics/counter.h" +#include "smart_objects/enum_schema_item.h" #include "utils/custom_string.h" -#include <time.h> +#include "utils/file_system.h" +#include "utils/helpers.h" +#include "utils/threads/thread.h" +#include "utils/timer_task_impl.h" namespace { int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) { @@ -98,7 +99,9 @@ DeviceTypes devicesType = { std::make_pair(std::string("USB_IOS_DEVICE_MODE"), hmi_apis::Common_TransportType::USB_IOS), std::make_pair(std::string("CARPLAY_WIRELESS_IOS"), - hmi_apis::Common_TransportType::WIFI)}; + hmi_apis::Common_TransportType::WIFI), + std::make_pair(std::string("CLOUD_WEBSOCKET"), + hmi_apis::Common_TransportType::CLOUD_WEBSOCKET)}; } /** @@ -130,6 +133,7 @@ bool policy_app_id_comparator(const std::string& policy_app_id, return app->policy_app_id() == policy_app_id; } +uint32_t ApplicationManagerImpl::mobile_corelation_id_ = 0; uint32_t ApplicationManagerImpl::corelation_id_ = 0; const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX; @@ -166,6 +170,8 @@ ApplicationManagerImpl::ApplicationManagerImpl( , navi_close_app_timeout_(am_settings.stop_streaming_timeout()) , navi_end_stream_timeout_(am_settings.stop_streaming_timeout()) , state_ctrl_(*this) + , pending_device_map_lock_ptr_( + std::make_shared<sync_primitives::RecursiveLock>()) , application_list_update_timer_( "AM ListUpdater", new TimerTaskImpl<ApplicationManagerImpl>( @@ -236,6 +242,13 @@ DataAccessor<ApplicationSet> ApplicationManagerImpl::applications() const { return accessor; } +DataAccessor<AppsWaitRegistrationSet> +ApplicationManagerImpl::pending_applications() const { + DataAccessor<AppsWaitRegistrationSet> accessor( + apps_to_register_, apps_to_register_list_lock_ptr_); + return accessor; +} + ApplicationSharedPtr ApplicationManagerImpl::application( uint32_t app_id) const { AppIdPredicate finder(app_id); @@ -257,6 +270,20 @@ ApplicationSharedPtr ApplicationManagerImpl::application_by_policy_id( return FindApp(accessor, finder); } +ApplicationSharedPtr ApplicationManagerImpl::application_by_name( + const std::string& app_name) const { + AppNamePredicate finder(app_name); + DataAccessor<ApplicationSet> accessor = applications(); + return FindApp(accessor, finder); +} + +ApplicationSharedPtr ApplicationManagerImpl::pending_application_by_policy_id( + const std::string& policy_app_id) const { + PolicyAppIdPredicate finder(policy_app_id); + DataAccessor<AppsWaitRegistrationSet> accessor = pending_applications(); + return FindPendingApp(accessor, finder); +} + bool ActiveAppPredicate(const ApplicationSharedPtr app) { return app ? app->IsFullscreen() : false; } @@ -379,21 +406,6 @@ void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) { plugin.OnApplicationEvent(plugin_manager::kApplicationRegistered, app); }; plugin_manager_->ForEachPlugin(on_app_registered); - - // TODO(AOleynik): Is neccessary to be able to know that registration process - // has been completed and default HMI level is set, otherwise policy will - // block all the requests/notifications to mobile - // APPLINK-20764 - introduce usage of internal events or re-implement - event_engine::Event event( - hmi_apis::FunctionID::BasicCommunication_OnAppRegistered); - - smart_objects::SmartObject msg; - msg[strings::params][strings::message_type] = - hmi_apis::messageType::notification; - msg[strings::params][strings::app_id] = app->app_id(); - - event.set_smart_object(msg); - event.raise(event_dispatcher()); } void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) { @@ -539,6 +551,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( app_name, GetPolicyHandler().GetStatisticManager(), *this)); + if (!application) { std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( @@ -582,11 +595,13 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( Version version; int32_t min_version = message[strings::msg_params][strings::sync_msg_version] - [strings::minor_version].asInt(); + [strings::minor_version] + .asInt(); version.min_supported_api_version = static_cast<APIVersion>(min_version); int32_t max_version = message[strings::msg_params][strings::sync_msg_version] - [strings::major_version].asInt(); + [strings::major_version] + .asInt(); version.max_supported_api_version = static_cast<APIVersion>(max_version); application->set_version(version); @@ -608,13 +623,48 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( // Keep HMI add id in case app is present in "waiting for registration" list apps_to_register_list_lock_ptr_->Acquire(); - AppsWaitRegistrationSet::iterator it = apps_to_register_.find(application); - if (apps_to_register_.end() != it) { + PolicyAppIdPredicate finder(application->policy_app_id()); + ApplicationSet::iterator it = + std::find_if(apps_to_register_.begin(), apps_to_register_.end(), finder); + bool is_mismatched_cloud_app = false; + + if (apps_to_register_.end() == it) { + DevicePredicate finder(application->device()); + it = std::find_if( + apps_to_register_.begin(), apps_to_register_.end(), finder); + + bool found = apps_to_register_.end() != it; + is_mismatched_cloud_app = found && (*it)->is_cloud_app() && + policy_app_id != (*it)->policy_app_id(); + } else { application->set_hmi_application_id((*it)->hmi_app_id()); - apps_to_register_.erase(application); + + // Set cloud app parameters + application->set_cloud_app_endpoint((*it)->cloud_app_endpoint()); + application->set_cloud_app_certificate((*it)->cloud_app_certificate()); + application->set_auth_token((*it)->auth_token()); + application->set_cloud_app_transport_type( + (*it)->cloud_app_transport_type()); + application->set_hybrid_app_preference((*it)->hybrid_app_preference()); + apps_to_register_.erase(it); } apps_to_register_list_lock_ptr_->Release(); + // Reject registration request if a cloud app registers with the incorrect + // appID + if (is_mismatched_cloud_app) { + std::shared_ptr<smart_objects::SmartObject> response( + MessageHelper::CreateNegativeResponse( + connection_key, + mobile_apis::FunctionID::RegisterAppInterfaceID, + message[strings::params][strings::correlation_id].asUInt(), + mobile_apis::Result::DISALLOWED)); + (*response)[strings::msg_params][strings::info] = + "Cloud app registered with incorrect app id"; + rpc_service_->ManageMobileCommand(response, commands::Command::SOURCE_SDL); + return ApplicationSharedPtr(); + } + if (!application->hmi_app_id()) { const bool is_saved = resume_controller().IsApplicationSaved(policy_app_id, device_mac); @@ -650,6 +700,10 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( apps_size_ = applications_.size(); applications_list_lock_ptr_->Release(); + // Update cloud app information, in case any pending apps are unable to be + // registered due to a mobile app taking precedence + RefreshCloudAppInformation(); + // It is possible that secondary transport of this app has been already // established. Make sure that the information is reflected to application // instance. @@ -674,6 +728,8 @@ bool ApplicationManagerImpl::ActivateApplication(ApplicationSharedPtr app) { // remove from resumption if app was activated by user resume_controller().OnAppActivated(app); + // Activate any app services published by the app + GetAppServiceManager().OnAppActivated(app); const HMILevel::eType hmi_level = HMILevel::HMI_FULL; const AudioStreamingState::eType audio_state = app->IsAudioApplication() ? AudioStreamingState::AUDIBLE @@ -779,6 +835,426 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { *this)); rpc_service_->ManageHMICommand(mixing_audio_supported_request); resume_controller().ResetLaunchTime(); + + RefreshCloudAppInformation(); +} + +std::string ApplicationManagerImpl::PolicyIDByIconUrl(const std::string url) { + sync_primitives::AutoLock lock(app_icon_map_lock_ptr_); + for (auto& x : app_icon_map_) { + auto policy_id = x.first; + std::string icon_url = GetPolicyHandler().GetIconUrl(policy_id); + if (icon_url == url) { + LOG4CXX_DEBUG(logger_, "Matched icon url: " << url); + x.second.pending_request = false; + return policy_id; + } + } + return std::string(""); +} + +void ApplicationManagerImpl::SetIconFileFromSystemRequest( + const std::string policy_id) { + app_icon_map_lock_ptr_.Acquire(); + auto app_icon_it = app_icon_map_.find(policy_id); + if (app_icon_it != app_icon_map_.end()) { + app_icon_map_.erase(app_icon_it); + } + app_icon_map_lock_ptr_.Release(); + + // Find pending application and set icon path + auto app = pending_application_by_policy_id(policy_id); + if (!app) { + return; + } + const std::string app_icon_dir(settings_.app_icons_folder()); + const std::string full_icon_path(app_icon_dir + "/" + policy_id); + if (file_system::FileExists(full_icon_path)) { + LOG4CXX_DEBUG(logger_, "Set Icon Path: " << full_icon_path); + AppFile file; + file.is_persistent = true; + file.is_download_complete = true; + file.file_name = full_icon_path; + + std::string icon_url = GetPolicyHandler().GetIconUrl(policy_id); + std::string extension = boost::filesystem::extension(icon_url); + if (extension == "bmp" || extension == "BMP") { + file.file_type = mobile_apis::FileType::GRAPHIC_BMP; + } else if (extension == "JPEG" || extension == "jpeg" || + extension == "JPG" || extension == "jpg") { + file.file_type = mobile_apis::FileType::GRAPHIC_JPEG; + } else { + file.file_type = mobile_apis::FileType::GRAPHIC_PNG; + } + + app->AddFile(file); + app->set_app_icon_path(full_icon_path); + } + SendUpdateAppList(); +} + +void ApplicationManagerImpl::DisconnectCloudApp(ApplicationSharedPtr app) { +#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + LOG4CXX_TRACE(logger_, "Cloud app support is disabled. Exiting function"); + return; +#else + std::string endpoint; + std::string certificate; + std::string auth_token; + std::string cloud_transport_type; + std::string hybrid_app_preference; + bool enabled = true; + std::string policy_app_id = app->policy_app_id(); + GetPolicyHandler().GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); + if (app->IsRegistered() && app->is_cloud_app()) { + LOG4CXX_DEBUG(logger_, "Disabled app is registered, unregistering now"); + GetRPCService().ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app->app_id(), + mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), + commands::Command::SOURCE_SDL); + + OnAppUnauthorized(app->app_id()); + } + // Delete the cloud device + connection_handler().RemoveCloudAppDevice(app->device()); + + transport_manager::transport_adapter::CloudAppProperties properties{ + endpoint, + certificate, + enabled, + auth_token, + cloud_transport_type, + hybrid_app_preference}; + // Create device in pending state + LOG4CXX_DEBUG(logger_, "Re-adding the cloud app device"); + connection_handler().AddCloudAppDevice(policy_app_id, properties); +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT +} + +void ApplicationManagerImpl::RefreshCloudAppInformation() { +#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + LOG4CXX_TRACE(logger_, "Cloud app support is disabled. Exiting function"); + return; +#else + LOG4CXX_AUTO_TRACE(logger_); + if (is_stopping()) { + return; + } + std::vector<std::string> enabled_apps; + GetPolicyHandler().GetEnabledCloudApps(enabled_apps); + std::vector<std::string>::iterator enabled_it = enabled_apps.begin(); + std::vector<std::string>::iterator enabled_end = enabled_apps.end(); + std::string endpoint; + std::string certificate; + std::string auth_token; + std::string cloud_transport_type; + std::string hybrid_app_preference_str; + bool enabled = true; + + // Store old device map and clear the current map + pending_device_map_lock_ptr_->Acquire(); + app_icon_map_lock_ptr_.Acquire(); + std::map<std::string, std::string> old_device_map = pending_device_map_; + pending_device_map_ = std::map<std::string, std::string>(); + // Create a device for each newly enabled cloud app + for (; enabled_it != enabled_end; ++enabled_it) { + GetPolicyHandler().GetCloudAppParameters(*enabled_it, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference_str); + + mobile_apis::HybridAppPreference::eType hybrid_app_preference = + mobile_apis::HybridAppPreference::INVALID_ENUM; + smart_objects::EnumConversionHelper< + mobile_apis::HybridAppPreference::eType>:: + StringToEnum(hybrid_app_preference_str, &hybrid_app_preference); + + auto policy_id = *enabled_it; + policy::StringArray nicknames; + policy::StringArray app_hmi_types; + GetPolicyHandler().GetInitialAppData(policy_id, &nicknames, &app_hmi_types); + + if (nicknames.empty()) { + LOG4CXX_ERROR(logger_, "Cloud App missing nickname"); + continue; + } else if (mobile_apis::HybridAppPreference::MOBILE == + hybrid_app_preference) { + auto nickname_it = nicknames.begin(); + for (; nickname_it != nicknames.end(); ++nickname_it) { + auto app = application_by_name(*nickname_it); + if (app.use_count() != 0) { + LOG4CXX_ERROR( + logger_, + "Mobile app already registered for cloud app: " << *nickname_it); + continue; + } + } + } + + pending_device_map_.insert( + std::pair<std::string, std::string>(endpoint, policy_id)); + // Determine which endpoints were disabled by erasing all enabled apps from + // the old device list + auto old_device_it = old_device_map.find(endpoint); + if (old_device_it != old_device_map.end()) { + old_device_map.erase(old_device_it); + } + + transport_manager::transport_adapter::CloudAppProperties properties{ + endpoint, + certificate, + enabled, + auth_token, + cloud_transport_type, + hybrid_app_preference_str}; + + // If the device was disconnected, this will reinitialize the device + connection_handler().AddCloudAppDevice(policy_id, properties); + + // Look for app icon url data and add to app_icon_url_map + std::string url = GetPolicyHandler().GetIconUrl(policy_id); + + if (url.empty()) { + LOG4CXX_DEBUG(logger_, "No Icon Url for cloud app"); + continue; + } + + auto app_icon_it = app_icon_map_.find(policy_id); + if (app_icon_it != app_icon_map_.end()) { + LOG4CXX_DEBUG(logger_, "Cloud App Already Exists in Icon Map"); + continue; + } + + const std::string app_icon_dir(settings_.app_icons_folder()); + const std::string full_icon_path(app_icon_dir + "/" + policy_id); + if (!file_system::FileExists(full_icon_path)) { + AppIconInfo icon_info(endpoint, false); + LOG4CXX_DEBUG( + logger_, + "Inserting cloud app into icon map: " << app_icon_map_.size()); + app_icon_map_.insert( + std::pair<std::string, AppIconInfo>(policy_id, icon_info)); + } + } + app_icon_map_lock_ptr_.Release(); + pending_device_map_lock_ptr_->Release(); + + int removed_app_count = 0; + // Clear out devices for existing cloud apps that were disabled + for (auto& device : old_device_map) { + std::string policy_app_id = device.second; + // First search for the disabled app within the registered apps + ApplicationSharedPtr app = application_by_policy_id(policy_app_id); + if (app.use_count() == 0) { + sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_); + // If the disabled app is not present in the registered app list, check + // the apps awaiting registration + PolicyAppIdPredicate finder(policy_app_id); + ApplicationSet::iterator it = std::find_if( + apps_to_register_.begin(), apps_to_register_.end(), finder); + if (it == apps_to_register_.end()) { + LOG4CXX_DEBUG( + logger_, + "Unable to find app to remove (" << policy_app_id << "), skipping"); + continue; + } + app = *it; + apps_to_register_.erase(it); + } + // If the disabled app is registered, unregistered it before destroying the + // device + if (app->IsRegistered() && app->is_cloud_app()) { + LOG4CXX_DEBUG(logger_, "Disabled app is registered, unregistering now"); + GetRPCService().ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app->app_id(), + mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), + commands::Command::SOURCE_SDL); + + OnAppUnauthorized(app->app_id()); + } + // Delete the cloud device + connection_handler().RemoveCloudAppDevice(app->device()); + removed_app_count++; + } + + // Update app list if disabled apps were removed + if (removed_app_count > 0) { + LOG4CXX_DEBUG(logger_, "Removed " << removed_app_count << " disabled apps"); + SendUpdateAppList(); + } +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT +} + +void ApplicationManagerImpl::CreatePendingApplication( + const transport_manager::ConnectionUID connection_id, + const transport_manager::DeviceInfo& device_info, + connection_handler::DeviceHandle device_id) { + LOG4CXX_AUTO_TRACE(logger_); + + std::string endpoint; + std::string certificate; + std::string auth_token; + std::string cloud_transport_type; + std::string hybrid_app_preference_str; + bool enabled = true; + std::string name = device_info.name(); + pending_device_map_lock_ptr_->Acquire(); + auto it = pending_device_map_.find(name); + if (it == pending_device_map_.end()) { + pending_device_map_lock_ptr_->Release(); + return; + } + pending_device_map_lock_ptr_->Release(); + + const std::string policy_app_id = it->second; + + policy::StringArray nicknames; + policy::StringArray app_hmi_types; + + GetPolicyHandler().GetInitialAppData( + policy_app_id, &nicknames, &app_hmi_types); + + if (nicknames.empty()) { + LOG4CXX_ERROR(logger_, "Cloud App missing nickname"); + return; + } + + const std::string display_name = nicknames[0]; + + ApplicationSharedPtr application( + new ApplicationImpl(0, + policy_app_id, + device_info.mac_address(), + device_id, + custom_str::CustomString(display_name), + GetPolicyHandler().GetStatisticManager(), + *this)); + + if (!application) { + LOG4CXX_INFO(logger_, "Could not create application"); + return; + } + + const std::string app_icon_dir(settings_.app_icons_folder()); + const std::string full_icon_path(app_icon_dir + "/" + policy_app_id); + if (file_system::FileExists(full_icon_path)) { + application->set_app_icon_path(full_icon_path); + } + + GetPolicyHandler().GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference_str); + + mobile_apis::HybridAppPreference::eType hybrid_app_preference_enum; + + bool convert_result = smart_objects::EnumConversionHelper< + mobile_apis::HybridAppPreference::eType>:: + StringToEnum(hybrid_app_preference_str, &hybrid_app_preference_enum); + + if (!hybrid_app_preference_str.empty() && !convert_result) { + LOG4CXX_ERROR( + logger_, + "Could not convert string to enum: " << hybrid_app_preference_str); + return; + } + + application->set_hmi_application_id(GenerateNewHMIAppID()); + application->set_cloud_app_endpoint(endpoint); + application->set_auth_token(auth_token); + application->set_cloud_app_transport_type(cloud_transport_type); + application->set_hybrid_app_preference(hybrid_app_preference_enum); + application->set_cloud_app_certificate(certificate); + + sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_); + LOG4CXX_DEBUG(logger_, + "apps_to_register_ size before: " << apps_to_register_.size()); + apps_to_register_.insert(application); + LOG4CXX_DEBUG(logger_, + "apps_to_register_ size after: " << apps_to_register_.size()); + + SendUpdateAppList(); +} + +void ApplicationManagerImpl::SetPendingApplicationState( + const transport_manager::ConnectionUID connection_id, + const transport_manager::DeviceInfo& device_info) { + std::string name = device_info.name(); + pending_device_map_lock_ptr_->Acquire(); + auto it = pending_device_map_.find(name); + if (it == pending_device_map_.end()) { + pending_device_map_lock_ptr_->Release(); + return; + } + pending_device_map_lock_ptr_->Release(); + + const std::string policy_app_id = it->second; + auto app = application_by_policy_id(policy_app_id); + + if (!app) { + return; + } + LOG4CXX_DEBUG(logger_, + "Unregister application and move into apps_to_register"); + + UnregisterApplication( + app->app_id(), mobile_apis::Result::INVALID_ENUM, true, true); + app->MarkUnregistered(); + + { + sync_primitives::AutoLock lock(apps_to_register_list_lock_ptr_); + apps_to_register_.insert(app); + } +} + +void ApplicationManagerImpl::OnConnectionStatusUpdated() { + SendUpdateAppList(); +} + +hmi_apis::Common_CloudConnectionStatus::eType +ApplicationManagerImpl::GetCloudAppConnectionStatus( + ApplicationConstSharedPtr app) const { +#if !defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + return hmi_apis::Common_CloudConnectionStatus::INVALID_ENUM; +#else + transport_manager::ConnectionStatus status = + connection_handler().GetConnectionStatus(app->device()); + switch (status) { + case transport_manager::ConnectionStatus::CONNECTED: + return hmi_apis::Common_CloudConnectionStatus::CONNECTED; + case transport_manager::ConnectionStatus::RETRY: + return hmi_apis::Common_CloudConnectionStatus::RETRY; + case transport_manager::ConnectionStatus::PENDING: + case transport_manager::ConnectionStatus::CLOSING: + return hmi_apis::Common_CloudConnectionStatus::NOT_CONNECTED; + default: + return hmi_apis::Common_CloudConnectionStatus::INVALID_ENUM; + } +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT +} + +uint32_t ApplicationManagerImpl::GetNextMobileCorrelationID() { + if (mobile_corelation_id_ < max_corelation_id_) { + mobile_corelation_id_++; + } else { + mobile_corelation_id_ = 0; + } + + return mobile_corelation_id_; } uint32_t ApplicationManagerImpl::GetNextHMICorrelationID() { @@ -1003,6 +1479,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated( so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID(); so_to_send[jhs::S_MSG_PARAMS] = *msg_params; rpc_service_->ManageHMICommand(update_list); + RefreshCloudAppInformation(); } void ApplicationManagerImpl::OnFindNewApplicationsRequest() { @@ -1412,9 +1889,9 @@ void ApplicationManagerImpl::OnServiceStartedCallback( using namespace helpers; using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "ServiceType = " << type << ". Session = " << std::hex - << session_key); + LOG4CXX_DEBUG( + logger_, + "ServiceType = " << type << ". Session = " << std::hex << session_key); std::vector<std::string> empty; if (type == kRpc) { @@ -1424,9 +1901,9 @@ void ApplicationManagerImpl::OnServiceStartedCallback( } ApplicationSharedPtr app = application(session_key); if (!app) { - LOG4CXX_WARN(logger_, - "The application with id:" << session_key - << " doesn't exists."); + LOG4CXX_WARN( + logger_, + "The application with id:" << session_key << " doesn't exists."); connection_handler().NotifyServiceStartedResult(session_key, false, empty); return; } @@ -1586,9 +2063,9 @@ void ApplicationManagerImpl::OnSecondaryTransportEndedCallback( connection_handler::DeviceHandle device_handle = app->secondary_device(); if (device_handle == 0) { - LOG4CXX_WARN(logger_, - "Secondary transport of app " << session_key - << " is not found"); + LOG4CXX_WARN( + logger_, + "Secondary transport of app " << session_key << " is not found"); return; } @@ -1779,6 +2256,9 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state, } app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl( *app_launch_dto_.get(), *this, settings_)); + + app_service_manager_.reset( + new application_manager::AppServiceManager(*this, last_state)); return true; } @@ -1806,7 +2286,9 @@ bool ApplicationManagerImpl::Stop() { } bool ApplicationManagerImpl::ConvertSOtoMessage( - const smart_objects::SmartObject& message, Message& output) { + const smart_objects::SmartObject& message, + Message& output, + const bool allow_unknown_parameters) { LOG4CXX_AUTO_TRACE(logger_); if (smart_objects::SmartType_Null == message.getType() || @@ -1831,16 +2313,16 @@ bool ApplicationManagerImpl::ConvertSOtoMessage( switch (protocol_type) { case 0: { if (protocol_version == 1) { - if (!formatters::CFormatterJsonSDLRPCv1::toString(message, - output_string)) { + if (!formatters::CFormatterJsonSDLRPCv1::toString( + message, output_string, !allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } output.set_protocol_version( protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1); } else { - if (!formatters::CFormatterJsonSDLRPCv2::toString(message, - output_string)) { + if (!formatters::CFormatterJsonSDLRPCv2::toString( + message, output_string, !allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } @@ -1852,7 +2334,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage( break; } case 1: { - if (!formatters::FormatterJsonRpc::ToString(message, output_string)) { + if (!formatters::FormatterJsonRpc::ToString( + message, output_string, !allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } @@ -2049,9 +2532,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array, connection_handler::DeviceHandle device_id = 0; - if (-1 == - connection_handler().get_session_observer().GetDataOnSessionKey( - connection_key, NULL, NULL, &device_id)) { + if (-1 == connection_handler().get_session_observer().GetDataOnSessionKey( + connection_key, NULL, NULL, &device_id)) { LOG4CXX_ERROR(logger_, "Failed to create application: no connection info."); continue; @@ -2151,6 +2633,17 @@ void ApplicationManagerImpl::updateRequestTimeout( connection_key, mobile_correlation_id, new_timeout_value); } +void ApplicationManagerImpl::IncreaseForwardedRequestTimeout( + uint32_t connection_key, uint32_t mobile_correlation_id) { + LOG4CXX_DEBUG(logger_, + "Increasing Request Timeout by " + << get_settings().rpc_pass_through_timeout()); + uint32_t new_timeout_value = get_settings().default_timeout() + + get_settings().rpc_pass_through_timeout(); + request_ctrl_.updateRequestTimeout( + connection_key, mobile_correlation_id, new_timeout_value); +} + uint32_t ApplicationManagerImpl::application_id(const int32_t correlation_id) { // ykazakov: there is no erase for const iterator for QNX std::map<const int32_t, const uint32_t>::iterator it = @@ -2350,6 +2843,21 @@ void ApplicationManagerImpl::UnregisterAllApplications() { it = accessor.GetData().begin(); } } + + bool send_pending_update_app_list = false; + { + sync_primitives::AutoLock auto_lock(apps_to_register_list_lock_ptr_); + if (!apps_to_register_.empty()) { + send_pending_update_app_list = true; + apps_to_register_.clear(); + } + } + + // Only send update app list if pending apps were removed. + if (send_pending_update_app_list) { + SendUpdateAppList(); + } + if (is_ignition_off) { resume_controller().OnIgnitionOff(); } @@ -2364,9 +2872,9 @@ void ApplicationManagerImpl::RemoveAppsWaitingForRegistration( apps_to_register_.begin(), apps_to_register_.end(), device_finder); while (apps_to_register_.end() != it_app) { - LOG4CXX_DEBUG(logger_, - "Waiting app: " << (*it_app)->name().c_str() - << " is removed."); + LOG4CXX_DEBUG( + logger_, + "Waiting app: " << (*it_app)->name().c_str() << " is removed."); apps_to_register_.erase(it_app); it_app = std::find_if( apps_to_register_.begin(), apps_to_register_.end(), device_finder); @@ -2387,6 +2895,8 @@ void ApplicationManagerImpl::UnregisterApplication( << is_unexpected_disconnect); size_t subscribed_for_way_points_app_count = 0; + GetAppServiceManager().UnpublishServices(app_id); + // SDL sends UnsubscribeWayPoints only for last application { sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); @@ -2449,6 +2959,7 @@ void ApplicationManagerImpl::UnregisterApplication( if (app_id == (*it_app)->app_id()) { app_to_remove = *it_app; applications_.erase(it_app++); + break; } else { ++it_app; } @@ -2472,14 +2983,23 @@ void ApplicationManagerImpl::UnregisterApplication( (hmi_capabilities_->get_hmi_language_handler()) .OnUnregisterApplication(app_id); - AppV4DevicePredicate finder(handle); - ApplicationSharedPtr app = FindApp(applications(), finder); - if (!app) { - LOG4CXX_DEBUG( - logger_, "There is no more SDL4 apps with device handle: " << handle); - RemoveAppsWaitingForRegistration(handle); - SendUpdateAppList(); + if (connection_handler().GetDeviceID(app_to_remove->mac_address(), + &handle)) { + AppV4DevicePredicate finder(handle); + ApplicationSharedPtr app = FindApp(applications(), finder); + if (!app) { + LOG4CXX_DEBUG( + logger_, + "There is no more SDL4 apps with device handle: " << handle); + + RemoveAppsWaitingForRegistration(handle); + RefreshCloudAppInformation(); + SendUpdateAppList(); + } else if (app_to_remove->is_cloud_app()) { + RefreshCloudAppInformation(); + SendUpdateAppList(); + } } } @@ -2778,8 +3298,8 @@ void ApplicationManagerImpl::ProcessPostponedMessages(const uint32_t app_id) { } MobileMessageQueue messages; app->SwapMobileMessageQueue(messages); - auto push_allowed_messages = [this, &app]( - smart_objects::SmartObjectSPtr message) { + auto push_allowed_messages = [this, + &app](smart_objects::SmartObjectSPtr message) { const std::string function_id = MessageHelper::StringifiedFunctionID( static_cast<mobile_apis::FunctionID::eType>( (*message)[strings::params][strings::function_id].asUInt())); @@ -3363,6 +3883,15 @@ void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) { if (!ptu_result) { return; } + + RefreshCloudAppInformation(); + + auto app_id = policy_handler_->GetAppIdForSending(); + auto app = application(app_id); + if (app) { + SendGetIconUrlNotifications(app->app_id(), app); + } + auto on_app_policy_updated = [](plugin_manager::RPCPlugin& plugin) { plugin.OnPolicyEvent(plugin_manager::kApplicationPolicyUpdated); }; @@ -3405,6 +3934,58 @@ void ApplicationManagerImpl::SendDriverDistractionState( } } +void ApplicationManagerImpl::SendGetIconUrlNotifications( + const uint32_t connection_key, ApplicationSharedPtr application) { + LOG4CXX_AUTO_TRACE(logger_); + std::vector<std::string> enabled_apps; + GetPolicyHandler().GetEnabledCloudApps(enabled_apps); + std::vector<std::string>::iterator enabled_it = enabled_apps.begin(); + std::vector<std::string>::iterator enabled_end = enabled_apps.end(); + sync_primitives::AutoLock lock(app_icon_map_lock_ptr_); + for (; enabled_it != enabled_end; ++enabled_it) { + auto app_icon_it = app_icon_map_.find(*enabled_it); + if (app_icon_it == app_icon_map_.end()) { + LOG4CXX_WARN(logger_, "Could not find cloud app in icon map"); + continue; + } + + std::string endpoint = app_icon_it->second.endpoint; + bool pending_request = app_icon_it->second.pending_request; + + if (pending_request) { + LOG4CXX_DEBUG(logger_, "Cloud app has already sent request"); + continue; + } + + std::string url = GetPolicyHandler().GetIconUrl(*enabled_it); + + if (url.empty()) { + LOG4CXX_DEBUG(logger_, "No Icon Url for cloud app"); + continue; + } + + LOG4CXX_DEBUG(logger_, "Creating Get Icon Request"); + + smart_objects::SmartObjectSPtr message = + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map); + (*message)[strings::params][strings::function_id] = + mobile_apis::FunctionID::OnSystemRequestID; + (*message)[strings::params][strings::connection_key] = connection_key; + (*message)[strings::params][strings::message_type] = + mobile_apis::messageType::notification; + (*message)[strings::params][strings::protocol_version] = + application->protocol_version(); + (*message)[strings::msg_params][strings::request_type] = + mobile_apis::RequestType::ICON_URL; + (*message)[strings::msg_params][strings::url] = url; + + app_icon_it->second.pending_request = true; + + rpc_service_->ManageMobileCommand(message, commands::Command::SOURCE_SDL); + } +} + protocol_handler::MajorProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const { LOG4CXX_AUTO_TRACE(logger_); @@ -3436,9 +4017,9 @@ bool ApplicationManagerImpl::InitDirectory( LOG4CXX_WARN(logger_, directory_type << " directory doesn't exist."); // if storage directory doesn't exist try to create it if (!file_system::CreateDirectoryRecursively(path)) { - LOG4CXX_ERROR(logger_, - "Unable to create " << directory_type << " directory " - << path); + LOG4CXX_ERROR( + logger_, + "Unable to create " << directory_type << " directory " << path); return false; } LOG4CXX_DEBUG(logger_, @@ -3453,9 +4034,9 @@ bool ApplicationManagerImpl::IsReadWriteAllowed(const std::string& path, const std::string directory_type = DirectoryTypeToString(type); if (!(file_system::IsWritingAllowed(path) && file_system::IsReadingAllowed(path))) { - LOG4CXX_ERROR(logger_, - directory_type - << " directory doesn't have read/write permissions."); + LOG4CXX_ERROR( + logger_, + directory_type << " directory doesn't have read/write permissions."); return false; } @@ -3642,6 +4223,13 @@ void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) { applications_list_lock_ptr_->Release(); } +void ApplicationManagerImpl::AddMockPendingApplication( + ApplicationSharedPtr mock_app) { + apps_to_register_list_lock_ptr_->Acquire(); + apps_to_register_.insert(mock_app); + apps_to_register_list_lock_ptr_->Release(); +} + void ApplicationManagerImpl::SetMockMediaManager( media_manager::MediaManager* mock_media_manager) { media_manager_ = mock_media_manager; diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc index 3f775ee4e2..2b02e9b658 100644 --- a/src/components/application_manager/src/application_state.cc +++ b/src/components/application_manager/src/application_state.cc @@ -45,7 +45,7 @@ struct StateIDComparator { return cur->state_id() == state_id_; } }; -} +} // namespace namespace application_manager { diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc index ea74e78f4e..87ac50ebd7 100644 --- a/src/components/application_manager/src/command_holder_impl.cc +++ b/src/components/application_manager/src/command_holder_impl.cc @@ -139,4 +139,4 @@ void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) { app_mobile_commands_.erase(app_commands); } -} // application_manager +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc index 04fabfb2ec..521a44890f 100644 --- a/src/components/application_manager/src/commands/command_impl.cc +++ b/src/components/application_manager/src/commands/command_impl.cc @@ -43,7 +43,7 @@ struct AppExtensionPredicate { return app ? (app->QueryInterface(uid).use_count() != 0) : false; } }; -} +} // namespace namespace commands { diff --git a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc index 4e9a2556de..bd4fa58c8f 100644 --- a/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc +++ b/src/components/application_manager/src/commands/command_notification_from_mobile_impl.cc @@ -32,8 +32,8 @@ #include "application_manager/commands/command_notification_from_mobile_impl.h" #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" #include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" namespace application_manager { @@ -75,6 +75,30 @@ void CommandNotificationFromMobileImpl::SendNotification() { rpc_service_.SendMessageToMobile(message_); } +void CommandNotificationFromMobileImpl::SendNotificationToMobile() { + auto app = application_manager_.application(connection_key()); + (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_; + (*message_)[strings::params][strings::protocol_version] = + app->protocol_version(); + (*message_)[strings::params][strings::message_type] = + static_cast<int32_t>(application_manager::MessageType::kNotification); + + rpc_service_.ManageMobileCommand(message_, SOURCE_SDL); +} + +void CommandNotificationFromMobileImpl::SendNotificationToHMI( + const hmi_apis::FunctionID::eType& hmi_function_id) { + (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; + (*message_)[strings::params][strings::function_id] = hmi_function_id; + rpc_service_.ManageHMICommand(message_, SOURCE_SDL_TO_HMI); +} + +void CommandNotificationFromMobileImpl::SendNotificationToConsumers( + const hmi_apis::FunctionID::eType& hmi_function_id) { + SendNotificationToMobile(); + SendNotificationToHMI(hmi_function_id); +} + } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/command_notification_impl.cc b/src/components/application_manager/src/commands/command_notification_impl.cc index 70df95986b..cc2606ab6f 100644 --- a/src/components/application_manager/src/commands/command_notification_impl.cc +++ b/src/components/application_manager/src/commands/command_notification_impl.cc @@ -32,8 +32,8 @@ #include "application_manager/commands/command_notification_impl.h" #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" #include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" namespace application_manager { diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 68e8cfe6b4..f67fde22a0 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -36,11 +36,15 @@ #include "utils/macro.h" #include "application_manager/commands/command_request_impl.h" + +#include "application_manager/app_service_manager.h" #include "application_manager/application_manager.h" -#include "application_manager/rpc_service.h" #include "application_manager/message_helper.h" +#include "application_manager/rpc_service.h" #include "smart_objects/smart_object.h" +#include "smart_objects/enum_schema_item.h" + namespace application_manager { namespace commands { @@ -233,7 +237,8 @@ void CommandRequestImpl::Run() {} void CommandRequestImpl::onTimeOut() { LOG4CXX_AUTO_TRACE(logger_); - unsubscribe_from_all_events(); + unsubscribe_from_all_hmi_events(); + unsubscribe_from_all_mobile_events(); { // FIXME (dchmerev@luxoft.com): atomic_xchg fits better sync_primitives::AutoLock auto_lock(state_lock_); @@ -257,11 +262,14 @@ void CommandRequestImpl::onTimeOut() { void CommandRequestImpl::on_event(const event_engine::Event& event) {} +void CommandRequestImpl::on_event(const event_engine::MobileEvent& event) {} + void CommandRequestImpl::SendResponse( const bool success, const mobile_apis::Result::eType& result_code, const char* info, - const smart_objects::SmartObject* response_params) { + const smart_objects::SmartObject* response_params, + const std::vector<uint8_t> binary_data) { LOG4CXX_AUTO_TRACE(logger_); { sync_primitives::AutoLock auto_lock(state_lock_); @@ -286,7 +294,9 @@ void CommandRequestImpl::SendResponse( CommandImpl::protocol_version_; response[strings::params][strings::connection_key] = connection_key(); response[strings::params][strings::function_id] = function_id(); - + if (!binary_data.empty()) { + response[strings::params][strings::binary_data] = binary_data; + } if (response_params) { response[strings::msg_params] = *response_params; } @@ -414,6 +424,94 @@ void CommandRequestImpl::UpdateHash() { application->UpdateHash(); } +void CommandRequestImpl::SendProviderRequest( + const mobile_apis::FunctionID::eType& mobile_function_id, + const hmi_apis::FunctionID::eType& hmi_function_id, + const smart_objects::SmartObject* msg, + bool use_events) { + LOG4CXX_AUTO_TRACE(logger_); + bool hmi_destination = false; + ApplicationSharedPtr app; + // Default error code and error message + std::string error_msg = "No app service provider available"; + mobile_apis::Result::eType error_code = + mobile_apis::Result::DATA_NOT_AVAILABLE; + + if ((*msg)[strings::msg_params].keyExists(strings::service_type)) { + std::string service_type = + (*msg)[strings::msg_params][strings::service_type].asString(); + application_manager_.GetAppServiceManager().GetProviderByType( + service_type, true, app, hmi_destination); + error_msg = "No app service provider with serviceType: " + service_type + + " is available"; + error_code = mobile_apis::Result::DATA_NOT_AVAILABLE; + } else if ((*msg)[strings::msg_params].keyExists(strings::service_id)) { + std::string service_id = + (*msg)[strings::msg_params][strings::service_id].asString(); + application_manager_.GetAppServiceManager().GetProviderByID( + service_id, true, app, hmi_destination); + error_msg = "No app service provider with serviceId: " + service_id + + " is available"; + error_code = mobile_apis::Result::INVALID_ID; + } + + if (hmi_destination) { + LOG4CXX_DEBUG(logger_, "Sending Request to HMI Provider"); + application_manager_.IncreaseForwardedRequestTimeout(connection_key(), + correlation_id()); + SendHMIRequest(hmi_function_id, &(*msg)[strings::msg_params], use_events); + return; + } + + if (!app) { + LOG4CXX_DEBUG(logger_, "Invalid App Provider pointer"); + SendResponse(false, error_code, error_msg.c_str()); + return; + } + + if (connection_key() == app->app_id()) { + SendResponse(false, + mobile_apis::Result::IGNORED, + "Consumer app is same as producer app"); + return; + } + + smart_objects::SmartObjectSPtr new_msg = + std::make_shared<smart_objects::SmartObject>(); + smart_objects::SmartObject& request = *new_msg; + + request[strings::params] = (*msg)[strings::params]; + request[strings::msg_params] = (*msg)[strings::msg_params]; + request[strings::params][strings::connection_key] = app->app_id(); + + application_manager_.IncreaseForwardedRequestTimeout(connection_key(), + correlation_id()); + SendMobileRequest(mobile_function_id, new_msg, use_events); +} + +void CommandRequestImpl::SendMobileRequest( + const mobile_apis::FunctionID::eType& function_id, + smart_objects::SmartObjectSPtr msg, + bool use_events) { + smart_objects::SmartObject& request = *msg; + + const uint32_t mobile_correlation_id = + application_manager_.GetNextMobileCorrelationID(); + + request[strings::params][strings::correlation_id] = mobile_correlation_id; + request[strings::params][strings::message_type] = MessageType::kRequest; + if (use_events) { + LOG4CXX_DEBUG(logger_, + "SendMobileRequest subscribe_on_event " + << function_id << " " << mobile_correlation_id); + subscribe_on_event(function_id, mobile_correlation_id); + } + + if (!rpc_service_.ManageMobileCommand(msg, SOURCE_SDL)) { + LOG4CXX_ERROR(logger_, "Unable to send request to mobile"); + } +} + uint32_t CommandRequestImpl::SendHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject* msg_params, @@ -439,12 +537,12 @@ uint32_t CommandRequestImpl::SendHMIRequest( if (use_events) { LOG4CXX_DEBUG(logger_, - "subscribe_on_event " << function_id << " " - << hmi_correlation_id); + "SendHMIRequest subscribe_on_event " << function_id << " " + << hmi_correlation_id); subscribe_on_event(function_id, hmi_correlation_id); } if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) { - if (!rpc_service_.ManageHMICommand(result)) { + if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) { LOG4CXX_ERROR(logger_, "Unable to send request"); SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY); } @@ -474,7 +572,7 @@ void CommandRequestImpl::CreateHMINotification( notify[strings::params][strings::function_id] = function_id; notify[strings::msg_params] = msg_params; - if (!rpc_service_.ManageHMICommand(result)) { + if (!rpc_service_.ManageHMICommand(result, SOURCE_SDL_TO_HMI)) { LOG4CXX_ERROR(logger_, "Unable to send HMI notification"); } } @@ -811,6 +909,19 @@ bool CommandRequestImpl::HasDisallowedParams() const { (!removed_parameters_permissions_.undefined_params.empty())); } +bool CommandRequestImpl::IsMobileResultSuccess( + mobile_apis::Result::eType result_code) const { + LOG4CXX_AUTO_TRACE(logger_); + using namespace helpers; + return Compare<mobile_apis::Result::eType, EQ, ONE>( + result_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::WARNINGS, + mobile_apis::Result::WRONG_LANGUAGE, + mobile_apis::Result::RETRY, + mobile_apis::Result::SAVED); +} + bool CommandRequestImpl::PrepareResultForMobileResponse( hmi_apis::Common_Result::eType result_code, HmiInterfaces::InterfaceID interface) const { diff --git a/src/components/application_manager/src/commands/command_request_to_mobile.cc b/src/components/application_manager/src/commands/command_request_to_mobile.cc new file mode 100644 index 0000000000..e1ed06e887 --- /dev/null +++ b/src/components/application_manager/src/commands/command_request_to_mobile.cc @@ -0,0 +1,72 @@ +/* + Copyright (c) 2014, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/command_request_to_mobile.h" +#include "application_manager/rpc_service.h" + +namespace application_manager { + +namespace commands { + +CommandRequestToMobile::CommandRequestToMobile( + const MessageSharedPtr& message, + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) + : CommandImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handler) {} + +CommandRequestToMobile::~CommandRequestToMobile() {} + +bool CommandRequestToMobile::Init() { + return true; +} + +bool CommandRequestToMobile::CleanUp() { + return true; +} + +void CommandRequestToMobile::Run() { + SendRequest(); +} + +void CommandRequestToMobile::SendRequest() { + rpc_service_.SendMessageToMobile(message_); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/command_response_from_mobile.cc b/src/components/application_manager/src/commands/command_response_from_mobile.cc new file mode 100644 index 0000000000..dfed65b134 --- /dev/null +++ b/src/components/application_manager/src/commands/command_response_from_mobile.cc @@ -0,0 +1,71 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/commands/command_response_from_mobile.h" +#include "application_manager/rpc_service.h" +#include "smart_objects/smart_object.h" + +namespace application_manager { + +namespace commands { + +CommandResponseFromMobile::CommandResponseFromMobile( + const MessageSharedPtr& message, + ApplicationManager& application_manager, + rpc_service::RPCService& rpc_service, + HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handle) + : CommandImpl(message, + application_manager, + rpc_service, + hmi_capabilities, + policy_handle) {} + +CommandResponseFromMobile::~CommandResponseFromMobile() {} + +bool CommandResponseFromMobile::Init() { + return true; +} + +bool CommandResponseFromMobile::CleanUp() { + return true; +} + +void CommandResponseFromMobile::Run() {} + +void CommandResponseFromMobile::SendResponse() { + rpc_service_.ManageMobileCommand(message_, SOURCE_SDL); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc index 75e49b180e..5e1314bad3 100644 --- a/src/components/application_manager/src/commands/notification_from_hmi.cc +++ b/src/components/application_manager/src/commands/notification_from_hmi.cc @@ -73,6 +73,20 @@ void NotificationFromHMI::SendNotificationToMobile( rpc_service_.ManageMobileCommand(message, SOURCE_SDL); } +void NotificationFromHMI::SendNotificationToMobile( + const MessageSharedPtr& message, + const mobile_apis::FunctionID::eType& mobile_function_id) { + (*message)[strings::params][strings::message_type] = + static_cast<int32_t>(application_manager::MessageType::kNotification); + (*message)[strings::params][strings::function_id] = mobile_function_id; + rpc_service_.ManageMobileCommand(message, SOURCE_SDL); +} + +void NotificationFromHMI::SendNotificationToHMI(MessageSharedPtr& message) { + (*message)[strings::params][strings::protocol_type] = hmi_protocol_type_; + rpc_service_.ManageHMICommand(message, SOURCE_SDL_TO_HMI); +} + void NotificationFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { @@ -106,6 +120,12 @@ void NotificationFromHMI::CreateHMIRequest( } } +void NotificationFromHMI::SendNotificationToConsumers( + const mobile_apis::FunctionID::eType& mobile_function_id) { + SendNotificationToHMI(message_); + SendNotificationToMobile(message_, mobile_function_id); +} + } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc index ff760c2d2a..873d9a844f 100644 --- a/src/components/application_manager/src/commands/request_from_hmi.cc +++ b/src/components/application_manager/src/commands/request_from_hmi.cc @@ -31,8 +31,16 @@ */ #include "application_manager/commands/request_from_hmi.h" + +#include "application_manager/app_service_manager.h" #include "application_manager/application_manager.h" +#include "application_manager/request_info.h" #include "application_manager/rpc_service.h" +#include "utils/helpers.h" + +#include "smart_objects/enum_schema_item.h" + +#include "smart_objects/enum_schema_item.h" namespace application_manager { @@ -67,28 +75,37 @@ void RequestFromHMI::Run() {} void RequestFromHMI::on_event(const event_engine::Event& event) {} +void RequestFromHMI::on_event(const event_engine::MobileEvent& event) {} + void RequestFromHMI::SendResponse( const bool success, const uint32_t correlation_id, const hmi_apis::FunctionID::eType function_id, - const hmi_apis::Common_Result::eType result_code) { + const hmi_apis::Common_Result::eType result_code, + const smart_objects::SmartObject* response_params, + commands::Command::CommandSource source) { smart_objects::SmartObjectSPtr message = std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); FillCommonParametersOfSO(*message, correlation_id, function_id); (*message)[strings::params][strings::message_type] = MessageType::kResponse; - (*message)[strings::params][hmi_response::code] = 0; + (*message)[strings::params][hmi_response::code] = result_code; (*message)[strings::msg_params][strings::success] = success; (*message)[strings::msg_params][strings::result_code] = result_code; - rpc_service_.ManageHMICommand(message); + if (response_params) { + (*message)[strings::msg_params] = *response_params; + } + + rpc_service_.ManageHMICommand(message, source); } void RequestFromHMI::SendErrorResponse( const uint32_t correlation_id, const hmi_apis::FunctionID::eType function_id, const hmi_apis::Common_Result::eType result_code, - const std::string error_message) { + const std::string error_message, + commands::Command::CommandSource source) { smart_objects::SmartObjectSPtr message = std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); @@ -98,7 +115,7 @@ void RequestFromHMI::SendErrorResponse( (*message)[strings::params][hmi_response::code] = result_code; (*message)[strings::params][strings::error_msg] = error_message; - rpc_service_.ManageHMICommand(message); + rpc_service_.ManageHMICommand(message, source); } void RequestFromHMI::FillCommonParametersOfSO( @@ -111,5 +128,191 @@ void RequestFromHMI::FillCommonParametersOfSO( (message)[strings::params][strings::correlation_id] = correlation_id; } +bool RequestFromHMI::IsMobileResultSuccess( + mobile_apis::Result::eType result_code) const { + LOG4CXX_AUTO_TRACE(logger_); + using namespace helpers; + return Compare<mobile_apis::Result::eType, EQ, ONE>( + result_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::WARNINGS, + mobile_apis::Result::WRONG_LANGUAGE, + mobile_apis::Result::RETRY, + mobile_apis::Result::SAVED); +} + +bool RequestFromHMI::IsHMIResultSuccess( + hmi_apis::Common_Result::eType result_code, + HmiInterfaces::InterfaceID interface) const { + LOG4CXX_AUTO_TRACE(logger_); + using namespace helpers; + if (Compare<hmi_apis::Common_Result::eType, EQ, ONE>( + result_code, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS, + hmi_apis::Common_Result::WRONG_LANGUAGE, + hmi_apis::Common_Result::RETRY, + hmi_apis::Common_Result::SAVED)) { + return true; + } + + const HmiInterfaces::InterfaceState state = + application_manager_.hmi_interfaces().GetInterfaceState(interface); + if ((hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code) && + (HmiInterfaces::STATE_NOT_AVAILABLE != state)) { + return true; + } + return false; +} + +void RequestFromHMI::SendProviderRequest( + const mobile_apis::FunctionID::eType& mobile_function_id, + const hmi_apis::FunctionID::eType& hmi_function_id, + const smart_objects::SmartObject* msg, + bool use_events) { + LOG4CXX_AUTO_TRACE(logger_); + bool hmi_destination = false; + ApplicationSharedPtr app; + // Default error code and error message + std::string error_msg = "No app service provider available"; + hmi_apis::Common_Result::eType error_code = + hmi_apis::Common_Result::DATA_NOT_AVAILABLE; + + if ((*msg)[strings::msg_params].keyExists(strings::service_type)) { + std::string service_type = + (*msg)[strings::msg_params][strings::service_type].asString(); + application_manager_.GetAppServiceManager().GetProviderByType( + service_type, false, app, hmi_destination); + error_msg = "No app service provider with serviceType: " + service_type + + " is available"; + error_code = hmi_apis::Common_Result::DATA_NOT_AVAILABLE; + } else if ((*msg)[strings::msg_params].keyExists(strings::service_id)) { + std::string service_id = + (*msg)[strings::msg_params][strings::service_id].asString(); + application_manager_.GetAppServiceManager().GetProviderByID( + service_id, false, app, hmi_destination); + error_msg = "No app service provider with serviceId: " + service_id + + " is available"; + error_code = hmi_apis::Common_Result::INVALID_ID; + } + + if (hmi_destination) { + LOG4CXX_DEBUG(logger_, "Sending Request to HMI Provider"); + application_manager_.IncreaseForwardedRequestTimeout( + application_manager::request_controller::RequestInfo::HmiConnectoinKey, + correlation_id()); + SendHMIRequest(hmi_function_id, &(*msg)[strings::msg_params], use_events); + return; + } + + if (!app) { + LOG4CXX_DEBUG(logger_, "Invalid App Provider pointer"); + SendErrorResponse(correlation_id(), + static_cast<hmi_apis::FunctionID::eType>(function_id()), + error_code, + error_msg, + commands::Command::CommandSource::SOURCE_SDL_TO_HMI); + return; + } + + LOG4CXX_DEBUG(logger_, "Sending Request to Mobile Provider"); + application_manager_.IncreaseForwardedRequestTimeout( + application_manager::request_controller::RequestInfo::HmiConnectoinKey, + correlation_id()); + SendMobileRequest( + mobile_function_id, app, &(*msg)[strings::msg_params], use_events); +} + +void RequestFromHMI::SendMobileRequest( + const mobile_apis::FunctionID::eType& function_id, + const ApplicationSharedPtr app, + const smart_objects::SmartObject* msg_params, + bool use_events) { + smart_objects::SmartObjectSPtr result = + std::make_shared<smart_objects::SmartObject>(); + + const uint32_t mobile_correlation_id = + application_manager_.GetNextMobileCorrelationID(); + + smart_objects::SmartObject& request = *result; + + request[strings::params][strings::message_type] = MessageType::kRequest; + request[strings::params][strings::function_id] = function_id; + request[strings::params][strings::correlation_id] = mobile_correlation_id; + request[strings::params][strings::protocol_version] = app->protocol_version(); + request[strings::params][strings::protocol_type] = + CommandImpl::mobile_protocol_type_; + + request[strings::params][strings::connection_key] = app->app_id(); + + if (msg_params) { + request[strings::msg_params] = *msg_params; + } + + if (use_events) { + LOG4CXX_DEBUG(logger_, + "RequestFromHMI subscribe_on_event " + << function_id << " " << mobile_correlation_id); + subscribe_on_event(function_id, mobile_correlation_id); + } + if (!rpc_service_.ManageMobileCommand( + result, commands::Command::CommandSource::SOURCE_SDL)) { + LOG4CXX_ERROR(logger_, "Unable to send request to mobile"); + } +} + +void RequestFromHMI::SendHMIRequest( + const hmi_apis::FunctionID::eType& function_id, + const smart_objects::SmartObject* msg_params, + bool use_events) { + smart_objects::SmartObjectSPtr result = + std::make_shared<smart_objects::SmartObject>(); + + const uint32_t hmi_correlation_id = + application_manager_.GetNextHMICorrelationID(); + + smart_objects::SmartObject& request = *result; + request[strings::params][strings::message_type] = MessageType::kRequest; + request[strings::params][strings::function_id] = function_id; + request[strings::params][strings::correlation_id] = hmi_correlation_id; + request[strings::params][strings::protocol_type] = + CommandImpl::hmi_protocol_type_; + + if (msg_params) { + request[strings::msg_params] = *msg_params; + } + + if (use_events) { + LOG4CXX_DEBUG(logger_, + "RequestFromHMI subscribe_on_event " << function_id << " " + << hmi_correlation_id); + subscribe_on_event(function_id, hmi_correlation_id); + } + if (ProcessHMIInterfacesAvailability(hmi_correlation_id, function_id)) { + if (!rpc_service_.ManageHMICommand( + result, commands::Command::CommandSource::SOURCE_SDL_TO_HMI)) { + LOG4CXX_ERROR(logger_, "Unable to send request"); + } + } else { + LOG4CXX_DEBUG(logger_, "Interface is not available"); + } +} + +bool RequestFromHMI::ProcessHMIInterfacesAvailability( + const uint32_t hmi_correlation_id, + const hmi_apis::FunctionID::eType& function_id) { + LOG4CXX_AUTO_TRACE(logger_); + HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces(); + HmiInterfaces::InterfaceID interface = + hmi_interfaces.GetInterfaceFromFunction(function_id); + DCHECK(interface != HmiInterfaces::HMI_INTERFACE_INVALID_ENUM); + const HmiInterfaces::InterfaceState state = + hmi_interfaces.GetInterfaceState(interface); + if (HmiInterfaces::STATE_NOT_AVAILABLE == state) { + return false; + } + return true; +} + } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/event_engine/event.cc b/src/components/application_manager/src/event_engine/event.cc index cc180ca950..ecdeb41a2e 100644 --- a/src/components/application_manager/src/event_engine/event.cc +++ b/src/components/application_manager/src/event_engine/event.cc @@ -48,5 +48,17 @@ void Event::set_smart_object(const smart_objects::SmartObject& so) { response_so_ = so; } +MobileEvent::MobileEvent(const MobileEventID& id) : id_(id), response_so_() {} + +MobileEvent::~MobileEvent() {} + +void MobileEvent::raise(EventDispatcher& event_dispatcher) { + event_dispatcher.raise_mobile_event(*this); +} + +void MobileEvent::set_smart_object(const smart_objects::SmartObject& so) { + response_so_ = so; +} + } // namespace event_engine } // namespace application_manager diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc index f1e5bf9735..30b1b83e79 100644 --- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc +++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc @@ -31,9 +31,9 @@ */ #include "application_manager/event_engine/event_dispatcher_impl.h" -#include "interfaces/HMI_API.h" -#include "application_manager/event_engine/event_observer.h" #include <algorithm> +#include "application_manager/event_engine/event_observer.h" +#include "interfaces/HMI_API.h" namespace application_manager { namespace event_engine { @@ -122,5 +122,78 @@ void EventDispatcherImpl::remove_observer_from_vector(EventObserver& observer) { observers_.end()); } +// Mobile Events + +void EventDispatcherImpl::raise_mobile_event(const MobileEvent& event) { + AutoLock observer_lock(mobile_observer_lock_); + { + AutoLock state_lock(mobile_state_lock_); + + // check if event is notification + if (mobile_apis::messageType::notification == event.smart_object_type()) { + const uint32_t notification_correlation_id = 0; + mobile_observers_ = + mobile_observers_event_[event.id()][notification_correlation_id]; + } + + if (mobile_apis::messageType::response == event.smart_object_type()) { + mobile_observers_ = + mobile_observers_event_[event.id()] + [event.smart_object_correlation_id()]; + } + } + + // Call observers + while (!mobile_observers_.empty()) { + EventObserver* temp = *mobile_observers_.begin(); + mobile_observers_.erase(mobile_observers_.begin()); + AutoUnlock unlock_observer(observer_lock); + temp->on_event(event); + } +} + +void EventDispatcherImpl::add_mobile_observer( + const MobileEvent::MobileEventID& event_id, + int32_t mobile_correlation_id, + EventObserver& observer) { + AutoLock auto_lock(mobile_state_lock_); + mobile_observers_event_[event_id][mobile_correlation_id].push_back(&observer); +} + +void EventDispatcherImpl::remove_mobile_observer( + const MobileEvent::MobileEventID& event_id, EventObserver& observer) { + remove_mobile_observer_from_vector(observer); + AutoLock auto_lock(mobile_state_lock_); + ObserversMap::iterator it = mobile_observers_event_[event_id].begin(); + + for (; mobile_observers_event_[event_id].end() != it; ++it) { + ObserverVector& obs_vec = it->second; + const ObserverVector::iterator obs_vec_it = obs_vec.end(); + obs_vec.erase( + std::remove_if( + obs_vec.begin(), obs_vec_it, IdCheckFunctor(observer.id())), + obs_vec_it); + } +} + +void EventDispatcherImpl::remove_mobile_observer(EventObserver& observer) { + remove_mobile_observer_from_vector(observer); + MobileEventObserverMap::iterator event_map = mobile_observers_event_.begin(); + + for (; mobile_observers_event_.end() != event_map; ++event_map) { + remove_mobile_observer(event_map->first, observer); + } +} + +void EventDispatcherImpl::remove_mobile_observer_from_vector( + EventObserver& observer) { + AutoLock auto_lock(mobile_observer_lock_); + + mobile_observers_.erase( + std::remove_if( + observers_.begin(), observers_.end(), IdCheckFunctor(observer.id())), + observers_.end()); +} + } // namespace event_engine } // namespace application_manager diff --git a/src/components/application_manager/src/event_engine/event_observer.cc b/src/components/application_manager/src/event_engine/event_observer.cc index f89f6649b1..fc252d3125 100644 --- a/src/components/application_manager/src/event_engine/event_observer.cc +++ b/src/components/application_manager/src/event_engine/event_observer.cc @@ -44,7 +44,8 @@ EventObserver::EventObserver(EventDispatcher& event_dispatcher) } EventObserver::~EventObserver() { - unsubscribe_from_all_events(); + unsubscribe_from_all_hmi_events(); + unsubscribe_from_all_mobile_events(); } void EventObserver::subscribe_on_event(const Event::EventID& event_id, @@ -60,5 +61,25 @@ void EventObserver::unsubscribe_from_all_events() { event_dispatcher_.remove_observer(*this); } +void EventObserver::unsubscribe_from_all_hmi_events() { + event_dispatcher_.remove_observer(*this); +} + +void EventObserver::subscribe_on_event( + const MobileEvent::MobileEventID& event_id, int32_t mobile_correlation_id) { + event_dispatcher_.add_mobile_observer(event_id, mobile_correlation_id, *this); +} + +void EventObserver::unsubscribe_from_event( + const MobileEvent::MobileEventID& event_id) { + event_dispatcher_.remove_mobile_observer(event_id, *this); +} + +void EventObserver::unsubscribe_from_all_mobile_events() { + event_dispatcher_.remove_mobile_observer(*this); +} + +void EventObserver::on_event(const event_engine::MobileEvent& event) {} + } // namespace event_engine } // namespace application_manager diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc index 016e09635b..ec883e5fc2 100644 --- a/src/components/application_manager/src/help_prompt_manager_impl.cc +++ b/src/components/application_manager/src/help_prompt_manager_impl.cc @@ -28,7 +28,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #include "application_manager/help_prompt_manager_impl.h" @@ -90,9 +90,9 @@ bool HelpPromptManagerImpl::AddCommand( const bool limit_exceeded = kLimitCommand <= GetCommandsCount(vr_commands_.end()); - LOG4CXX_DEBUG(logger_, - "Will be added first command from array " - << strings::vr_commands); + LOG4CXX_DEBUG( + logger_, + "Will be added first command from array " << strings::vr_commands); smart_objects::SmartObjectSPtr vr_item = std::make_shared<smart_objects::SmartObject>(commands.asArray()->front()); diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc index 59f1c6caf2..fc86eb5e62 100644 --- a/src/components/application_manager/src/helpers/application_helper.cc +++ b/src/components/application_manager/src/helpers/application_helper.cc @@ -1,9 +1,9 @@ -#include <vector> -#include <string> #include "application_manager/helpers/application_helper.h" +#include <string> +#include <vector> #include "application_manager/message_helper.h" -#include "utils/logger.h" #include "utils/file_system.h" +#include "utils/logger.h" namespace { using namespace application_manager; diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index f67590543d..0f5bc80d56 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -32,20 +32,22 @@ #include <map> -#include "utils/logger.h" +#include "application_manager/application_manager.h" #include "application_manager/hmi_capabilities_impl.h" -#include "application_manager/application_manager_impl.h" -#include "smart_objects/smart_object.h" #include "application_manager/message_helper.h" #include "application_manager/smart_object_keys.h" #include "config_profile/profile.h" #include "formatters/CFormatterJsonBase.h" #include "interfaces/HMI_API.h" +#include "smart_objects/smart_object.h" #include "utils/file_system.h" +#include "utils/logger.h" namespace application_manager { namespace formatters = ns_smart_device_link::ns_json_handler::formatters; +CREATE_LOGGERPTR_GLOBAL(logger_, "HMICapabilities") + namespace { std::map<std::string, hmi_apis::Common_VrCapabilities::eType> vr_enum_capabilities; @@ -912,7 +914,8 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { hmi_apis::Common_TextFieldName::eType>::const_iterator it_text_field_name = text_fields_enum_name.find( display_capabilities_so[hmi_response::text_fields][i] - [strings::name].asString()); + [strings::name] + .asString()); display_capabilities_so[hmi_response::text_fields][i].erase( strings::name); if (text_fields_enum_name.end() != it_text_field_name) { @@ -1029,19 +1032,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { smart_objects::SmartObject(smart_objects::SmartType_Map); if (check_existing_json_member(audio_capabilities, "samplingRate")) { audio_capabilities_so["samplingRate"] = - sampling_rate_enum.find(audio_capabilities.get("samplingRate", "") - .asString())->second; + sampling_rate_enum + .find(audio_capabilities.get("samplingRate", "").asString()) + ->second; } if (check_existing_json_member(audio_capabilities, "bitsPerSample")) { audio_capabilities_so["bitsPerSample"] = - bit_per_sample_enum.find(audio_capabilities.get("bitsPerSample", - "").asString()) + bit_per_sample_enum + .find(audio_capabilities.get("bitsPerSample", "").asString()) ->second; } if (check_existing_json_member(audio_capabilities, "audioType")) { audio_capabilities_so["audioType"] = - audio_type_enum.find(audio_capabilities.get("audioType", "") - .asString())->second; + audio_type_enum + .find(audio_capabilities.get("audioType", "").asString()) + ->second; } set_audio_pass_thru_capabilities(audio_capabilities_so); } @@ -1053,18 +1058,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { if (check_existing_json_member(pcm_capabilities, "samplingRate")) { pcm_capabilities_so["samplingRate"] = - sampling_rate_enum.find(pcm_capabilities.get("samplingRate", "") - .asString())->second; + sampling_rate_enum + .find(pcm_capabilities.get("samplingRate", "").asString()) + ->second; } if (check_existing_json_member(pcm_capabilities, "bitsPerSample")) { pcm_capabilities_so["bitsPerSample"] = - bit_per_sample_enum.find(pcm_capabilities.get("bitsPerSample", "") - .asString())->second; + bit_per_sample_enum + .find(pcm_capabilities.get("bitsPerSample", "").asString()) + ->second; } if (check_existing_json_member(pcm_capabilities, "audioType")) { pcm_capabilities_so["audioType"] = - audio_type_enum.find(pcm_capabilities.get("audioType", "") - .asString())->second; + audio_type_enum + .find(pcm_capabilities.get("audioType", "").asString()) + ->second; } set_pcm_stream_capabilities(pcm_capabilities_so); @@ -1170,6 +1178,20 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { smart_objects::SmartObject rc_capability_so; formatters::CFormatterJsonBase::jsonValueToObj(rc_capability, rc_capability_so); + if (rc_capability_so.keyExists("lightControlCapabilities")) { + if (rc_capability_so["lightControlCapabilities"].keyExists( + "supportedLights")) { + auto& lights = rc_capability_so["lightControlCapabilities"] + ["supportedLights"]; + auto it = lights.asArray()->begin(); + for (; it != lights.asArray()->end(); ++it) { + smart_objects::SmartObject& light_name_so = (*it)["name"]; + auto light_name = MessageHelper::CommonLightNameFromString( + light_name_so.asString()); + light_name_so = light_name; + } + } + } set_rc_capability(rc_capability_so); if (!rc_capability_so.empty()) { set_rc_supported(true); diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc index 3e7341ccf4..6fd17953d6 100644 --- a/src/components/application_manager/src/hmi_interfaces_impl.cc +++ b/src/components/application_manager/src/hmi_interfaces_impl.cc @@ -103,6 +103,10 @@ generate_function_to_interface_convert_map() { HmiInterfaces::HMI_INTERFACE_BasicCommunication; convert_map[BasicCommunication_OnEventChanged] = HmiInterfaces::HMI_INTERFACE_BasicCommunication; + convert_map[BasicCommunication_GetFilePath] = + HmiInterfaces::HMI_INTERFACE_BasicCommunication; + convert_map[BasicCommunication_CloseApplication] = + HmiInterfaces::HMI_INTERFACE_BasicCommunication; convert_map[VR_IsReady] = HmiInterfaces::HMI_INTERFACE_VR; convert_map[VR_Started] = HmiInterfaces::HMI_INTERFACE_VR; convert_map[VR_Stopped] = HmiInterfaces::HMI_INTERFACE_VR; @@ -228,6 +232,14 @@ generate_function_to_interface_convert_map() { HmiInterfaces::HMI_INTERFACE_RC; convert_map[RC_OnInteriorVehicleData] = HmiInterfaces::HMI_INTERFACE_RC; convert_map[RC_OnRemoteControlSettings] = HmiInterfaces::HMI_INTERFACE_RC; + convert_map[AppService_PublishAppService] = + HmiInterfaces::HMI_INTERFACE_AppService; + convert_map[AppService_GetAppServiceData] = + HmiInterfaces::HMI_INTERFACE_AppService; + convert_map[AppService_PerformAppServiceInteraction] = + HmiInterfaces::HMI_INTERFACE_AppService; + convert_map[AppService_GetActiveServiceConsent] = + HmiInterfaces::HMI_INTERFACE_AppService; return convert_map; } @@ -251,6 +263,8 @@ HmiInterfacesImpl::HmiInterfacesImpl() { HmiInterfaces::STATE_NOT_RESPONSE; interfaces_states_[HmiInterfaces::HMI_INTERFACE_RC] = HmiInterfaces::STATE_NOT_RESPONSE; + interfaces_states_[HmiInterfaces::HMI_INTERFACE_AppService] = + HmiInterfaces::STATE_NOT_RESPONSE; } HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState( diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc index 6e89b2419c..e206633ae2 100644 --- a/src/components/application_manager/src/hmi_language_handler.cc +++ b/src/components/application_manager/src/hmi_language_handler.cc @@ -28,16 +28,16 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. -*/ + */ #include "application_manager/hmi_language_handler.h" #include "application_manager/application_manager.h" +#include "application_manager/hmi_capabilities.h" #include "application_manager/message_helper.h" #include "application_manager/rpc_service.h" -#include "application_manager/hmi_capabilities.h" -#include "utils/helpers.h" #include "resumption/last_state.h" #include "smart_objects/smart_object.h" +#include "utils/helpers.h" static const std::string LanguagesKey = "Languages"; static const std::string UIKey = "UI"; @@ -78,9 +78,9 @@ void HMILanguageHandler::set_language_for( LOG4CXX_WARN(logger_, "Unknown interface has been passed " << interface); return; } - LOG4CXX_DEBUG(logger_, - "Setting language " << language << " for interface " - << interface); + LOG4CXX_DEBUG( + logger_, + "Setting language " << language << " for interface " << interface); Json::Value& dictionary = last_state_->get_dictionary(); dictionary[LanguagesKey][key] = language; return; @@ -273,8 +273,9 @@ void HMILanguageHandler::VerifyWithPersistedLanguages() { LOG4CXX_INFO(logger_, "Application with app_id " - << app->app_id() << " will be unregistered because of " - "HMI language(s) mismatch."); + << app->app_id() + << " will be unregistered because of " + "HMI language(s) mismatch."); CheckApplication(std::make_pair(app->app_id(), false)); } @@ -284,7 +285,7 @@ void HMILanguageHandler::VerifyWithPersistedLanguages() { LOG4CXX_DEBUG(logger_, "No registered apps found. HMILanguageHandler unsubscribed " "from all events."); - unsubscribe_from_all_events(); + unsubscribe_from_all_hmi_events(); } } @@ -304,7 +305,7 @@ void HMILanguageHandler::HandleWrongLanguageApp(const Apps::value_type& app) { if (0 == apps_.size()) { LOG4CXX_DEBUG(logger_, "HMILanguageHandler unsubscribed from all events."); - unsubscribe_from_all_events(); + unsubscribe_from_all_hmi_events(); } } SendOnLanguageChangeToMobile(app.first); diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index 7be9668543..77880eddc0 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -32,9 +32,9 @@ */ #include "application_manager/hmi_state.h" -#include <ostream> #include <boost/assign.hpp> #include <boost/bimap.hpp> +#include <ostream> #include "application_manager/application_manager.h" #include "utils/helpers.h" @@ -45,7 +45,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState") HmiState::HmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr, StateID state_id) - : app_(app) + : hmi_app_id_(app->hmi_app_id()) , state_id_(state_id) , app_mngr_(app_mngr) , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM) @@ -57,7 +57,7 @@ HmiState::HmiState(std::shared_ptr<Application> app, HmiState::HmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) - : app_(app) + : hmi_app_id_(app->hmi_app_id()) , state_id_(STATE_ID_REGULAR) , app_mngr_(app_mngr) , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM) @@ -73,19 +73,27 @@ void HmiState::set_parent(HmiStatePtr parent) { } bool HmiState::is_navi_app() const { - return app_->is_navi(); + const ApplicationSharedPtr app = + app_mngr_.application_by_hmi_app(hmi_app_id_); + return app ? app->is_navi() : false; } bool HmiState::is_media_app() const { - return app_->is_media_application(); + const ApplicationSharedPtr app = + app_mngr_.application_by_hmi_app(hmi_app_id_); + return app ? app->is_media_application() : false; } bool HmiState::is_voice_communication_app() const { - return app_->is_voice_communication_supported(); + const ApplicationSharedPtr app = + app_mngr_.application_by_hmi_app(hmi_app_id_); + return app ? app->is_voice_communication_supported() : false; } bool HmiState::is_mobile_projection_app() const { - return app_->mobile_projection_enabled(); + const ApplicationSharedPtr app = + app_mngr_.application_by_hmi_app(hmi_app_id_); + return app ? app->mobile_projection_enabled() : false; } mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state() @@ -123,7 +131,9 @@ VideoStreamingHmiState::VideoStreamingHmiState( mobile_apis::VideoStreamingState::eType VideoStreamingHmiState::video_streaming_state() const { - if (app_->IsVideoApplication()) { + const ApplicationSharedPtr app = + app_mngr_.application_by_hmi_app(hmi_app_id_); + if (app && app->IsVideoApplication()) { return parent()->video_streaming_state(); } @@ -201,7 +211,7 @@ AudioSource::AudioSource(std::shared_ptr<Application> app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE) , keep_context_(app->keep_context()) { - app_->set_keep_context(false); + app->set_keep_context(false); } mobile_apis::HMILevel::eType AudioSource::hmi_level() const { @@ -260,7 +270,15 @@ std::ostream& operator<<(std::ostream& os, const HmiState::StateID src) { } std::ostream& operator<<(std::ostream& os, const HmiState& src) { - os << "HMIState(app id:" << src.app_->app_id() << ", state:" << src.state_id() + const ApplicationSharedPtr app = + src.app_mngr_.application_by_hmi_app(src.hmi_app_id_); + os << "HMIState(app id:"; + if (app) { + os << app->app_id(); + } else { + os << "(none)"; + } + os << ", hmi app id:" << src.hmi_app_id_ << ", state:" << src.state_id() << ", hmi_level:" << src.hmi_level() << ", audio:" << src.audio_streaming_state() << ", video:" << src.video_streaming_state() diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc index 332d68adbf..2ec5891ae3 100644 --- a/src/components/application_manager/src/message.cc +++ b/src/components/application_manager/src/message.cc @@ -36,7 +36,7 @@ namespace { bool BinaryDataPredicate(uint8_t i, uint8_t j) { return (i == j); } -} +} // namespace namespace application_manager { 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 e99db3bece..8dc57b96b0 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -39,13 +39,13 @@ #include <inttypes.h> #undef __STDC_FORMAT_MACROS -#include <set> -#include <string> #include <strings.h> #include <algorithm> -#include <utility> -#include <map> #include <functional> +#include <map> +#include <set> +#include <string> +#include <utility> #include "application_manager/application.h" #include "application_manager/application_manager.h" @@ -55,18 +55,18 @@ #include "application_manager/resumption/resume_ctrl.h" #include "application_manager/rpc_service.h" #include "connection_handler/connection_handler_impl.h" -#include "transport_manager/common.h" #include "interfaces/MOBILE_API.h" #include "smart_objects/enum_schema_item.h" +#include "transport_manager/common.h" #include "utils/file_system.h" -#include "utils/macro.h" #include "utils/logger.h" +#include "utils/macro.h" -#include "formatters/formatter_json_rpc.h" -#include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/CFormatterJsonBase.h" #include "formatters/CFormatterJsonSDLRPCv1.h" +#include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/formatter_json_rpc.h" #include "json/json.h" -#include "formatters/CFormatterJsonBase.h" CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") @@ -162,69 +162,81 @@ struct ExternalConsentStatusAppender } // namespace -std::pair<std::string, - mobile_apis::VehicleDataType::eType> kVehicleDataInitializer[] = { - std::make_pair(strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS), - std::make_pair(strings::speed, - mobile_apis::VehicleDataType::VEHICLEDATA_SPEED), - std::make_pair(strings::rpm, mobile_apis::VehicleDataType::VEHICLEDATA_RPM), - std::make_pair(strings::fuel_level, - mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL), - std::make_pair(strings::fuel_level_state, - mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE), - std::make_pair(strings::instant_fuel_consumption, - mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION), - std::make_pair(strings::fuel_range, - mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE), - std::make_pair(strings::external_temp, - mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP), - std::make_pair(strings::turn_signal, - mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL), - std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN), - std::make_pair(strings::prndl, - mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL), - std::make_pair(strings::tire_pressure, - mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE), - std::make_pair(strings::odometer, - mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER), - std::make_pair(strings::belt_status, - mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS), - std::make_pair( - strings::electronic_park_brake_status, - mobile_apis::VehicleDataType::VEHICLEDATA_ELECTRONICPARKBRAKESTATUS), - std::make_pair(strings::body_information, - mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO), - std::make_pair(strings::device_status, - mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS), - std::make_pair(strings::driver_braking, - mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING), - std::make_pair(strings::wiper_status, - mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS), - std::make_pair(strings::head_lamp_status, - mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS), - std::make_pair(strings::e_call_info, - mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO), - std::make_pair(strings::airbag_status, - mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS), - std::make_pair(strings::emergency_event, - mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT), - std::make_pair(strings::cluster_mode_status, - mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS), - std::make_pair(strings::my_key, - mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY), - /* - NOT DEFINED in mobile API - std::make_pair(strings::gps, - BATTVOLTAGE), - */ - std::make_pair(strings::engine_torque, - mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE), - std::make_pair(strings::acc_pedal_pos, - mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL), - std::make_pair(strings::steering_wheel_angle, - mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL), - std::make_pair(strings::engine_oil_life, - mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)}; +std::pair<std::string, mobile_apis::VehicleDataType::eType> + kVehicleDataInitializer[] = { + std::make_pair(strings::gps, + mobile_apis::VehicleDataType::VEHICLEDATA_GPS), + std::make_pair(strings::speed, + mobile_apis::VehicleDataType::VEHICLEDATA_SPEED), + std::make_pair(strings::rpm, + mobile_apis::VehicleDataType::VEHICLEDATA_RPM), + std::make_pair(strings::fuel_level, + mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL), + std::make_pair( + strings::fuel_level_state, + mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE), + std::make_pair( + strings::instant_fuel_consumption, + mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION), + std::make_pair(strings::fuel_range, + mobile_apis::VehicleDataType::VEHICLEDATA_FUELRANGE), + std::make_pair( + strings::cloud_app_vehicle_id, + mobile_apis::VehicleDataType::VEHICLEDATA_CLOUDAPPVEHICLEID), + std::make_pair(strings::external_temp, + mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP), + std::make_pair(strings::turn_signal, + mobile_apis::VehicleDataType::VEHICLEDATA_TURNSIGNAL), + std::make_pair(strings::vin, + mobile_apis::VehicleDataType::VEHICLEDATA_VIN), + std::make_pair(strings::prndl, + mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL), + std::make_pair(strings::tire_pressure, + mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE), + std::make_pair(strings::odometer, + mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER), + std::make_pair(strings::belt_status, + mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS), + std::make_pair(strings::electronic_park_brake_status, + mobile_apis::VehicleDataType:: + VEHICLEDATA_ELECTRONICPARKBRAKESTATUS), + std::make_pair(strings::body_information, + mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO), + std::make_pair(strings::device_status, + mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS), + std::make_pair(strings::driver_braking, + mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING), + std::make_pair(strings::wiper_status, + mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS), + std::make_pair( + strings::head_lamp_status, + mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS), + std::make_pair(strings::e_call_info, + mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO), + std::make_pair(strings::airbag_status, + mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS), + std::make_pair( + strings::emergency_event, + mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT), + std::make_pair( + strings::cluster_mode_status, + mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS), + std::make_pair(strings::my_key, + mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY), + /* + NOT DEFINED in mobile API + std::make_pair(strings::gps, + BATTVOLTAGE), + */ + std::make_pair(strings::engine_torque, + mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE), + std::make_pair(strings::acc_pedal_pos, + mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL), + std::make_pair(strings::steering_wheel_angle, + mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL), + std::make_pair( + strings::engine_oil_life, + mobile_apis::VehicleDataType::VEHICLEDATA_ENGINEOILLIFE)}; const VehicleData MessageHelper::vehicle_data_( kVehicleDataInitializer, @@ -288,6 +300,17 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString( return hmi_apis::Common_Language::INVALID_ENUM; } +hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString( + const std::string& lightName) { + using namespace ns_smart_device_link::ns_smart_objects; + hmi_apis::Common_LightName::eType value; + if (EnumConversionHelper<hmi_apis::Common_LightName::eType>::StringToEnum( + lightName, &value)) { + return value; + } + return hmi_apis::Common_LightName::INVALID_ENUM; +} + std::string MessageHelper::GetDeviceMacAddressForHandle( const transport_manager::DeviceHandle device_handle, const ApplicationManager& app_mngr) { @@ -325,6 +348,51 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI( return message; } +void MessageHelper::BroadcastCapabilityUpdate( + smart_objects::SmartObject& msg_params, ApplicationManager& app_mngr) { + LOG4CXX_AUTO_TRACE(logger_); + smart_objects::SmartObject message(smart_objects::SmartType_Map); + + message[strings::params][strings::message_type] = MessageType::kNotification; + message[strings::msg_params] = msg_params; + + // Construct and send mobile notification + message[strings::params][strings::function_id] = + mobile_apis::FunctionID::OnSystemCapabilityUpdatedID; + smart_objects::SmartObjectSPtr notification = + std::make_shared<smart_objects::SmartObject>(message); + app_mngr.GetRPCService().ManageMobileCommand( + notification, commands::Command::CommandSource::SOURCE_SDL); + + // Construct and send HMI notification + message[strings::params][strings::function_id] = + hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated; + smart_objects::SmartObjectSPtr hmi_notification = + std::make_shared<smart_objects::SmartObject>(message); + app_mngr.GetRPCService().ManageHMICommand(hmi_notification); +} + +smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities( + std::vector<smart_objects::SmartObject>& all_services) { + smart_objects::SmartObject app_service_capabilities( + smart_objects::SmartType_Map); + smart_objects::SmartObject app_services(smart_objects::SmartType_Array); + + std::vector<smart_objects::SmartObject> service_records = all_services; + + int i = 0; + for (auto& record : service_records) { + smart_objects::SmartObject app_service_capability( + smart_objects::SmartType_Map); + app_service_capability[strings::updated_app_service_record] = record; + app_services[i] = app_service_capability; + i++; + } + + app_service_capabilities[strings::app_services] = app_services; + return app_service_capabilities; +} + smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification( const uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); @@ -1072,12 +1140,11 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI( auto& help_prompt_manager = const_cast<Application*>(app.get())->help_prompt_manager(); - const bool can_send_ui = helpers::Compare<HelpPromptManager::SendingType, - helpers::EQ, - helpers::ONE>( - help_prompt_manager.GetSendingType(), - HelpPromptManager::SendingType::kSendVRHelp, - HelpPromptManager::SendingType::kSendBoth); + const bool can_send_ui = helpers:: + Compare<HelpPromptManager::SendingType, helpers::EQ, helpers::ONE>( + help_prompt_manager.GetSendingType(), + HelpPromptManager::SendingType::kSendVRHelp, + HelpPromptManager::SendingType::kSendBoth); // UI global properties @@ -1115,12 +1182,11 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI( requests.push_back(ui_global_properties); } - const bool can_send_vr = helpers::Compare<HelpPromptManager::SendingType, - helpers::EQ, - helpers::ONE>( - help_prompt_manager.GetSendingType(), - HelpPromptManager::SendingType::kSendHelpPrompt, - HelpPromptManager::SendingType::kSendBoth); + const bool can_send_vr = helpers:: + Compare<HelpPromptManager::SendingType, helpers::EQ, helpers::ONE>( + help_prompt_manager.GetSendingType(), + HelpPromptManager::SendingType::kSendHelpPrompt, + HelpPromptManager::SendingType::kSendBoth); // TTS global properties if (can_send_vr && (app->help_prompt() || app->timeout_prompt())) { @@ -1540,15 +1606,20 @@ bool MessageHelper::CreateHMIApplicationStruct( message = smart_objects::SmartObject(smart_objects::SmartType_Map); message[strings::app_name] = app->name(); message[strings::app_id] = app->hmi_app_id(); + + const std::string policy_app_id = app->policy_app_id(); + message[hmi_response::policy_app_id] = policy_app_id; + const std::string icon_path = app->app_icon_path(); - if (!icon_path.empty()) { + + if (file_system::FileExists(app->app_icon_path())) { message[strings::icon] = icon_path; } if (app->IsRegistered()) { message[strings::hmi_display_language_desired] = app->ui_language(); message[strings::is_media_application] = app->is_media_application(); } else { - message[strings::greyOut] = app->is_greyed_out(); + message[strings::grey_out] = app->is_greyed_out(); } if (app->tts_name() && !app->tts_name()->empty()) { message[json::ttsName] = *(app->tts_name()); @@ -1564,6 +1635,46 @@ bool MessageHelper::CreateHMIApplicationStruct( message[strings::app_type] = *app_types; } + const policy::RequestType::State app_request_types_state = + policy_handler.GetAppRequestTypeState(policy_app_id); + if (policy::RequestType::State::AVAILABLE == app_request_types_state) { + const auto request_types = policy_handler.GetAppRequestTypes(policy_app_id); + message[strings::request_type] = + SmartObject(smart_objects::SmartType_Array); + smart_objects::SmartObject& request_types_array = + message[strings::request_type]; + + size_t index = 0; + for (auto it : request_types) { + request_types_array[index] = it; + ++index; + } + } else if (policy::RequestType::State::EMPTY == app_request_types_state) { + message[strings::request_type] = + SmartObject(smart_objects::SmartType_Array); + } + + const policy::RequestSubType::State app_request_subtypes_state = + policy_handler.GetAppRequestSubTypeState(policy_app_id); + if (policy::RequestSubType::State::AVAILABLE == app_request_subtypes_state) { + const auto request_subtypes = + policy_handler.GetAppRequestSubTypes(policy_app_id); + message[strings::request_subtype] = + SmartObject(smart_objects::SmartType_Array); + smart_objects::SmartObject& request_subtypes_array = + message[strings::request_subtype]; + + size_t index = 0; + for (auto it : request_subtypes) { + request_subtypes_array[index] = it; + ++index; + } + } else if (policy::RequestSubType::State::EMPTY == + app_request_subtypes_state) { + message[strings::request_subtype] = + SmartObject(smart_objects::SmartType_Array); + } + if (day_color_scheme) { message[strings::day_color_scheme] = *day_color_scheme; } @@ -1590,6 +1701,12 @@ bool MessageHelper::CreateHMIApplicationStruct( &secondary_device_info); } + message[strings::is_cloud_application] = app->is_cloud_app(); + if (app->is_cloud_app()) { + message[strings::cloud_connection_status] = + app_mngr.GetCloudAppConnectionStatus(app); + } + return true; } @@ -1672,12 +1789,16 @@ void MessageHelper::SendOnAppUnregNotificationToHMI( smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( ApplicationConstSharedPtr app, - const protocol_handler::SessionObserver& session_observer, const policy::PolicyHandlerInterface& policy_handler, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority, ApplicationManager& app_mngr) { DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr()); + if (hmi_apis::Common_HMILevel::NONE == level) { + LOG4CXX_WARN(logger_, + "BC.ActivateApp cannot be used to deactivate an application"); + return NULL; + } const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID(); smart_objects::SmartObjectSPtr message = @@ -1714,6 +1835,23 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( return message; } +smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI( + ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { + DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr()); + + const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID(); + smart_objects::SmartObjectSPtr message = + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map); + (*message)[strings::params][strings::function_id] = + hmi_apis::FunctionID::BasicCommunication_CloseApplication; + (*message)[strings::params][strings::message_type] = MessageType::kRequest; + (*message)[strings::params][strings::correlation_id] = correlation_id; + (*message)[strings::msg_params][strings::app_id] = app->app_id(); + + return message; +} + void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id, ApplicationManager& app_mngr) { LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id); @@ -2821,7 +2959,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons( } if ((!request_soft_buttons[i].keyExists(strings::text)) || (!VerifyString( - request_soft_buttons[i][strings::text].asString()))) { + request_soft_buttons[i][strings::text].asString()))) { return Result::INVALID_DATA; } break; @@ -2830,7 +2968,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons( if ((!request_soft_buttons[i].keyExists(strings::text)) || ((request_soft_buttons[i][strings::text].length()) && (!VerifyString( - request_soft_buttons[i][strings::text].asString())))) { + request_soft_buttons[i][strings::text].asString())))) { return Result::INVALID_DATA; } diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc index 1ee368a212..4c4cb251fc 100644 --- a/src/components/application_manager/src/mobile_message_handler.cc +++ b/src/components/application_manager/src/mobile_message_handler.cc @@ -32,12 +32,12 @@ #include <string.h> -#include "utils/macro.h" #include "application_manager/mobile_message_handler.h" -#include "protocol_handler/protocol_payload.h" #include "protocol_handler/protocol_packet.h" +#include "protocol_handler/protocol_payload.h" #include "utils/bitstream.h" #include "utils/logger.h" +#include "utils/macro.h" #include <stdint.h> #include <memory> @@ -48,7 +48,7 @@ const uint8_t kRequest = 0x0; const uint8_t kResponse = 0x1; const uint8_t kNotification = 0x2; const uint8_t kUnknown = 0xF; -} +} // namespace namespace application_manager { using protocol_handler::Extract; @@ -58,7 +58,7 @@ typedef std::map<MessageType, std::string> MessageTypeMap; MessageTypeMap message_types = {std::make_pair(kRequest, "Request"), std::make_pair(kResponse, "Response"), std::make_pair(kNotification, "Notification")}; -} +} // namespace CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") application_manager::Message* diff --git a/src/components/application_manager/src/plugin_manager/plugin_keys.cc b/src/components/application_manager/src/plugin_manager/plugin_keys.cc new file mode 100644 index 0000000000..80be2d1389 --- /dev/null +++ b/src/components/application_manager/src/plugin_manager/plugin_keys.cc @@ -0,0 +1,14 @@ +#include "application_manager/plugin_manager/plugin_keys.h" + +namespace application_manager { +namespace plugin_manager { + +namespace plugin_names { +const char* vehicle_info_rpc_plugin = "Vehicle Info RPC Plugin"; +const char* app_service_rpc_plugin = "App Service RPC Plugin"; +const char* rc_rpc_plugin = "RC RPC Plugin"; +const char* sdl_rpc_plugin = "SDL RPC Plugin"; +} // namespace plugin_names + +} // namespace plugin_manager +} // namespace application_manager
\ No newline at end of file diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc index 712b91afe7..ad313c638f 100644 --- a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc +++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc @@ -37,9 +37,9 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) { void* plugin_dll = dlopen(full_plugin_path.c_str(), RTLD_LAZY); if (nullptr == plugin_dll) { - LOG4CXX_ERROR(logger_, - "Failed to open dll " << full_plugin_path << " : " - << dlerror()); + LOG4CXX_ERROR( + logger_, + "Failed to open dll " << full_plugin_path << " : " << dlerror()); return RPCPluginPtr(); } @@ -54,7 +54,6 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) { return RPCPluginPtr(); } RPCPlugin* plugin = create_plugin(); - dlclose(plugin_dll); return RPCPluginPtr(plugin); } @@ -67,9 +66,9 @@ uint32_t RPCPluginManagerImpl::LoadPlugins(const std::string& plugins_path) { if (!plugin) { continue; } - LOG4CXX_DEBUG(logger_, - "Loaded " << plugin->PluginName() << " plugin from " - << full_name); + LOG4CXX_DEBUG( + logger_, + "Loaded " << plugin->PluginName() << " plugin from " << full_name); if (plugin->Init( app_manager_, rpc_service_, hmi_capabilities_, policy_handler_)) { loaded_plugins_.push_back(std::move(plugin)); diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc index f397814005..afe909fee4 100644 --- a/src/components/application_manager/src/policies/policy_event_observer.cc +++ b/src/components/application_manager/src/policies/policy_event_observer.cc @@ -31,10 +31,10 @@ */ #include "application_manager/policies/policy_event_observer.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/policies/policy_handler.h" -#include "utils/date_time.h" +#include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" +#include "utils/date_time.h" namespace policy { using namespace application_manager; @@ -55,6 +55,8 @@ void PolicyEventObserver::set_policy_handler( policy_handler_ = policy_handler; } +void PolicyEventObserver::on_event(const event_engine::MobileEvent& event) {} + void PolicyEventObserver::on_event(const event_engine::Event& event) { sync_primitives::AutoLock auto_lock(policy_handler_lock_); if (!policy_handler_) { diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 1b64c5d7b4..bee88633c1 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -30,33 +30,34 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "application_manager/policies/policy_handler.h" -#include <unistd.h> #include <dlfcn.h> +#include <unistd.h> #include <algorithm> -#include <vector> #include <functional> #include <utility> -#include "application_manager/smart_object_keys.h" -#include "application_manager/policies/delegates/app_permission_delegate.h" -#include "policy/status.h" +#include <vector> #include "application_manager/application_manager.h" -#include "application_manager/state_controller.h" #include "application_manager/message_helper.h" +#include "application_manager/policies/delegates/app_permission_delegate.h" #include "application_manager/rpc_service.h" -#include "policy/policy_manager_impl.h" +#include "application_manager/smart_object_keys.h" +#include "application_manager/state_controller.h" +#include "application_manager/usage_statistics.h" #include "connection_handler/connection_handler.h" -#include "utils/macro.h" -#include "utils/date_time.h" +#include "interfaces/MOBILE_API.h" #include "json/value.h" #include "json/writer.h" -#include "application_manager/usage_statistics.h" +#include "policy/policy_manager_impl.h" #include "policy/policy_types.h" -#include "interfaces/MOBILE_API.h" +#include "policy/status.h" +#include "smart_objects/enum_schema_item.h" +#include "utils/date_time.h" #include "utils/file_system.h" +#include "utils/macro.h" #include "utils/scope_guard.h" -#include "utils/helpers.h" #include "policy/policy_manager.h" +#include "utils/helpers.h" namespace policy { @@ -90,7 +91,8 @@ RequestTypeMap TypeToString = { {mobile_apis::RequestType::EMERGENCY, "EMERGENCY"}, {mobile_apis::RequestType::MEDIA, "MEDIA"}, {mobile_apis::RequestType::FOTA, "FOTA"}, - {mobile_apis::RequestType::OEM_SPECIFIC, "OEM_SPECIFIC"}}; + {mobile_apis::RequestType::OEM_SPECIFIC, "OEM_SPECIFIC"}, + {mobile_apis::RequestType::ICON_URL, "ICON_URL"}}; const std::string RequestTypeToString(mobile_apis::RequestType::eType type) { RequestTypeMap::const_iterator it = TypeToString.find(type); @@ -105,13 +107,12 @@ const policy::DeviceParams GetDeviceParams( const protocol_handler::SessionObserver& session_observer) { CREATE_LOGGERPTR_LOCAL(logger_, "PolicyHandler"); policy::DeviceParams device_params; - if (-1 == - session_observer.GetDataOnDeviceID( - device_handle, - &device_params.device_name, - NULL, - &device_params.device_mac_address, - &device_params.device_connection_type)) { + if (-1 == session_observer.GetDataOnDeviceID( + device_handle, + &device_params.device_name, + NULL, + &device_params.device_mac_address, + &device_params.device_connection_type)) { LOG4CXX_ERROR(logger_, "Failed to extract information for device " << device_handle); } @@ -176,41 +177,6 @@ struct DeactivateApplication { StateController& state_ctrl_; }; -struct SDLAllowedNotification { - SDLAllowedNotification(const connection_handler::DeviceHandle& device_id, - PolicyManager* policy_manager, - StateController& state_controller) - : device_id_(device_id) - , policy_manager_(policy_manager) - , state_controller_(state_controller) {} - - void operator()(const ApplicationSharedPtr& app) { - DCHECK_OR_RETURN_VOID(policy_manager_); - if (device_id_ == app->device()) { - std::string hmi_level = "NONE"; - mobile_apis::HMILevel::eType default_mobile_hmi; - policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level); - if ("BACKGROUND" == hmi_level) { - default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND; - } else if ("FULL" == hmi_level) { - default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL; - } else if ("LIMITED" == hmi_level) { - default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED; - } else if ("NONE" == hmi_level) { - default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE; - } else { - return; - } - state_controller_.SetRegularState(app, default_mobile_hmi, true); - } - } - - private: - connection_handler::DeviceHandle device_id_; - PolicyManager* policy_manager_; - StateController& state_controller_; -}; - /** * @brief Gets from system list of currently registered applications and * create collection of links device-to-application @@ -514,9 +480,9 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id, void PolicyHandler::SendOnAppPermissionsChanged( const AppPermissions& permissions, const std::string& policy_app_id) const { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "PolicyHandler::SendOnAppPermissionsChanged for " - << policy_app_id); + LOG4CXX_DEBUG( + logger_, + "PolicyHandler::SendOnAppPermissionsChanged for " << policy_app_id); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); if (app.use_count() == 0) { @@ -810,9 +776,9 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate( LOG4CXX_AUTO_TRACE(logger_); if (!value->IsRegistered()) { - LOG4CXX_DEBUG(logger_, - "Application " << value->app_id() - << " is not marked as registered."); + LOG4CXX_DEBUG( + logger_, + "Application " << value->app_id() << " is not marked as registered."); return false; } @@ -825,9 +791,9 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate( value->device(), application_manager_.connection_handler().get_session_observer()); - const bool is_device_allowed = (kDeviceAllowed == - policy_manager_->GetUserConsentForDevice( - device_params.device_mac_address)); + const bool is_device_allowed = + (kDeviceAllowed == policy_manager_->GetUserConsentForDevice( + device_params.device_mac_address)); LOG4CXX_DEBUG(logger_, "Is device " << device_params.device_mac_address << " allowed " @@ -934,9 +900,9 @@ void PolicyHandler::OnVehicleDataUpdated( POLICY_LIB_CHECK_VOID(); #ifdef EXTERNAL_PROPRIETARY_MODE if (!message.keyExists(strings::msg_params)) { - LOG4CXX_ERROR(logger_, - "Message does not contains mandatory section " - << strings::msg_params); + LOG4CXX_ERROR( + logger_, + "Message does not contains mandatory section " << strings::msg_params); return; } if (message[strings::msg_params].keyExists(strings::vin)) { @@ -952,9 +918,9 @@ void PolicyHandler::OnVehicleDataUpdated( void PolicyHandler::OnPendingPermissionChange( const std::string& policy_app_id) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, - "PolicyHandler::OnPendingPermissionChange for " - << policy_app_id); + LOG4CXX_DEBUG( + logger_, + "PolicyHandler::OnPendingPermissionChange for " << policy_app_id); POLICY_LIB_CHECK_VOID(); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); @@ -1049,14 +1015,17 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string, if (mobile_app_id.empty()) { LOG4CXX_WARN(logger_, "Application with connection key '" - << app_id << "'" - " has no application id."); + << app_id + << "'" + " has no application id."); return false; } LOG4CXX_DEBUG(logger_, - "Update url is " << url << " for application " - "with connection key " << app_id); + "Update url is " << url + << " for application " + "with connection key " + << app_id); MessageHelper::SendPolicySnapshotNotification( app_id, pt_string, url, application_manager_); @@ -1171,9 +1140,9 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification( policy_manager_->SetUserConsentForDevice(device_id, is_allowed); connection_handler::DeviceHandle device_handle = 0; if (!connection_handler.GetDeviceID(device_id, &device_handle)) { - LOG4CXX_WARN(logger_, - "Device handle with mac " << device_id - << " wasn't found."); + LOG4CXX_WARN( + logger_, + "Device handle with mac " << device_id << " wasn't found."); } #ifdef EXTERNAL_PROPRIETARY_MODE @@ -1371,9 +1340,9 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, MessageHelper::StringToHMILevel(default_hmi); if (mobile_apis::HMILevel::INVALID_ENUM == hmi_level) { - LOG4CXX_WARN(logger_, - "Couldn't convert default hmi level " << default_hmi - << " to enum."); + LOG4CXX_WARN( + logger_, + "Couldn't convert default hmi level " << default_hmi << " to enum."); return; } if (current_hmi_level == hmi_level) { @@ -1575,6 +1544,11 @@ std::string PolicyHandler::GetLockScreenIconUrl() const { return policy_manager_->GetLockScreenIconUrl(); } +std::string PolicyHandler::GetIconUrl(const std::string& policy_app_id) const { + POLICY_LIB_CHECK(std::string("")); + return policy_manager_->GetIconUrl(policy_app_id); +} + uint32_t PolicyHandler::NextRetryTimeout() { POLICY_LIB_CHECK(0); LOG4CXX_AUTO_TRACE(logger_); @@ -1696,9 +1670,9 @@ void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) { const bool is_written = file_system::Write( file_name, std::vector<uint8_t>(certificate_data.begin(), certificate_data.end())); - LOG4CXX_DEBUG(logger_, - "Saving encrypted certificate data: \"" << certificate_data - << '"'); + LOG4CXX_DEBUG( + logger_, + "Saving encrypted certificate data: \"" << certificate_data << '"'); if (!is_written) { LOG4CXX_ERROR(logger_, "Unable to save encrypted certificate to file " << file_name); @@ -1745,9 +1719,9 @@ void PolicyHandler::OnCertificateDecrypted(bool is_succeeded) { "Unable to read certificate from file " << file_name); return; } - LOG4CXX_DEBUG(logger_, - "Loaded decrypted certificate data: \"" << certificate_data - << '"'); + LOG4CXX_DEBUG( + logger_, + "Loaded decrypted certificate data: \"" << certificate_data << '"'); policy_manager_->SetDecryptedCertificate(certificate_data); @@ -1770,6 +1744,17 @@ void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) { } #endif // EXTERNAL_PROPRIETARY_MODE +void PolicyHandler::OnAuthTokenUpdated(const std::string& policy_app_id, + const std::string& auth_token) { + LOG4CXX_AUTO_TRACE(logger_); + sync_primitives::AutoLock lock(listeners_lock_); + HandlersCollection::const_iterator it = listeners_.begin(); + for (; it != listeners_.end(); ++it) { + PolicyHandlerObserver* observer = *it; + observer->OnAuthTokenUpdated(policy_app_id, auth_token); + } +} + void PolicyHandler::OnPTUFinished(const bool ptu_result) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(listeners_lock_); @@ -1845,6 +1830,205 @@ bool PolicyHandler::CheckSystemAction( return false; } +void PolicyHandler::GetEnabledCloudApps( + std::vector<std::string>& enabled_apps) const { + POLICY_LIB_CHECK_VOID(); + policy_manager_->GetEnabledCloudApps(enabled_apps); +} + +bool PolicyHandler::GetCloudAppParameters( + const std::string& policy_app_id, + bool& enabled, + std::string& endpoint, + std::string& certificate, + std::string& auth_token, + std::string& cloud_transport_type, + std::string& hybrid_app_preference) const { + POLICY_LIB_CHECK(false); + return policy_manager_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); +} + +const bool PolicyHandler::CheckCloudAppEnabled( + const std::string& policy_app_id) const { + POLICY_LIB_CHECK(false); + bool enabled = false; + std::string endpoint; + std::string auth_token; + std::string certificate; + std::string cloud_transport_type; + std::string hybrid_app_preference; + policy_manager_->GetCloudAppParameters(policy_app_id, + enabled, + endpoint, + certificate, + auth_token, + cloud_transport_type, + hybrid_app_preference); + return enabled; +} + +void PolicyHandler::OnSetCloudAppProperties( + const smart_objects::SmartObject& message) { + POLICY_LIB_CHECK_VOID(); + if (!message.keyExists(strings::msg_params)) { + LOG4CXX_ERROR( + logger_, + "Message does not contain mandatory section " << strings::msg_params); + return; + } + if (!message[strings::msg_params].keyExists(strings::properties)) { + LOG4CXX_ERROR( + logger_, + "Message does not contain app properties " << strings::msg_params); + return; + } + + const smart_objects::SmartObject& properties = + message[strings::msg_params][strings::properties]; + if (!properties.keyExists(strings::app_id)) { + LOG4CXX_ERROR( + logger_, + "Message does not contain mandatory parameter " << strings::app_id); + return; + } + std::string policy_app_id(properties[strings::app_id].asString()); + + policy_manager_->InitCloudApp(policy_app_id); + + bool auth_token_update = false; + if (properties.keyExists(strings::enabled)) { + bool enabled = properties[strings::enabled].asBool(); + policy_manager_->SetCloudAppEnabled(policy_app_id, enabled); + auth_token_update = enabled; + application_manager_.RefreshCloudAppInformation(); + } + if (properties.keyExists(strings::auth_token)) { + std::string auth_token = properties[strings::auth_token].asString(); + policy_manager_->SetAppAuthToken(policy_app_id, auth_token); + auth_token_update = true; + } + if (properties.keyExists(strings::cloud_transport_type)) { + policy_manager_->SetAppCloudTransportType( + policy_app_id, properties[strings::cloud_transport_type].asString()); + } + if (properties.keyExists(strings::endpoint)) { + policy_manager_->SetAppEndpoint(policy_app_id, + properties[strings::endpoint].asString()); + } + if (properties.keyExists(strings::nicknames)) { + StringArray nicknames; + const smart_objects::SmartObject& nicknames_array = + properties[strings::nicknames]; + for (size_t i = 0; i < nicknames_array.length(); ++i) { + nicknames.push_back(nicknames_array[i].asString()); + } + policy_manager_->SetAppNicknames(policy_app_id, nicknames); + } + if (properties.keyExists(strings::hybrid_app_preference)) { + std::string hybrid_app_preference; + + mobile_apis::HybridAppPreference::eType value = + static_cast<mobile_apis::HybridAppPreference::eType>( + properties[strings::hybrid_app_preference].asUInt()); + smart_objects::EnumConversionHelper< + mobile_apis::HybridAppPreference::eType>:: + EnumToString(value, &hybrid_app_preference); + policy_manager_->SetHybridAppPreference(policy_app_id, + hybrid_app_preference); + } + + if (auth_token_update) { + bool enabled; + std::string end, cert, ctt, hap; + std::string auth_token; + + policy_manager_->GetCloudAppParameters( + policy_app_id, enabled, end, cert, auth_token, ctt, hap); + OnAuthTokenUpdated(policy_app_id, auth_token); + } +} + +void PolicyHandler::GetAppServiceParameters( + const std::string& policy_app_id, + policy_table::AppServiceParameters* app_service_parameters) const { + POLICY_LIB_CHECK_VOID(); + policy_manager_->GetAppServiceParameters(policy_app_id, + app_service_parameters); +} + +bool PolicyHandler::CheckAppServiceParameters( + const std::string& policy_app_id, + const std::string& requested_service_name, + const std::string& requested_service_type, + smart_objects::SmartArray* requested_handled_rpcs) const { + std::string service_name = std::string(); + std::string service_type = std::string(); + std::vector<int32_t> handled_rpcs = {}; + + policy_table::AppServiceParameters app_service_parameters = + policy_table::AppServiceParameters(); + this->GetAppServiceParameters(policy_app_id, &app_service_parameters); + + if (app_service_parameters.find(requested_service_type) == + app_service_parameters.end()) { + LOG4CXX_DEBUG(logger_, + "Disallowed service type: " << requested_service_type); + return false; + } + + auto service_names = + *(app_service_parameters[requested_service_type].service_names); + if (!service_names.is_initialized()) { + LOG4CXX_DEBUG(logger_, + "Pt Service Name is Null, All service names accepted"); + } else if (!requested_service_name.empty()) { + auto find_name_result = + std::find(service_names.begin(), + service_names.end(), + rpc::String<0, 255>(requested_service_name)); + if (find_name_result == service_names.end()) { + LOG4CXX_DEBUG(logger_, + "Disallowed service name: " << requested_service_name); + return false; + } + } + + if (requested_handled_rpcs) { + auto temp_rpcs = + app_service_parameters[requested_service_type].handled_rpcs; + for (auto handled_it = temp_rpcs.begin(); handled_it != temp_rpcs.end(); + ++handled_it) { + handled_rpcs.push_back(handled_it->function_id); + } + + for (auto requested_it = requested_handled_rpcs->begin(); + requested_it != requested_handled_rpcs->end(); + ++requested_it) { + auto find_result = std::find( + handled_rpcs.begin(), handled_rpcs.end(), requested_it->asInt()); + if (find_result == handled_rpcs.end()) { + LOG4CXX_DEBUG(logger_, + "Disallowed by handled rpc: " << requested_it->asInt()); + return false; + } + } + } + return true; +} + +bool PolicyHandler::UnknownRPCPassthroughAllowed( + const std::string& policy_app_id) const { + LOG4CXX_AUTO_TRACE(logger_); + POLICY_LIB_CHECK(false); + return policy_manager_->UnknownRPCPassthroughAllowed(policy_app_id); +} + uint32_t PolicyHandler::HeartBeatTimeout(const std::string& app_id) const { POLICY_LIB_CHECK(0); return policy_manager_->HeartBeatTimeout(app_id); @@ -2071,17 +2255,17 @@ void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id, ApplicationSharedPtr app = application_manager_.application(device_id, policy_app_id); if (!app) { - LOG4CXX_WARN(logger_, - "Could not find application: " << device_id << " - " - << policy_app_id); + LOG4CXX_WARN( + logger_, + "Could not find application: " << device_id << " - " << policy_app_id); return; } mobile_apis::HMILevel::eType level = MessageHelper::StringToHMILevel(hmi_level); if (mobile_apis::HMILevel::INVALID_ENUM == level) { - LOG4CXX_WARN(logger_, - "Couldn't convert default hmi level " << hmi_level - << " to enum."); + LOG4CXX_WARN( + logger_, + "Couldn't convert default hmi level " << hmi_level << " to enum."); return; } @@ -2144,17 +2328,17 @@ void PolicyHandler::OnUpdateHMILevel(const std::string& device_id, ApplicationSharedPtr app = application_manager_.application(device_id, policy_app_id); if (!app) { - LOG4CXX_WARN(logger_, - "Could not find application: " << device_id << " - " - << policy_app_id); + LOG4CXX_WARN( + logger_, + "Could not find application: " << device_id << " - " << policy_app_id); return; } mobile_apis::HMILevel::eType level = MessageHelper::StringToHMILevel(hmi_level); if (mobile_apis::HMILevel::INVALID_ENUM == level) { - LOG4CXX_WARN(logger_, - "Couldn't convert default hmi level " << hmi_level - << " to enum."); + LOG4CXX_WARN( + logger_, + "Couldn't convert default hmi level " << hmi_level << " to enum."); return; } UpdateHMILevel(app, level); diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index 315cf6fdf8..93c45ed5dc 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -32,9 +32,9 @@ #include "utils/logger.h" -#include "application_manager/request_controller.h" #include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/request_to_hmi.h" +#include "application_manager/request_controller.h" #include "utils/timer_task_impl.h" diff --git a/src/components/application_manager/src/request_tracker.cc b/src/components/application_manager/src/request_tracker.cc index c047c82579..052667dc3f 100644 --- a/src/components/application_manager/src/request_tracker.cc +++ b/src/components/application_manager/src/request_tracker.cc @@ -30,10 +30,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "utils/logger.h" -#include "utils/macro.h" #include "application_manager/request_tracker.h" #include "application_manager/message_helper.h" +#include "utils/logger.h" +#include "utils/macro.h" namespace application_manager { diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc index 3e77078ee5..fff1aefed3 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -31,23 +31,23 @@ */ #include "application_manager/resumption/resume_ctrl_impl.h" -#include <fstream> #include <algorithm> +#include <fstream> #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" -#include "utils/file_system.h" -#include "connection_handler/connection_handler_impl.h" -#include "application_manager/message_helper.h" -#include "connection_handler/connection.h" #include "application_manager/commands/command_impl.h" -#include "policy/policy_manager_impl.h" +#include "application_manager/message_helper.h" #include "application_manager/policies/policy_handler.h" -#include "application_manager/state_controller.h" -#include "utils/helpers.h" #include "application_manager/resumption/resumption_data_db.h" #include "application_manager/resumption/resumption_data_json.h" +#include "application_manager/state_controller.h" +#include "connection_handler/connection.h" +#include "connection_handler/connection_handler_impl.h" +#include "policy/policy_manager_impl.h" +#include "utils/file_system.h" +#include "utils/helpers.h" #include "utils/timer_task_impl.h" @@ -152,9 +152,9 @@ void ResumeCtrlImpl::SaveApplication(ApplicationSharedPtr application) { LOG4CXX_DEBUG(logger_, "Low Voltage state is active"); return; } - LOG4CXX_DEBUG(logger_, - "application with appID " << application->app_id() - << " will be saved"); + LOG4CXX_DEBUG( + logger_, + "application with appID " << application->app_id() << " will be saved"); resumption_storage_->SaveApplication(application); } @@ -399,7 +399,13 @@ bool ResumeCtrlImpl::StartResumption(ApplicationSharedPtr application, << " hmi_app_id = " << application->hmi_app_id() << " policy_id = " << application->policy_app_id() << " received hash = " << hash); - SetupDefaultHMILevel(application); + if (!application->is_cloud_app()) { + // Default HMI Level is already set before resumption in + // ApplicationManager::OnApplicationRegistered, and handling low bandwidth + // transports doesn't apply to cloud apps, so this step can be skipped for + // such apps + SetupDefaultHMILevel(application); + } smart_objects::SmartObject saved_app; const std::string& device_mac = application->mac_address(); bool result = resumption_storage_->GetSavedApplication( @@ -426,7 +432,13 @@ bool ResumeCtrlImpl::StartResumptionOnlyHMILevel( << application->app_id() << "with hmi_app_id " << application->hmi_app_id() << ", policy_app_id " << application->policy_app_id()); - SetupDefaultHMILevel(application); + if (!application->is_cloud_app()) { + // Default HMI Level is already set before resumption in + // ApplicationManager::OnApplicationRegistered, and handling low bandwidth + // transports doesn't apply to cloud apps, so this step can be skipped for + // such apps + SetupDefaultHMILevel(application); + } const std::string& device_mac = application->mac_address(); smart_objects::SmartObject saved_app; bool result = resumption_storage_->GetSavedApplication( @@ -503,9 +515,9 @@ void ResumeCtrlImpl::StartAppHmiStateResumption( } RemoveApplicationFromSaved(application); } else { - LOG4CXX_INFO(logger_, - "Do not need to resume application " - << application->policy_app_id()); + LOG4CXX_INFO( + logger_, + "Do not need to resume application " << application->policy_app_id()); } } @@ -1023,8 +1035,9 @@ void ResumeCtrlImpl::AddToResumptionTimerQueue(const uint32_t app_id) { } queue_lock_.Release(); LOG4CXX_DEBUG(logger_, - "Application ID " << app_id << " have been added" - " to resumption queue."); + "Application ID " << app_id + << " have been added" + " to resumption queue."); if (run_resumption) { LOG4CXX_DEBUG(logger_, "Application ID " << app_id << " will be restored by timer"); @@ -1185,4 +1198,4 @@ static mobile_api::HMILevel::eType ConvertHmiLevelString( } } -} // namespce resumption +} // namespace resumption diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc index 856fb03750..b4d39eccc1 100644 --- a/src/components/application_manager/src/resumption/resumption_data.cc +++ b/src/components/application_manager/src/resumption/resumption_data.cc @@ -31,9 +31,9 @@ */ #include "application_manager/resumption/resumption_data.h" -#include "utils/logger.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/application_manager_settings.h" +#include "application_manager/smart_object_keys.h" +#include "utils/logger.h" namespace resumption { diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc index 1591ce566a..02b7098414 100644 --- a/src/components/application_manager/src/resumption/resumption_data_db.cc +++ b/src/components/application_manager/src/resumption/resumption_data_db.cc @@ -29,18 +29,18 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <unistd.h> +#include <string> #include "application_manager/application_manager_impl.h" +#include "application_manager/application_manager_settings.h" +#include "application_manager/message_helper.h" #include "application_manager/resumption/resumption_data_db.h" #include "application_manager/resumption/resumption_sql_queries.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/message_helper.h" -#include "utils/helpers.h" #include "utils/gen_hash.h" +#include "utils/helpers.h" #include "utils/scope_guard.h" -#include "application_manager/application_manager_settings.h" namespace { const std::string kDatabaseName = "resumption"; diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc index c8e9032dfa..591166c687 100644 --- a/src/components/application_manager/src/resumption/resumption_data_json.cc +++ b/src/components/application_manager/src/resumption/resumption_data_json.cc @@ -30,14 +30,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/application_manager_impl.h" #include "application_manager/resumption/resumption_data_json.h" -#include "smart_objects/smart_object.h" -#include "json/json.h" -#include "formatters/CFormatterJsonBase.h" +#include "application_manager/application_manager.h" +#include "application_manager/application_manager_settings.h" #include "application_manager/message_helper.h" #include "application_manager/smart_object_keys.h" -#include "application_manager/application_manager_settings.h" +#include "formatters/CFormatterJsonBase.h" +#include "json/json.h" +#include "smart_objects/smart_object.h" namespace resumption { @@ -531,4 +531,4 @@ void ResumptionDataJson::Persist() { last_state().SaveStateToFileSystem(); } -} // resumption +} // namespace resumption diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc index 939b3d1ce6..3fceaf573c 100644 --- a/src/components/application_manager/src/rpc_handler_impl.cc +++ b/src/components/application_manager/src/rpc_handler_impl.cc @@ -32,12 +32,16 @@ #include "application_manager/rpc_handler_impl.h" +#include "application_manager/app_service_manager.h" +#include "application_manager/plugin_manager/plugin_keys.h" + namespace application_manager { namespace rpc_handler { CREATE_LOGGERPTR_LOCAL(logger_, "RPCHandlerImpl") namespace formatters = ns_smart_device_link::ns_json_handler::formatters; namespace jhs = ns_smart_device_link::ns_json_handler::strings; +namespace plugin_names = application_manager::plugin_manager::plugin_names; RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager) : app_manager_(app_manager) @@ -63,17 +67,76 @@ void RPCHandlerImpl::ProcessMessageFromMobile( #endif // TELEMETRY_MONITOR smart_objects::SmartObjectSPtr so_from_mobile = std::make_shared<smart_objects::SmartObject>(); - + bool allow_unknown_parameters = false; DCHECK_OR_RETURN_VOID(so_from_mobile); if (!so_from_mobile) { LOG4CXX_ERROR(logger_, "Null pointer"); return; } - if (!ConvertMessageToSO(*message, *so_from_mobile)) { + if (message->type() == application_manager::MessageType::kRequest && + message->correlation_id() < 0) { + LOG4CXX_ERROR(logger_, "Request correlation id < 0. Returning INVALID_ID"); + std::shared_ptr<smart_objects::SmartObject> response( + MessageHelper::CreateNegativeResponse(message->connection_key(), + message->function_id(), + 0, + mobile_apis::Result::INVALID_ID)); + // CreateNegativeResponse() takes a uint32_t for correlation_id, therefore a + // negative number cannot be passed to that function or else it will be + // improperly cast. correlation_id is reassigned below to its original + // value. + (*response)[strings::params][strings::correlation_id] = + message->correlation_id(); + (*response)[strings::msg_params][strings::info] = + "Invalid Correlation ID for RPC Request"; + app_manager_.GetRPCService().ManageMobileCommand( + response, commands::Command::SOURCE_SDL); + return; + } + + bool rpc_passing = app_manager_.GetAppServiceManager() + .GetRPCPassingHandler() + .CanHandleFunctionID(message->function_id()); + if (app_manager_.GetRPCService().IsAppServiceRPC( + message->function_id(), commands::Command::SOURCE_MOBILE) || + rpc_passing) { + LOG4CXX_DEBUG(logger_, + "Allowing unknown parameters for request function " + << message->function_id()); + allow_unknown_parameters = true; + } + + if (!ConvertMessageToSO( + *message, *so_from_mobile, allow_unknown_parameters, !rpc_passing)) { LOG4CXX_ERROR(logger_, "Cannot create smart object from message"); return; } + + if (rpc_passing) { + uint32_t correlation_id = + (*so_from_mobile)[strings::params][strings::correlation_id].asUInt(); + int32_t message_type = + (*so_from_mobile)[strings::params][strings::message_type].asInt(); + RPCPassingHandler& handler = + app_manager_.GetAppServiceManager().GetRPCPassingHandler(); + // Check permissions for requests, otherwise attempt passthrough + if ((application_manager::MessageType::kRequest != message_type || + handler.IsPassthroughAllowed(*so_from_mobile)) && + handler.RPCPassThrough(*so_from_mobile)) { + // RPC was forwarded. Skip handling by Core + return; + } else if (!handler.IsPassThroughMessage(correlation_id, + commands::Command::SOURCE_MOBILE, + message_type)) { + // Since PassThrough failed, refiltering the message + if (!ConvertMessageToSO(*message, *so_from_mobile)) { + LOG4CXX_ERROR(logger_, "Cannot create smart object from message"); + return; + } + } + } + #ifdef TELEMETRY_MONITOR metric->message = so_from_mobile; #endif // TELEMETRY_MONITOR @@ -95,13 +158,28 @@ void RPCHandlerImpl::ProcessMessageFromHMI( LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr smart_object = std::make_shared<smart_objects::SmartObject>(); - + bool allow_unknown_parameters = false; if (!smart_object) { LOG4CXX_ERROR(logger_, "Null pointer"); return; } - if (!ConvertMessageToSO(*message, *smart_object)) { + smart_objects::SmartObject converted_result; + formatters::FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType, + hmi_apis::messageType::eType>( + message->json_message(), converted_result); + + if (app_manager_.GetRPCService().IsAppServiceRPC( + converted_result[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt(), + commands::Command::SOURCE_HMI)) { + LOG4CXX_DEBUG( + logger_, + "Allowing unknown parameters for request function " + << converted_result[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt()); + allow_unknown_parameters = true; + } + + if (!ConvertMessageToSO(*message, *smart_object, allow_unknown_parameters)) { if (application_manager::MessageType::kResponse == (*smart_object)[strings::params][strings::message_type].asInt()) { (*smart_object).erase(strings::msg_params); @@ -228,7 +306,9 @@ void RPCHandlerImpl::GetMessageVersion( bool RPCHandlerImpl::ConvertMessageToSO( const Message& message, - ns_smart_device_link::ns_smart_objects::SmartObject& output) { + ns_smart_device_link::ns_smart_objects::SmartObject& output, + const bool allow_unknown_parameters, + const bool validate_params) { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "\t\t\tMessage to convert: protocol " @@ -262,13 +342,14 @@ bool RPCHandlerImpl::ConvertMessageToSO( } if (!conversion_result || - !mobile_so_factory().attachSchema(output, true, msg_version) || - ((output.validate(&report, msg_version) != - smart_objects::errors::OK))) { + (validate_params && + !ValidateRpcSO( + output, msg_version, report, allow_unknown_parameters))) { LOG4CXX_WARN(logger_, "Failed to parse string to smart object with API version " << msg_version.toString() << " : " << message.json_message()); + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( message.connection_key(), @@ -280,8 +361,10 @@ bool RPCHandlerImpl::ConvertMessageToSO( rpc::PrettyFormat(report); app_manager_.GetRPCService().ManageMobileCommand( response, commands::Command::SOURCE_SDL); + return false; } + LOG4CXX_DEBUG(logger_, "Convertion result for sdl object is true function_id " << output[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt()); @@ -330,10 +413,13 @@ bool RPCHandlerImpl::ConvertMessageToSO( rpc::ValidationReport report("RPC"); - if (output.validate(&report) != smart_objects::errors::OK) { - LOG4CXX_ERROR(logger_, - "Incorrect parameter from HMI" - << rpc::PrettyFormat(report)); + utils::SemanticVersion empty_version; + if (validate_params && + output.validate(&report, empty_version, allow_unknown_parameters) != + smart_objects::errors::OK) { + LOG4CXX_ERROR( + logger_, + "Incorrect parameter from HMI - " << rpc::PrettyFormat(report)); output.erase(strings::msg_params); output[strings::params][hmi_response::code] = @@ -391,6 +477,20 @@ bool RPCHandlerImpl::ConvertMessageToSO( return true; } +bool RPCHandlerImpl::ValidateRpcSO(smart_objects::SmartObject& message, + utils::SemanticVersion& msg_version, + rpc::ValidationReport& report_out, + bool allow_unknown_parameters) { + if (!mobile_so_factory().attachSchema( + message, !allow_unknown_parameters, msg_version) || + message.validate(&report_out, msg_version, allow_unknown_parameters) != + smart_objects::errors::OK) { + LOG4CXX_WARN(logger_, "Failed to parse string to smart object"); + return false; + } + return true; +} + std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage( const protocol_handler::RawMessagePtr message) { LOG4CXX_AUTO_TRACE(logger_); @@ -423,5 +523,5 @@ hmi_apis::HMI_API& RPCHandlerImpl::hmi_so_factory() { mobile_apis::MOBILE_API& RPCHandlerImpl::mobile_so_factory() { return mobile_so_factory_; } -} -} +} // namespace rpc_handler +} // namespace application_manager diff --git a/src/components/application_manager/src/rpc_passing_handler.cc b/src/components/application_manager/src/rpc_passing_handler.cc new file mode 100644 index 0000000000..feb3bccc1f --- /dev/null +++ b/src/components/application_manager/src/rpc_passing_handler.cc @@ -0,0 +1,441 @@ +/* + * Copyright (c) 2018, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "application_manager/help_prompt_manager_impl.h" + +#include <algorithm> +#include <iterator> + +#include "application_manager/app_service_manager.h" +#include "application_manager/application.h" +#include "application_manager/application_manager.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/message_helper.h" +#include "application_manager/rpc_handler.h" +#include "application_manager/rpc_passing_handler.h" +#include "application_manager/smart_object_keys.h" +#include "encryption/hashing.h" +#include "resumption/last_state.h" +#include "smart_objects/enum_schema_item.h" +#include "utils/logger.h" + +#include "smart_objects/enum_schema_item.h" +#include "utils/timer_task_impl.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "RPCPassingHandler") + +namespace application_manager { + +RPCPassingHandler::RPCPassingHandler(AppServiceManager& asm_ref, + ApplicationManager& am_ref) + : app_service_manager_(asm_ref), app_manager_(am_ref) {} + +RPCPassingHandler::~RPCPassingHandler() {} + +bool RPCPassingHandler::IsPassThroughMessage( + uint32_t correlation_id, + commands::Command::CommandSource source, + int32_t message_type) { + sync_primitives::AutoLock lock(rpc_request_queue_lock_); + + if (rpc_request_queue.find(correlation_id) != rpc_request_queue.end()) { + if (message_type == MessageType::kResponse && + source == commands::Command::CommandSource::SOURCE_SDL) { + // Checks if response is being sent to mobile then removes the correlation + // id from the map + rpc_request_queue.erase(correlation_id); + } + return true; + } + return false; +} + +bool RPCPassingHandler::CanHandleFunctionID(int32_t function_id) { + auto services = app_service_manager_.GetActiveServices(); + for (auto it = services.begin(); it != services.end(); ++it) { + auto handled_rpcs = + it->record[strings::service_manifest][strings::handled_rpcs]; + for (size_t i = 0; i < handled_rpcs.length(); i++) { + if (handled_rpcs[i].asInt() == function_id) { + return true; + } + } + } + return false; +} + +bool RPCPassingHandler::ExtractRPCParams( + const smart_objects::SmartObject& s_map, + const ApplicationSharedPtr app, + const std::string& function_id_str) { + LOG4CXX_AUTO_TRACE(logger_); + RPCParams params; + + if (smart_objects::SmartType_Map == s_map.getType()) { + for (auto iter = s_map.map_begin(); iter != s_map.map_end(); ++iter) { + LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first); + params.insert(iter->first); + } + } + + CommandParametersPermissions parameters_permissions; + + mobile_apis::Result::eType check_result = app_manager_.CheckPolicyPermissions( + app, function_id_str, params, ¶meters_permissions); + + // Check if RPC is allowed by policy (since we are allowing unknown params, + // check should pass if only undefined parameters exist) + if (mobile_apis::Result::DISALLOWED == check_result && + !parameters_permissions.undefined_params.empty() && + parameters_permissions.disallowed_params.empty() && + parameters_permissions.allowed_params.empty()) { + return true; + } else if (mobile_apis::Result::SUCCESS != check_result) { + return false; + } + + return true; +} + +bool RPCPassingHandler::IsPassthroughAllowed( + smart_objects::SmartObject rpc_message) { + LOG4CXX_AUTO_TRACE(logger_); + uint32_t connection_key = + rpc_message[strings::params][strings::connection_key].asUInt(); + ApplicationSharedPtr app = app_manager_.application(connection_key); + if (!app) { + return false; + } + + mobile_api::FunctionID::eType function_id = + static_cast<mobile_api::FunctionID::eType>( + rpc_message[strings::params][strings::function_id].asInt()); + std::string function_id_str = + MessageHelper::StringifiedFunctionID(function_id); + PolicyHandlerInterface& policy_handler = app_manager_.GetPolicyHandler(); + + if (function_id_str.empty()) { + // Unknown RPC, just do basic revoked and user consent checks + std::string device_mac; + app_manager_.connection_handler().get_session_observer().GetDataOnDeviceID( + app->device(), NULL, NULL, &device_mac, NULL); + return policy_handler.UnknownRPCPassthroughAllowed(app->policy_app_id()) && + !policy_handler.IsApplicationRevoked(app->policy_app_id()) && + policy::kDeviceAllowed == + app_manager_.GetUserConsentForDevice(device_mac); + } + + return ExtractRPCParams( + rpc_message[strings::msg_params], app, function_id_str); +} + +bool RPCPassingHandler::RPCPassThrough(smart_objects::SmartObject rpc_message) { + LOG4CXX_AUTO_TRACE(logger_); + + uint32_t correlation_id = + rpc_message[strings::params][strings::correlation_id].asUInt(); + int32_t message_type = + rpc_message[strings::params][strings::message_type].asInt(); + + LOG4CXX_DEBUG(logger_, "RPC_PASSING: "); + MessageHelper::PrintSmartObject(rpc_message); + + // Clear timers for timed out requests + ClearCompletedTimers(); + switch (message_type) { + case MessageType::kRequest: { + LOG4CXX_DEBUG(logger_, "Handle request"); + rpc_request_queue_lock_.Acquire(); + if (rpc_request_queue.find(correlation_id) == rpc_request_queue.end()) { + rpc_request_queue_lock_.Release(); + LOG4CXX_DEBUG( + logger_, + "Correlation id DOES NOT exist in map. Constructing request queue"); + PopulateRPCRequestQueue(rpc_message); + } else { + rpc_request_queue_lock_.Release(); + LOG4CXX_DEBUG(logger_, "Correlation id DOES exist in map. Returning"); + std::shared_ptr<smart_objects::SmartObject> response( + MessageHelper::CreateNegativeResponse( + rpc_message[strings::params][strings::connection_key].asUInt(), + rpc_message[strings::params][strings::function_id].asInt(), + correlation_id, + mobile_apis::Result::INVALID_ID)); + + (*response)[strings::msg_params][strings::info] = + "Duplicate correlation_id"; + app_manager_.GetRPCService().ManageMobileCommand( + response, commands::Command::SOURCE_SDL); + + return true; + } + + rpc_request_queue_lock_.Acquire(); + if (rpc_request_queue[correlation_id].second.empty()) { + LOG4CXX_DEBUG(logger_, + "No services left in map. Using core to handle request"); + rpc_request_queue.erase(correlation_id); + rpc_request_queue_lock_.Release(); + return false; + } else { + rpc_request_queue_lock_.Release(); + ForwardRequestToMobile(correlation_id); + return true; + } + + break; + } + + case MessageType::kResponse: { + LOG4CXX_DEBUG(logger_, "Handle response"); + rpc_request_queue_lock_.Acquire(); + if (rpc_request_queue.find(correlation_id) == rpc_request_queue.end()) { + rpc_request_queue_lock_.Release(); + return false; + } + rpc_request_queue_lock_.Release(); + RemoveRequestTimer(correlation_id); + + mobile_apis::Result::eType result_code; + smart_objects::EnumConversionHelper<mobile_apis::Result::eType>:: + StringToEnum( + rpc_message[strings::msg_params][strings::result_code].asString(), + &result_code); + + if (result_code == mobile_apis::Result::UNSUPPORTED_REQUEST) { + LOG4CXX_DEBUG(logger_, "Service sent UNSUPPORTED_REQUEST"); + PerformNextRequest(correlation_id); + return true; + } else { + LOG4CXX_DEBUG(logger_, "Valid RPC passing response"); + ForwardResponseToMobile(correlation_id, rpc_message); + return true; + } + + break; + } + } + + return false; +} + +void RPCPassingHandler::PopulateRPCRequestQueue( + smart_objects::SmartObject request_message) { + uint32_t origin_connection_key = + request_message[strings::params][strings::connection_key].asUInt(); + uint32_t correlation_id = + request_message[strings::params][strings::correlation_id].asUInt(); + int32_t function_id = + request_message[strings::params][strings::function_id].asInt(); + + // Construct list of pass through services + auto entry = std::make_pair(request_message, std::deque<ServiceInfo>()); + auto services = app_service_manager_.GetActiveServices(); + + for (auto services_it = services.begin(); services_it != services.end(); + ++services_it) { + auto handled_rpcs = + services_it->record[strings::service_manifest][strings::handled_rpcs]; + for (size_t i = 0; i < handled_rpcs.length(); i++) { + if (handled_rpcs[i].asInt() == function_id) { + // Add requests to queue + ServiceInfo service_info{ + services_it->record[strings::service_id].asString(), + services_it->connection_key}; + entry.second.push_back(service_info); + app_manager_.IncreaseForwardedRequestTimeout(origin_connection_key, + correlation_id); + break; + } + } + } + + sync_primitives::AutoLock lock(rpc_request_queue_lock_); + rpc_request_queue[correlation_id] = entry; + + LOG4CXX_DEBUG(logger_, + "Added " << rpc_request_queue[correlation_id].second.size() + << " requests to the queue"); +} +void RPCPassingHandler::ForwardRequestToMobile(uint32_t correlation_id) { + rpc_request_queue_lock_.Acquire(); + uint32_t connection_key = + rpc_request_queue[correlation_id].second.front().connection_key; + LOG4CXX_DEBUG(logger_, + "Forwarding request to service with app id " << connection_key); + + smart_objects::SmartObject message(rpc_request_queue[correlation_id].first); + message[strings::params][strings::connection_key] = connection_key; + smart_objects::SmartObjectSPtr result = + std::make_shared<smart_objects::SmartObject>(message); + rpc_request_queue_lock_.Release(); + AddRequestTimer(correlation_id); + app_manager_.GetRPCService().SendMessageToMobile(result); +} + +void RPCPassingHandler::ForwardRequestToCore(uint32_t correlation_id) { + LOG4CXX_DEBUG(logger_, + "No services left in map. using core to handle request"); + rpc_request_queue_lock_.Acquire(); + smart_objects::SmartObject message(rpc_request_queue[correlation_id].first); + smart_objects::SmartObjectSPtr result = + std::make_shared<smart_objects::SmartObject>(message); + rpc_request_queue.erase(correlation_id); + rpc_request_queue_lock_.Release(); + + // Validate rpc message before forwarding to core + rpc::ValidationReport report("RPC"); + uint32_t connection_key = + message[strings::params][strings::connection_key].asUInt(); + int32_t function_id = message[strings::params][strings::function_id].asInt(); + auto app_ptr = app_manager_.application(connection_key); + utils::SemanticVersion msg_version(0, 0, 0); + if (app_ptr) { + msg_version = app_ptr->msg_version(); + } + + if (!app_manager_.GetRPCHandler().ValidateRpcSO( + message, msg_version, report, false)) { + std::shared_ptr<smart_objects::SmartObject> response( + MessageHelper::CreateNegativeResponse( + connection_key, + function_id, + correlation_id, + mobile_apis::Result::INVALID_DATA)); + + (*response)[strings::msg_params][strings::info] = rpc::PrettyFormat(report); + app_manager_.GetRPCService().ManageMobileCommand( + response, commands::Command::SOURCE_SDL); + return; + } + + app_manager_.GetRPCService().ManageMobileCommand( + result, commands::Command::SOURCE_MOBILE); +} + +void RPCPassingHandler::ForwardResponseToMobile( + uint32_t correlation_id, smart_objects::SmartObject response_message) { + rpc_request_queue_lock_.Acquire(); + uint32_t origin_connection_key = + rpc_request_queue[correlation_id] + .first[strings::params][strings::connection_key] + .asUInt(); + rpc_request_queue_lock_.Release(); + + LOG4CXX_DEBUG(logger_, + "Forwarding response to mobile app " << origin_connection_key); + smart_objects::SmartObject message(response_message); + message[strings::params][strings::connection_key] = origin_connection_key; + smart_objects::SmartObjectSPtr result = + std::make_shared<smart_objects::SmartObject>(message); + app_manager_.GetRPCService().SendMessageToMobile(result); +} + +bool RPCPassingHandler::PerformNextRequest(uint32_t correlation_id) { + LOG4CXX_DEBUG(logger_, "Performing next request in queue"); + rpc_request_queue_lock_.Acquire(); + if (rpc_request_queue.find(correlation_id) == rpc_request_queue.end()) { + LOG4CXX_ERROR(logger_, "Correlation id does NOT exist in map"); + rpc_request_queue_lock_.Release(); + return false; + } + rpc_request_queue[correlation_id].second.pop_front(); + bool empty = rpc_request_queue[correlation_id].second.empty(); + rpc_request_queue_lock_.Release(); + + if (empty) { + ForwardRequestToCore(correlation_id); + } else { + ForwardRequestToMobile(correlation_id); + } + + return true; +} + +void RPCPassingHandler::OnPassThroughRequestTimeout() { + timeout_queue_lock_.Acquire(); + LOG4CXX_DEBUG(logger_, "Request Timed out"); + auto timeout_entry = timeout_queue_.front(); + uint32_t correlation_id = timeout_entry.second; + timeout_queue_lock_.Release(); + PerformNextRequest(correlation_id); +} + +void RPCPassingHandler::ClearCompletedTimers() { + sync_primitives::AutoLock lock(timeout_queue_lock_); + + LOG4CXX_DEBUG(logger_, "Clearing Completed Timers"); + for (auto it = timeout_queue_.begin(); it != timeout_queue_.end();) { + TimerSPtr timer = it->first; + if (timer->is_completed()) { + LOG4CXX_DEBUG( + logger_, + "Removing completed timer for correlation id " << it->second); + it = timeout_queue_.erase(it); + } else { + ++it; + } + } +} + +void RPCPassingHandler::AddRequestTimer(uint32_t correlation_id) { + TimerSPtr rpc_passing_timer(std::make_shared<timer::Timer>( + "RPCPassingTimeoutTimer_" + std::to_string(correlation_id), + new timer::TimerTaskImpl<RPCPassingHandler>( + this, &RPCPassingHandler::OnPassThroughRequestTimeout))); + const uint32_t timeout_ms = + app_manager_.get_settings().rpc_pass_through_timeout(); + rpc_passing_timer->Start(timeout_ms, timer::kSingleShot); + LOG4CXX_DEBUG( + logger_, + "Adding and starting timer for correlation id " << correlation_id); + sync_primitives::AutoLock lock(timeout_queue_lock_); + timeout_queue_.push_back(std::make_pair(rpc_passing_timer, correlation_id)); +} + +void RPCPassingHandler::RemoveRequestTimer(uint32_t correlation_id) { + sync_primitives::AutoLock lock(timeout_queue_lock_); + + for (auto it = timeout_queue_.begin(); it != timeout_queue_.end();) { + TimerSPtr timer = it->first; + uint32_t cid = it->second; + if (cid == correlation_id) { + LOG4CXX_DEBUG(logger_, + "Removing timer for correlation id " << correlation_id); + it = timeout_queue_.erase(it); + } else { + ++it; + } + } +} + +} // namespace application_manager diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index 7a68ae5779..b5cae1c126 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -32,12 +32,16 @@ #include "application_manager/rpc_service_impl.h" +#include "application_manager/app_service_manager.h" +#include "application_manager/plugin_manager/plugin_keys.h" + namespace application_manager { namespace rpc_service { CREATE_LOGGERPTR_LOCAL(logger_, "RPCServiceImpl") namespace formatters = ns_smart_device_link::ns_json_handler::formatters; namespace jhs = ns_smart_device_link::ns_json_handler::strings; +namespace plugin_names = application_manager::plugin_manager::plugin_names; RPCServiceImpl::RPCServiceImpl( ApplicationManager& app_manager, @@ -122,7 +126,8 @@ bool RPCServiceImpl::ManageMobileCommand( auto plugin = app_manager_.GetPluginManager().FindPluginToProcess(function_id, source); if (!plugin) { - LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error()); + LOG4CXX_WARN(logger_, "Failed to find plugin : " << plugin.error()); + CheckSourceForUnsupportedRequest(message, source); return false; } application_manager::CommandFactory& factory = (*plugin).GetCommandFactory(); @@ -154,7 +159,19 @@ bool RPCServiceImpl::ManageMobileCommand( return true; } - if (message_type == mobile_apis::messageType::request) { + if (message_type == mobile_apis::messageType::request && + source == commands::Command::CommandSource::SOURCE_SDL) { + if (command->Init()) { + command->Run(); + command->CleanUp(); + return true; + } else { + return false; + } + } + + if (message_type == mobile_apis::messageType::request && + source == commands::Command::CommandSource::SOURCE_MOBILE) { // commands will be launched from requesr_ctrl mobile_apis::HMILevel::eType app_hmi_level = mobile_apis::HMILevel::INVALID_ENUM; @@ -241,8 +258,8 @@ bool RPCServiceImpl::ManageMobileCommand( return false; } -bool RPCServiceImpl::ManageHMICommand( - const commands::MessageSharedPtr message) { +bool RPCServiceImpl::ManageHMICommand(const commands::MessageSharedPtr message, + commands::Command::CommandSource source) { LOG4CXX_AUTO_TRACE(logger_); if (!message) { @@ -258,15 +275,15 @@ bool RPCServiceImpl::ManageHMICommand( MessageHelper::PrintSmartObject(*message); const int32_t function_id = (*(message.get()))[strings::params][strings::function_id].asInt(); - auto plugin = app_manager_.GetPluginManager().FindPluginToProcess( - function_id, commands::Command::SOURCE_HMI); + auto plugin = + app_manager_.GetPluginManager().FindPluginToProcess(function_id, source); if (!plugin) { LOG4CXX_WARN(logger_, "Filed to find plugin : " << plugin.error()); return false; } application_manager::CommandFactory& factory = (*plugin).GetCommandFactory(); - auto command = factory.CreateCommand(message, commands::Command::SOURCE_HMI); + auto command = factory.CreateCommand(message, source); if (!command) { LOG4CXX_WARN(logger_, "Failed to create command from smart object"); @@ -374,6 +391,7 @@ void RPCServiceImpl::SendMessageToMobile( const bool is_result_code_exists = (*message)[strings::msg_params].keyExists(strings::result_code); + bool allow_unknown_parameters = false; if (!app) { LOG4CXX_ERROR(logger_, "No application associated with connection key"); @@ -405,7 +423,31 @@ void RPCServiceImpl::SendMessageToMobile( // Messages to mobile are not yet prioritized so use default priority value std::shared_ptr<Message> message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); - if (!ConvertSOtoMessage((*message), (*message_to_send))) { + + int32_t function_id = (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt(); + bool rpc_passing = app_manager_.GetAppServiceManager() + .GetRPCPassingHandler() + .CanHandleFunctionID(function_id); + if (IsAppServiceRPC(function_id, + commands::Command::CommandSource::SOURCE_SDL) || + rpc_passing) { + LOG4CXX_DEBUG( + logger_, + "Allowing unknown parameters for response function " << function_id); + allow_unknown_parameters = true; + } + + if (rpc_passing && + !app_manager_.GetAppServiceManager() + .GetRPCPassingHandler() + .IsPassThroughMessage( + (*message)[jhs::S_PARAMS][jhs::S_CORRELATION_ID].asUInt(), + commands::Command::CommandSource::SOURCE_SDL, + (*message)[jhs::S_PARAMS][jhs::S_MESSAGE_TYPE].asInt())) { + allow_unknown_parameters = false; + } + if (!ConvertSOtoMessage( + (*message), (*message_to_send), allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string"); return; } @@ -484,6 +526,7 @@ void RPCServiceImpl::SendMessageToHMI( return; } + bool allow_unknown_parameters = false; // SmartObject |message| has no way to declare priority for now std::shared_ptr<Message> message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); @@ -497,7 +540,17 @@ void RPCServiceImpl::SendMessageToHMI( logger_, "Attached schema to message, result if valid: " << message->isValid()); - if (!ConvertSOtoMessage(*message, *message_to_send)) { + if (IsAppServiceRPC((*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt(), + commands::Command::CommandSource::SOURCE_SDL_TO_HMI)) { + LOG4CXX_DEBUG(logger_, + "Allowing unknown parameters for response function " + << (*message)[jhs::S_PARAMS][jhs::S_FUNCTION_ID].asInt()); + + allow_unknown_parameters = true; + } + + if (!ConvertSOtoMessage( + *message, *message_to_send, allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Cannot send message to HMI: failed to create string"); return; @@ -506,6 +559,42 @@ void RPCServiceImpl::SendMessageToHMI( messages_to_hmi_.PostMessage(impl::MessageToHmi(message_to_send)); } +bool RPCServiceImpl::IsAppServiceRPC(int32_t function_id, + commands::Command::CommandSource source) { + // General RPCs related to App Services + if ((source == commands::Command::CommandSource::SOURCE_MOBILE) || + (source == + commands::Command::CommandSource::SOURCE_SDL)) { // MOBILE COMMANDS + switch (function_id) { + case mobile_apis::FunctionID::GetSystemCapabilityID: + case mobile_apis::FunctionID::OnSystemCapabilityUpdatedID: + return true; + break; + } + } else if ((source == commands::Command::CommandSource::SOURCE_HMI) || + (source == commands::Command::CommandSource:: + SOURCE_SDL_TO_HMI)) { // HMI COMMANDS + switch (function_id) { + case hmi_apis::FunctionID::BasicCommunication_OnSystemCapabilityUpdated: + return true; + break; + } + } + + // RPCs handled by app services plugin + auto plugin = + app_manager_.GetPluginManager().FindPluginToProcess(function_id, source); + if (!plugin) { + return false; + } + if ((*plugin).PluginName() != plugin_names::app_service_rpc_plugin) { + return false; + } + application_manager::CommandFactory& factory = (*plugin).GetCommandFactory(); + + return factory.IsAbleToProcess(function_id, source); +} + void RPCServiceImpl::set_protocol_handler( protocol_handler::ProtocolHandler* handler) { protocol_handler_ = handler; @@ -518,7 +607,8 @@ void RPCServiceImpl::set_hmi_message_handler( bool RPCServiceImpl::ConvertSOtoMessage( const ns_smart_device_link::ns_smart_objects::SmartObject& message, - Message& output) { + Message& output, + const bool allow_unknown_parameters) { LOG4CXX_AUTO_TRACE(logger_); if (smart_objects::SmartType_Null == message.getType() || @@ -543,16 +633,16 @@ bool RPCServiceImpl::ConvertSOtoMessage( switch (protocol_type) { case 0: { if (protocol_version == 1) { - if (!formatters::CFormatterJsonSDLRPCv1::toString(message, - output_string)) { + if (!formatters::CFormatterJsonSDLRPCv1::toString( + message, output_string, !allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } output.set_protocol_version( protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1); } else { - if (!formatters::CFormatterJsonSDLRPCv2::toString(message, - output_string)) { + if (!formatters::CFormatterJsonSDLRPCv2::toString( + message, output_string, !allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } @@ -564,7 +654,8 @@ bool RPCServiceImpl::ConvertSOtoMessage( break; } case 1: { - if (!formatters::FormatterJsonRpc::ToString(message, output_string)) { + if (!formatters::FormatterJsonRpc::ToString( + message, output_string, !allow_unknown_parameters)) { LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } @@ -577,7 +668,7 @@ bool RPCServiceImpl::ConvertSOtoMessage( return false; } - LOG4CXX_DEBUG(logger_, "Convertion result: " << output_string); + LOG4CXX_DEBUG(logger_, "Conversion result: " << output_string); output.set_connection_key(message.getElement(jhs::S_PARAMS) .getElement(strings::connection_key) @@ -624,6 +715,43 @@ mobile_apis::MOBILE_API& RPCServiceImpl::mobile_so_factory() { return mobile_so_factory_; } +void RPCServiceImpl::CheckSourceForUnsupportedRequest( + const commands::MessageSharedPtr message, + commands::Command::CommandSource source) { + int32_t message_type = + (*(message.get()))[strings::params][strings::message_type].asInt(); + uint32_t correlation_id = + (*message)[strings::params].keyExists(strings::correlation_id) + ? (*message)[strings::params][strings::correlation_id].asUInt() + : 0; + const uint32_t connection_key = static_cast<uint32_t>( + (*message)[strings::params][strings::connection_key].asUInt()); + mobile_apis::FunctionID::eType function_id = + static_cast<mobile_apis::FunctionID::eType>( + (*message)[strings::params][strings::function_id].asInt()); + if ((source == commands::Command::CommandSource::SOURCE_MOBILE && + kRequest == message_type) || + (source == commands::Command::CommandSource::SOURCE_SDL && + kResponse == message_type)) { + smart_objects::SmartObjectSPtr response = + MessageHelper::CreateNegativeResponse(connection_key, + static_cast<int32_t>(function_id), + correlation_id, + 0); + + // Since we are dealing with an unknown RPC, there is no schema attached + // to the message, so we have to convert the result to string directly + std::string result_code; + smart_objects::EnumConversionHelper<mobile_apis::Result::eType>:: + EnumToString(mobile_apis::Result::UNSUPPORTED_REQUEST, &result_code); + (*response)[strings::msg_params][strings::result_code] = result_code; + (*response)[strings::msg_params][strings::info] = + "Module does not recognize this function id"; + + SendMessageToMobile(response); + } +} + } // namespace rpc_service } // namespace application_manager diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index ff9ebb6208..54033b12ab 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -27,6 +27,7 @@ const char* app_launch_last_session = "app_launch_last_session"; const char* policy_app_id = "policyAppID"; const char* hmi_app_id = "hmiAppID"; const char* device_id = "deviceID"; +const char* subscribe = "subscribe"; const char* subscribed_for_way_points = "subscribed_for_way_points"; const char* url = "url"; const char* urlScheme = "urlScheme"; @@ -43,7 +44,7 @@ const char* ngn_media_screen_app_name = "ngnMediaScreenAppName"; const char* vr_synonyms = "vrSynonyms"; const char* uses_vehicle_data = "usesVehicleData"; const char* is_media_application = "isMediaApplication"; -const char* greyOut = "greyOut"; +const char* grey_out = "greyOut"; const char* language_desired = "languageDesired"; const char* auto_activated_id = "autoActivateID"; const char* app_type = "appType"; @@ -145,6 +146,7 @@ const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; const char* video_streaming_capability = "videoStreamingCapability"; const char* rc_capability = "remoteControlCapability"; +const char* app_services_capabilities = "appServicesCapabilities"; const char* day_color_scheme = "dayColorScheme"; const char* night_color_scheme = "nightColorScheme"; const char* primary_color = "primaryColor"; @@ -155,10 +157,19 @@ const char* green = "green"; const char* blue = "blue"; const char* display_layout = "displayLayout"; const char* icon_resumed = "iconResumed"; +const char* nicknames = "nicknames"; +const char* enabled = "enabled"; +const char* auth_token = "authToken"; +const char* cloud_transport_type = "cloudTransportType"; +const char* hybrid_app_preference = "hybridAppPreference"; +const char* is_cloud_application = "isCloudApplication"; +const char* cloud_connection_status = "cloudConnectionStatus"; +const char* endpoint = "endpoint"; // PutFile const char* sync_file_name = "syncFileName"; const char* file_name = "fileName"; +const char* file_path = "filePath"; const char* file_type = "fileType"; const char* file_size = "fileSize"; const char* crc32_check_sum = "crc"; @@ -172,6 +183,7 @@ const char* is_template = "isTemplate"; const char* image = "image"; const char* type = "type"; const char* system_file = "systemFile"; +const char* is_system_file = "isSystemFile"; const char* offset = "offset"; const char* length = "length"; const char* secondary_image = "secondaryImage"; @@ -220,6 +232,7 @@ const char* fuel_level = "fuelLevel"; const char* fuel_level_state = "fuelLevel_State"; const char* instant_fuel_consumption = "instantFuelConsumption"; const char* fuel_range = "fuelRange"; +const char* cloud_app_vehicle_id = "cloudAppVehicleID"; const char* external_temp = "externalTemperature"; const char* turn_signal = "turnSignal"; const char* vin = "vin"; @@ -260,6 +273,49 @@ const char* system_software_version = "systemSoftwareVersion"; const char* priority = "priority"; const char* engine_oil_life = "engineOilLife"; +// app services +const char* app_service_manifest = "appServiceManifest"; +const char* service_name = "serviceName"; +const char* service_type = "serviceType"; +const char* service_icon = "serviceIcon"; +const char* allow_app_consumers = "allowAppConsumers"; +const char* rpc_spec_version = "rpcSpecVersion"; +const char* handled_rpcs = "handledRPCs"; +const char* media_service_manifest = "mediaServiceManifest"; +const char* app_service_record = "appServiceRecord"; +const char* service_id = "serviceID"; +const char* service_manifest = "serviceManifest"; +const char* service_published = "servicePublished"; +const char* service_active = "serviceActive"; +const char* app_service_id = "appServiceId"; +const char* service_data = "serviceData"; +const char* media_service_data = "mediaServiceData"; +const char* media_image = "mediaImage"; +const char* weather_service_data = "weatherServiceData"; +const char* location = "location"; +const char* current_forecast = "currentForecast"; +const char* minute_forecast = "minuteForecast"; +const char* hourly_forecast = "hourlyForecast"; +const char* multiday_forecast = "multidayForecast"; +const char* weather_icon = "weatherIcon"; +const char* navigation_service_data = "navigationServiceData"; +const char* origin = "origin"; +const char* destination = "destination"; +const char* instructions = "instructions"; +const char* location_details = "locationDetails"; +const char* request_service_active = "requestServiceActive"; +const char* app_services = "appServices"; +const char* update_reason = "updateReason"; +const char* updated_app_service_record = "updatedAppServiceRecord"; +const char* service_records = "serviceRecords"; +const char* activate = "activate"; +const char* set_as_default = "setAsDefault"; +const char* origin_app = "originApp"; + +// sis data +const char* station_short_name = "stationShortName"; +const char* station_location = "stationLocation"; + // resuming const char* application_commands = "applicationCommands"; const char* application_submenus = "applicationSubMenus"; @@ -288,8 +344,12 @@ const char* time_stamp = "timeStamp"; const char* manual_text_entry = "manualTextEntry"; const char* image_type_supported = "imageTypeSupported"; const char* unexpected_disconnect = "unexpectedDisconnect"; + +const char* shifted = "shifted"; +const char* altitude = "altitude"; const char* longitude_degrees = "longitudeDegrees"; const char* latitude_degrees = "latitudeDegrees"; + const char* address = "address"; const char* country_name = "countryName"; const char* country_code = "countryCode"; @@ -319,6 +379,8 @@ const char* const keypress_mode_supported = "keypressModeSupported"; const char* const limited_characters_list_supported = "limitedCharactersListSupported"; const char* const auto_complete_text_supported = "autoCompleteTextSupported"; +const char* const send_location_enabled = "sendLocationEnabled"; +const char* const get_way_points_enabled = "getWayPointsEnabled"; const char* const entity_type = "entityType"; const char* const entity_id = "entityID"; const char* const status = "status"; diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 3d44709657..994c7b8b7f 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -32,8 +32,8 @@ #include "application_manager/state_controller_impl.h" #include <tuple> -#include "application_manager/usage_statistics.h" #include "application_manager/rpc_service.h" +#include "application_manager/usage_statistics.h" #include "utils/helpers.h" #include "connection_handler/connection_handler.h" @@ -68,7 +68,7 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr) void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr state, - const bool send_activate_app) { + const bool request_hmi_state_change) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); DCHECK_OR_RETURN_VOID(state); @@ -101,12 +101,17 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, static_cast<hmi_apis::Common_HMILevel::eType>( resolved_state->hmi_level()); - if (send_activate_app) { - const int64_t corr_id = SendBCActivateApp(app, hmi_level, true); - if (-1 != corr_id) { - subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp, - corr_id); - waiting_for_activate_[app->app_id()] = resolved_state; + if (request_hmi_state_change) { + const int64_t result = RequestHMIStateChange(app, hmi_level, true); + if (-1 != result) { + const uint32_t corr_id = static_cast<uint32_t>(result); + subscribe_on_event( + hmi_apis::Common_HMILevel::NONE == hmi_level + ? hmi_apis::FunctionID::BasicCommunication_CloseApplication + : hmi_apis::FunctionID::BasicCommunication_ActivateApp, + corr_id); + waiting_for_response_[app->app_id()] = resolved_state; + app_mngr_.set_application_id(corr_id, app->hmi_app_id()); return; } LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateApp"); @@ -120,7 +125,7 @@ void StateControllerImpl::SetRegularState( const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state, const mobile_apis::VideoStreamingState::eType video_state, - const bool send_activate_app) { + const bool request_hmi_state_change) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); HmiStatePtr prev_regular = app->RegularHmiState(); @@ -132,13 +137,13 @@ void StateControllerImpl::SetRegularState( hmi_state->set_audio_streaming_state(audio_state); hmi_state->set_video_streaming_state(video_state); hmi_state->set_system_context(prev_regular->system_context()); - SetRegularState(app, hmi_state, send_activate_app); + SetRegularState(app, hmi_state, request_hmi_state_change); } void StateControllerImpl::SetRegularState( ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, - const bool send_activate_app) { + const bool request_hmi_state_change) { using namespace mobile_apis; LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); @@ -150,7 +155,7 @@ void StateControllerImpl::SetRegularState( hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level)); hmi_state->set_video_streaming_state(CalcVideoState(app, hmi_level)); hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN); - SetRegularState(app, hmi_state, send_activate_app); + SetRegularState(app, hmi_state, request_hmi_state_change); } void StateControllerImpl::SetRegularState( @@ -159,7 +164,7 @@ void StateControllerImpl::SetRegularState( const mobile_apis::AudioStreamingState::eType audio_state, const mobile_apis::VideoStreamingState::eType video_state, const mobile_apis::SystemContext::eType system_context, - const bool send_activate_app) { + const bool request_hmi_state_change) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); HmiStatePtr hmi_state = @@ -169,7 +174,7 @@ void StateControllerImpl::SetRegularState( hmi_state->set_audio_streaming_state(audio_state); hmi_state->set_video_streaming_state(video_state); hmi_state->set_system_context(system_context); - SetRegularState(app, hmi_state, send_activate_app); + SetRegularState(app, hmi_state, request_hmi_state_change); } void StateControllerImpl::SetRegularState( @@ -475,7 +480,9 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel( return result; } - const bool is_active_app_exist = (bool)app_mngr_.active_application(); + ApplicationConstSharedPtr active_app = app_mngr_.active_application(); + const bool is_active_app_exist = + (active_app.use_count() != 0) && active_app->app_id() != app->app_id(); if (is_audio_app) { if (does_audio_app_with_same_type_exist) { result = app_mngr_.GetDefaultHmiLevel(app); @@ -622,10 +629,11 @@ void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app, "Resolving HMI level conflicts for app " << app->app_id()); ForEachApplication(HmiLevelConflictResolver(app, state, this)); } +void StateControllerImpl::on_event(const event_engine::MobileEvent& event) {} void StateControllerImpl::on_event(const event_engine::Event& event) { - using smart_objects::SmartObject; using event_engine::Event; + using smart_objects::SmartObject; using namespace hmi_apis; namespace FunctionID = hmi_apis::FunctionID; @@ -633,8 +641,9 @@ void StateControllerImpl::on_event(const event_engine::Event& event) { const SmartObject& message = event.smart_object(); const FunctionID::eType id = static_cast<FunctionID::eType>(event.id()); switch (id) { - case FunctionID::BasicCommunication_ActivateApp: { - OnActivateAppResponse(message); + case FunctionID::BasicCommunication_ActivateApp: + case FunctionID::BasicCommunication_CloseApplication: { + OnHMIResponse(message); break; } case FunctionID::BasicCommunication_OnAppActivated: { @@ -788,31 +797,33 @@ void StateControllerImpl::OnApplicationRegistered( OnStateChanged(app, initial_state, new_state); } -int64_t StateControllerImpl::SendBCActivateApp( +int64_t StateControllerImpl::RequestHMIStateChange( ApplicationConstSharedPtr app, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr bc_activate_app_request = - MessageHelper::GetBCActivateAppRequestToHMI( - app, - app_mngr_.connection_handler().get_session_observer(), - app_mngr_.GetPolicyHandler(), - level, - send_policy_priority, - app_mngr_); - if (!bc_activate_app_request) { - LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest"); + smart_objects::SmartObjectSPtr request = NULL; + if (hmi_apis::Common_HMILevel::NONE == level) { + request = MessageHelper::GetBCCloseApplicationRequestToHMI(app, app_mngr_); + } else { + request = MessageHelper::GetBCActivateAppRequestToHMI( + app, + app_mngr_.GetPolicyHandler(), + level, + send_policy_priority, + app_mngr_); + } + if (!request) { + LOG4CXX_ERROR(logger_, "Unable to create request"); return -1; } - if (!app_mngr_.GetRPCService().ManageHMICommand(bc_activate_app_request)) { - LOG4CXX_ERROR(logger_, "Unable to send BC.ActivateAppRequest"); + if (!app_mngr_.GetRPCService().ManageHMICommand(request)) { + LOG4CXX_ERROR(logger_, "Unable to send request"); return -1; } - const int64_t corr_id = - (*bc_activate_app_request)[strings::params][strings::correlation_id] - .asInt(); - return corr_id; + const uint32_t corr_id = + (*request)[strings::params][strings::correlation_id].asUInt(); + return static_cast<int64_t>(corr_id); } void StateControllerImpl::ApplyPostponedStateForApp(ApplicationSharedPtr app) { @@ -887,18 +898,18 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) { SetRegularState(app, new_regular, false); } -void StateControllerImpl::OnActivateAppResponse( +void StateControllerImpl::OnHMIResponse( const smart_objects::SmartObject& message) { const hmi_apis::Common_Result::eType code = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); - const int32_t correlation_id = - message[strings::params][strings::correlation_id].asInt(); + const uint32_t correlation_id = + message[strings::params][strings::correlation_id].asUInt(); const uint32_t hmi_app_id = app_mngr_.application_id(correlation_id); ApplicationSharedPtr application = app_mngr_.application_by_hmi_app(hmi_app_id); if (application && hmi_apis::Common_Result::SUCCESS == code) { - HmiStatePtr pending_state = waiting_for_activate_[application->app_id()]; + HmiStatePtr pending_state = waiting_for_response_[application->app_id()]; DCHECK_OR_RETURN_VOID(pending_state); ApplyRegularState(application, pending_state); } diff --git a/src/components/application_manager/src/system_time/system_time_handler_impl.cc b/src/components/application_manager/src/system_time/system_time_handler_impl.cc index 27f0972c01..f5d08a8ebf 100644 --- a/src/components/application_manager/src/system_time/system_time_handler_impl.cc +++ b/src/components/application_manager/src/system_time/system_time_handler_impl.cc @@ -41,6 +41,8 @@ namespace application_manager { +CREATE_LOGGERPTR_GLOBAL(logger_, "SystemTimeHandler") + SystemTimeHandlerImpl::SystemTimeHandlerImpl( ApplicationManager& application_manager) : event_engine::EventObserver(application_manager.event_dispatcher()) @@ -56,7 +58,7 @@ SystemTimeHandlerImpl::SystemTimeHandlerImpl( SystemTimeHandlerImpl::~SystemTimeHandlerImpl() { LOG4CXX_AUTO_TRACE(logger_); - unsubscribe_from_all_events(); + unsubscribe_from_all_hmi_events(); } void SystemTimeHandlerImpl::DoSystemTimeQuery() { diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc index 1cfccd816e..3f1831f449 100644 --- a/src/components/application_manager/src/usage_statistics.cc +++ b/src/components/application_manager/src/usage_statistics.cc @@ -31,9 +31,9 @@ */ #include "application_manager/usage_statistics.h" -#include "smart_objects/smart_object.h" -#include "smart_objects/enum_schema_item.h" #include "policy/usage_statistics/statistics_manager.h" +#include "smart_objects/enum_schema_item.h" +#include "smart_objects/smart_object.h" #include "utils/macro.h" using namespace mobile_apis; diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 02cf58485a..ccec05a795 100755 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -56,6 +56,7 @@ set(testSources ${AM_TEST_DIR}/request_info_test.cc ${AM_TEST_DIR}/resumption_sql_queries_test.cc ${AM_TEST_DIR}/event_engine_test.cc + ${AM_TEST_DIR}/mobile_event_engine_test.cc ${AM_TEST_DIR}/policy_event_observer_test.cc ${AM_TEST_DIR}/application_impl_test.cc ${AM_TEST_DIR}/hmi_capabilities_test.cc @@ -63,6 +64,8 @@ set(testSources ${AM_TEST_DIR}/application_state_test.cc ${AM_TEST_DIR}/usage_statistics_test.cc ${AM_TEST_DIR}/policy_handler_test.cc + ${AM_TEST_DIR}/app_service_manager_test.cc + ${AM_TEST_DIR}/rpc_passing_handler_test.cc ${AM_TEST_DIR}/application_manager_impl_test.cc ${AM_TEST_DIR}/application_helper_test.cc ${AM_TEST_DIR}/command_holder_test.cc diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc index 3293a8908d..b3bb8dd705 100644 --- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc +++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc @@ -30,16 +30,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include <sstream> -#include "utils/macro.h" #include "application_manager/app_launch/app_launch_ctrl_impl.h" #include "application_manager/mock_app_launch_data.h" #include "application_manager/mock_app_launch_settings.h" -#include "application_manager/mock_resume_ctrl.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_resume_ctrl.h" #include "connection_handler/mock_connection_handler.h" +#include "gtest/gtest.h" +#include "utils/macro.h" #include "utils/test_async_waiter.h" @@ -47,14 +47,14 @@ namespace test { namespace components { namespace app_launch_test { +using ::testing::AtLeast; +using ::testing::DoAll; +using ::testing::InSequence; +using ::testing::Invoke; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; using ::testing::Truly; -using ::testing::NiceMock; -using ::testing::Invoke; -using ::testing::AtLeast; -using ::testing::InSequence; -using ::testing::DoAll; namespace ch_test = test::components::connection_handler_test; namespace am_test = test::components::application_manager_test; diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc index dc96fcf176..d0f2e21f4c 100644 --- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc +++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc @@ -31,18 +31,18 @@ */ #include <algorithm> +#include <memory> #include <sstream> #include <string> -#include <memory> #include "gtest/gtest.h" -#include "utils/macro.h" #include "sql_database.h" #include "sql_query.h" +#include "utils/macro.h" -#include "utils/file_system.h" -#include "application_manager/mock_app_launch_settings.h" #include "application_manager/app_launch/app_launch_data_db.h" #include "application_manager/app_launch/app_launch_sql_queries.h" +#include "application_manager/mock_app_launch_settings.h" +#include "utils/file_system.h" namespace test { namespace components { @@ -51,9 +51,9 @@ namespace app_launch_test { using namespace file_system; using namespace app_launch; -using ::testing::ReturnRef; -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnRef; namespace { const std::string kEmptyString = ""; diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc index 4541970c70..12a375685e 100644 --- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc +++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc @@ -30,27 +30,27 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "application_manager/app_launch/app_launch_data_json.h" #include <algorithm> -#include <sstream> #include <memory> -#include "json/json.h" +#include <sstream> +#include "application_manager/mock_app_launch_settings.h" +#include "application_manager/smart_object_keys.h" #include "gtest/gtest.h" -#include "utils/macro.h" -#include "utils/file_system.h" -#include "utils/date_time.h" +#include "json/json.h" #include "resumption/last_state_impl.h" #include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/mock_app_launch_settings.h" -#include "application_manager/app_launch/app_launch_data_json.h" +#include "utils/date_time.h" +#include "utils/file_system.h" +#include "utils/macro.h" namespace test { namespace components { namespace test_app_launch { using ::testing::_; -using ::testing::Return; using ::testing::NiceMock; +using ::testing::Return; namespace am = application_manager; using namespace Json; @@ -339,6 +339,6 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) { } } -} // namespace app_launch +} // namespace test_app_launch } // namespace components } // namespace test diff --git a/src/components/application_manager/test/app_service_manager_test.cc b/src/components/application_manager/test/app_service_manager_test.cc new file mode 100644 index 0000000000..0f2b4469a2 --- /dev/null +++ b/src/components/application_manager/test/app_service_manager_test.cc @@ -0,0 +1,452 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <gmock/gmock.h> + +#include "application_manager/commands/command.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "resumption/mock_last_state.h" +#include "smart_objects/smart_object.h" + +namespace test { +namespace components { +namespace application_manager_test { + +using testing::_; +using ::testing::DoAll; +using ::testing::Mock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; + +namespace am = application_manager; + +const char* kAppServiceSection = "AppServices"; +const char* kDefaults = "defaults"; +const std::string kServiceType = "MEDIA"; +const std::string kServiceName = "service_name"; +const std::string kServiceId = "service_id"; +const std::string kPolicyAppId = "p_app_id"; +const uint32_t kConnectionKey = 43629; +const uint32_t kHMIConnectionKey = 0; + +MATCHER_P(CapabilityUpdateMatcher, reason, "") { + smart_objects::SmartObject& services_updated = + arg[am::strings::system_capability] + [am::strings::app_services_capabilities][am::strings::app_services]; + if (smart_objects::SmartType_Array != services_updated.getType()) { + return false; + } + for (size_t i = 0; i < services_updated.length(); i++) { + smart_objects::SmartObject& service_cap = services_updated[i]; + if (reason == service_cap[am::strings::update_reason].asInt()) { + return true; + } + } + return false; +} + +class AppServiceManagerTest : public testing::Test { + public: + AppServiceManagerTest() + : mock_app_ptr_(new MockApplication) + , app_service_manager_(mock_app_manager_, mock_last_state_) + , mock_message_helper_( + application_manager::MockMessageHelper::message_helper_mock()) { + Mock::VerifyAndClearExpectations(mock_message_helper_); + } + ~AppServiceManagerTest() { + Mock::VerifyAndClearExpectations(mock_message_helper_); + } + + void SetUp() OVERRIDE { + ON_CALL(*mock_message_helper_, BroadcastCapabilityUpdate(_, _)) + .WillByDefault(Return()); + ON_CALL(mock_settings_, embedded_services()) + .WillByDefault(ReturnRef(embedded_services_)); + ON_CALL(mock_app_manager_, get_settings()) + .WillByDefault(ReturnRef(mock_settings_)); + ON_CALL(*mock_app_ptr_, policy_app_id()) + .WillByDefault(Return(kPolicyAppId)); + ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(dict_)); + auto app_ptr = std::static_pointer_cast<am::Application>(mock_app_ptr_); + ON_CALL(mock_app_manager_, application(kConnectionKey)) + .WillByDefault(Return(app_ptr)); + } + + protected: + smart_objects::SmartObject GenerateMediaManifest( + bool allow_app_consumers, std::string app_service_name = kServiceName) { + smart_objects::SmartObject manifest(smart_objects::SmartType_Map); + manifest[am::strings::service_type] = "MEDIA"; + manifest[am::strings::service_name] = app_service_name; + manifest[am::strings::allow_app_consumers] = allow_app_consumers; + manifest[am::strings::media_service_manifest] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + return manifest; + } + + smart_objects::SmartObject PublishService( + uint32_t connection_key = kConnectionKey, + std::string service_name = kServiceName, + bool first_run = true) { + smart_objects::SmartObject manifest = + GenerateMediaManifest(true, service_name); + + Json::Value empty_json; + EXPECT_CALL(mock_last_state_, get_dictionary()) + .WillOnce(ReturnRef(empty_json)); + + EXPECT_CALL(*mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher( + mobile_apis::ServiceUpdateReason::PUBLISHED), + _)) + .WillOnce(Return()); + if (first_run) { + EXPECT_CALL(*mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher( + mobile_apis::ServiceUpdateReason::ACTIVATED), + _)) + .WillOnce(Return()); + } + bool mobile_service = connection_key != kHMIConnectionKey; + return app_service_manager_.PublishAppService( + manifest, mobile_service, connection_key); + } + + void CheckCapabilityUpdate(smart_objects::SmartObject& msg_params, + size_t length, + std::string service_id, + mobile_apis::ServiceUpdateReason::eType reason, + bool published, + bool active) { + smart_objects::SmartObject& services_updated = + msg_params[am::strings::system_capability] + [am::strings::app_services_capabilities] + [am::strings::app_services]; + ASSERT_EQ(smart_objects::SmartType_Array, services_updated.getType()); + EXPECT_EQ(length, services_updated.length()); + for (size_t i = 0; i < services_updated.length(); i++) { + smart_objects::SmartObject& service_cap = services_updated[i]; + if (service_id == service_cap[am::strings::updated_app_service_record] + [am::strings::service_id] + .asString()) { + CheckCapability(service_cap, service_id, reason, published, active); + return; + } + } + FAIL() << "Unable to find service in capability update with service_id: " + << service_id; + } + + void CheckCapability(smart_objects::SmartObject& app_service_capability, + std::string service_id, + mobile_apis::ServiceUpdateReason::eType reason, + bool published, + bool active) { + EXPECT_EQ(reason, + app_service_capability[am::strings::update_reason].asInt()); + smart_objects::SmartObject& updated_record = + app_service_capability[am::strings::updated_app_service_record]; + EXPECT_EQ(service_id, updated_record[am::strings::service_id].asString()); + EXPECT_EQ(published, + updated_record[am::strings::service_published].asBool()); + EXPECT_EQ(active, updated_record[am::strings::service_active].asBool()); + } + + Json::Value dict_; + std::vector<std::string> embedded_services_; + std::shared_ptr<MockApplication> mock_app_ptr_; + MockApplicationManager mock_app_manager_; + resumption_test::MockLastState mock_last_state_; + MockApplicationManagerSettings mock_settings_; + application_manager::AppServiceManager app_service_manager_; + application_manager::MockMessageHelper* mock_message_helper_; +}; + +TEST_F(AppServiceManagerTest, PublishAppService_Mobile_SUCCESS) { + smart_objects::SmartObject manifest = GenerateMediaManifest(true); + + Json::Value empty_json; + EXPECT_CALL(mock_last_state_, get_dictionary()) + .WillOnce(ReturnRef(empty_json)); + + smart_objects::SmartObject syscap_update_published; + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::PUBLISHED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_published), Return())); + + smart_objects::SmartObject syscap_update_activated; + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_activated), Return())); + + auto record = + app_service_manager_.PublishAppService(manifest, true, kConnectionKey); + + // Check final record + std::string service_id = record[am::strings::service_id].asString(); + EXPECT_EQ(manifest, record[am::strings::service_manifest]); + EXPECT_TRUE(record[am::strings::service_published].asBool()); + EXPECT_TRUE(record[am::strings::service_active].asBool()); + + // Check first capability update + CheckCapabilityUpdate(syscap_update_published, + 1, + service_id, + mobile_apis::ServiceUpdateReason::PUBLISHED, + true, + false); + + // Check second capability update + CheckCapabilityUpdate(syscap_update_activated, + 1, + service_id, + mobile_apis::ServiceUpdateReason::ACTIVATED, + true, + true); +} + +TEST_F(AppServiceManagerTest, PublishAppService_HMI_SUCCESS) { + smart_objects::SmartObject manifest = GenerateMediaManifest(true); + + Json::Value empty_json; + EXPECT_CALL(mock_last_state_, get_dictionary()) + .WillOnce(ReturnRef(empty_json)); + + smart_objects::SmartObject syscap_update_published; + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::PUBLISHED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_published), Return())); + + smart_objects::SmartObject syscap_update_activated; + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_activated), Return())); + + auto record = app_service_manager_.PublishAppService(manifest, false); + + // Check final record + std::string service_id = record[am::strings::service_id].asString(); + EXPECT_EQ(manifest, record[am::strings::service_manifest]); + EXPECT_TRUE(record[am::strings::service_published].asBool()); + EXPECT_TRUE(record[am::strings::service_active].asBool()); + + // Check first capability update + CheckCapabilityUpdate(syscap_update_published, + 1, + service_id, + mobile_apis::ServiceUpdateReason::PUBLISHED, + true, + false); + + // Check second capability update + CheckCapabilityUpdate(syscap_update_activated, + 1, + service_id, + mobile_apis::ServiceUpdateReason::ACTIVATED, + true, + true); +} + +TEST_F(AppServiceManagerTest, UnpublishAppService_SUCCESS) { + auto record = PublishService(); + + smart_objects::SmartObject syscap_update_unpublished; + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::REMOVED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_unpublished), Return())); + std::string service_id = record[am::strings::service_id].asString(); + + EXPECT_TRUE(app_service_manager_.UnpublishAppService(service_id)); + + // Check removed capability update + CheckCapabilityUpdate(syscap_update_unpublished, + 1, + service_id, + mobile_apis::ServiceUpdateReason::REMOVED, + false, + false); +} + +TEST_F(AppServiceManagerTest, ActivateAppService_AlreadyActivated) { + auto record = PublishService(); + + // No capability update + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED), + _)) + .Times(0); + std::string service_id = record[am::strings::service_id].asString(); + + EXPECT_TRUE(app_service_manager_.ActivateAppService(service_id)); +} + +TEST_F(AppServiceManagerTest, ActivateAppService_TwoApps_SUCCESS) { + // Register two services with the same service type, the first is activated + // automatically + auto record = PublishService(); + auto record2 = PublishService(kConnectionKey + 1, kServiceName + "2", false); + + // No capability update + smart_objects::SmartObject syscap_update_activated; + EXPECT_CALL( + *mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher(mobile_apis::ServiceUpdateReason::ACTIVATED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_activated), Return())); + std::string service_id = record[am::strings::service_id].asString(); + std::string service_id2 = record2[am::strings::service_id].asString(); + + // Activate the second service + EXPECT_TRUE(app_service_manager_.ActivateAppService(service_id2)); + + // Check that the first service is deactivated + CheckCapabilityUpdate(syscap_update_activated, + 2, + service_id, + mobile_apis::ServiceUpdateReason::DEACTIVATED, + true, + false); + + // Check that the second service is activated + CheckCapabilityUpdate(syscap_update_activated, + 2, + service_id2, + mobile_apis::ServiceUpdateReason::ACTIVATED, + true, + true); +} + +TEST_F(AppServiceManagerTest, DeactivateAppService_SUCCESS) { + auto record = PublishService(); + + smart_objects::SmartObject syscap_update_deactivated; + EXPECT_CALL(*mock_message_helper_, + BroadcastCapabilityUpdate( + CapabilityUpdateMatcher( + mobile_apis::ServiceUpdateReason::DEACTIVATED), + _)) + .WillOnce(DoAll(SaveArg<0>(&syscap_update_deactivated), Return())); + std::string service_id = record[am::strings::service_id].asString(); + + EXPECT_TRUE(app_service_manager_.DeactivateAppService(service_id)); + + // Check deactivated capability update + CheckCapabilityUpdate(syscap_update_deactivated, + 1, + service_id, + mobile_apis::ServiceUpdateReason::DEACTIVATED, + true, + false); +} + +TEST_F(AppServiceManagerTest, ActiveServiceForType_SUCCESS) { + auto record = PublishService(); + + auto service = app_service_manager_.ActiveServiceForType(kServiceType); + + ASSERT_FALSE(service == NULL); + EXPECT_EQ(record, service->record); + EXPECT_EQ(kConnectionKey, service->connection_key); + EXPECT_TRUE(service->mobile_service); +} + +TEST_F(AppServiceManagerTest, EmbeddedServiceForType_SUCCESS) { + auto record = PublishService(kHMIConnectionKey); + + auto service = app_service_manager_.EmbeddedServiceForType(kServiceType); + + ASSERT_FALSE(service == NULL); + EXPECT_EQ(record, service->record); + EXPECT_FALSE(service->mobile_service); +} + +TEST_F(AppServiceManagerTest, FindServiceByID_SUCCESS) { + auto record = PublishService(); + + std::string service_id = record[am::strings::service_id].asString(); + auto service = app_service_manager_.FindServiceByID(service_id); + + ASSERT_FALSE(service == NULL); + EXPECT_EQ(record, service->record); + EXPECT_EQ(kConnectionKey, service->connection_key); + EXPECT_TRUE(service->mobile_service); +} + +TEST_F(AppServiceManagerTest, GetAllServiceRecords_OneService_SUCCESS) { + auto record = PublishService(); + + auto records = app_service_manager_.GetAllServiceRecords(); + + ASSERT_EQ(1u, records.size()); + EXPECT_EQ(record, records[0]); +} + +TEST_F(AppServiceManagerTest, GetActiveServices_OneService_SUCCESS) { + auto record = PublishService(); + + auto services = app_service_manager_.GetActiveServices(); + + ASSERT_EQ(1u, services.size()); + EXPECT_EQ(record, services[0].record); + EXPECT_EQ(kConnectionKey, services[0].connection_key); + EXPECT_TRUE(services[0].mobile_service); +} + +} // namespace application_manager_test +} // namespace components +} // namespace test
\ No newline at end of file diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc index 3203839fc2..d9d590a171 100644 --- a/src/components/application_manager/test/application_helper_test.cc +++ b/src/components/application_manager/test/application_helper_test.cc @@ -36,42 +36,42 @@ #include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_message_helper.h" -#include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/mock_policy_settings.h" +#include "policy/usage_statistics/mock_statistics_manager.h" #include "application_manager/application.h" #include "application_manager/application_impl.h" #include "application_manager/application_manager_impl.h" -#include "application_manager/usage_statistics.h" #include "application_manager/helpers/application_helper.h" #include "application_manager/smart_object_keys.h" -#include "interfaces/MOBILE_API.h" +#include "application_manager/usage_statistics.h" #include "connection_handler/device.h" +#include "interfaces/MOBILE_API.h" #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "utils/macro.h" -#include "test/resumption/mock_last_state.h" #include "media_manager/mock_media_manager.h" +#include "test/resumption/mock_last_state.h" namespace { const uint8_t expected_tread_pool_size = 2u; const uint8_t stop_streaming_timeout = 1u; const std::string kDirectoryName = "./test_storage"; const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"}; -} +} // namespace namespace test { namespace components { namespace application_manager_test { +using resumption_test::MockLastState; +using test::components::media_manager_test::MockMediaManager; using testing::_; using ::testing::Mock; using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using resumption_test::MockLastState; -using test::components::media_manager_test::MockMediaManager; using namespace application_manager; using namespace policy_handler_test; @@ -255,6 +255,6 @@ TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) { application_manager::DeleteApplicationData(app_impl_, app_manager_impl_); } -} // application_manager_test -} // components -} // test +} // namespace application_manager_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 301ed227b8..46d35bdbef 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -35,23 +35,23 @@ #include <stdint.h> #include <iostream> -#include "gtest/gtest.h" #include "application_manager/hmi_state.h" +#include "gtest/gtest.h" #include "utils/file_system.h" -#include "application_manager/mock_message_helper.h" -#include "utils/custom_string.h" +#include "application_manager/event_engine/event_dispatcher.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application_manager_settings.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/mock_request_controller_settings.h" -#include "application_manager/event_engine/event_dispatcher.h" -#include "application_manager/state_controller.h" -#include "resumption/last_state.h" -#include "application_manager/resumption/resume_ctrl.h" -#include "application_manager/policies/mock_policy_handler_interface.h" #include "application_manager/mock_resume_ctrl.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/resumption/resume_ctrl.h" +#include "application_manager/state_controller.h" #include "policy/usage_statistics/mock_statistics_manager.h" +#include "resumption/last_state.h" #include "smart_objects/smart_object.h" +#include "utils/custom_string.h" namespace test { namespace components { @@ -63,10 +63,10 @@ using namespace mobile_apis; namespace custom_str = utils::custom_string; using ::testing::_; +using ::testing::AtLeast; using ::testing::Mock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::AtLeast; using usage_statistics_test::MockStatisticsManager; typedef void (ApplicationImpl::*AddSet)(HmiStatePtr args); @@ -91,9 +91,11 @@ class ApplicationImplTest : public ::testing::Test { EXPECT_CALL(mock_application_manager_settings_, app_storage_folder()) .WillRepeatedly(ReturnRef(directory_name)); EXPECT_CALL(mock_application_manager_settings_, - audio_data_stopped_timeout()).WillOnce(Return(0)); + audio_data_stopped_timeout()) + .WillOnce(Return(0)); EXPECT_CALL(mock_application_manager_settings_, - video_data_stopped_timeout()).WillOnce(Return(0)); + video_data_stopped_timeout()) + .WillOnce(Return(0)); app_impl.reset( new ApplicationImpl(app_id, policy_app_id, @@ -118,6 +120,13 @@ class ApplicationImplTest : public ::testing::Test { AddSet hmi_action); void CheckCurrentHMIState(); + // 'directory_name' has to be declared prior to 'app_impl' so that when + // deleting ApplicationImplTest class, 'directory_name' will be removed + // after 'app_impl' runs its destructor. + // (ApplicationImpl's destructor calls CleanupFiles(), which will call + // application_manager_.get_settings().app_storage_folder() and will + // access 'directory_name'.) + const std::string directory_name = "./test_storage"; MockApplicationManagerSettings mock_application_manager_settings_; MockApplicationManager mock_application_manager_; std::shared_ptr<ApplicationImpl> app_impl; @@ -126,7 +135,6 @@ class ApplicationImplTest : public ::testing::Test { std::string mac_address; connection_handler::DeviceHandle device_handle; custom_str::CustomString app_name; - const std::string directory_name = "./test_storage"; HmiState::StateID state_id; HmiStatePtr testHmiState; HMILevel::eType test_lvl; @@ -660,7 +668,8 @@ TEST_F(ApplicationImplTest, TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) { EXPECT_CALL(*MockMessageHelper::message_helper_mock(), - SendHashUpdateNotification(app_id, _)).Times(1); + SendHashUpdateNotification(app_id, _)) + .Times(1); resumprion_test::MockResumeCtrl mock_resume_ctrl; EXPECT_CALL(mock_application_manager_, resume_controller()) .WillOnce(ReturnRef(mock_resume_ctrl)); @@ -672,7 +681,8 @@ TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) { TEST_F(ApplicationImplTest, UpdateHash_AppMngrSuspended) { EXPECT_CALL(*MockMessageHelper::message_helper_mock(), - SendHashUpdateNotification(app_id, _)).Times(0); + SendHashUpdateNotification(app_id, _)) + .Times(0); resumprion_test::MockResumeCtrl mock_resume_ctrl; EXPECT_CALL(mock_application_manager_, resume_controller()) .WillOnce(ReturnRef(mock_resume_ctrl)); @@ -693,7 +703,8 @@ TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingNotApproved) { TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) { app_impl->set_video_streaming_approved(true); EXPECT_CALL(*MockMessageHelper::message_helper_mock(), - SendNaviSetVideoConfig(app_id, _, _)).Times(0); + SendNaviSetVideoConfig(app_id, _, _)) + .Times(0); smart_objects::SmartObject params; app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params); @@ -701,7 +712,8 @@ TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) { TEST_F(ApplicationImplTest, SetVideoConfig_NotMobileNavi) { EXPECT_CALL(*MockMessageHelper::message_helper_mock(), - SendNaviSetVideoConfig(app_id, _, _)).Times(0); + SendNaviSetVideoConfig(app_id, _, _)) + .Times(0); smart_objects::SmartObject params; app_impl->SetVideoConfig(protocol_handler::ServiceType::kAudio, params); @@ -726,13 +738,15 @@ TEST_F(ApplicationImplTest, StartStreaming_Audio_StreamingNotApproved) { TEST_F(ApplicationImplTest, StartStreaming_StreamingApproved) { app_impl->set_video_streaming_approved(true); EXPECT_CALL(*MockMessageHelper::message_helper_mock(), - SendNaviStartStream(app_id, _)).Times(0); + SendNaviStartStream(app_id, _)) + .Times(0); app_impl->StartStreaming(protocol_handler::ServiceType::kMobileNav); app_impl->set_audio_streaming_approved(true); EXPECT_CALL(*MockMessageHelper::message_helper_mock(), - SendAudioStartStream(app_id, _)).Times(0); + SendAudioStartStream(app_id, _)) + .Times(0); app_impl->StartStreaming(protocol_handler::ServiceType::kAudio); } diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc index 8ab852779a..939ef98620 100644 --- a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc +++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc @@ -33,25 +33,25 @@ #include <memory> #include <string> -#include "gtest/gtest.h" #include "application_manager/application.h" #include "application_manager/application_impl.h" #include "application_manager/application_manager_impl.h" +#include "gtest/gtest.h" #include "utils/custom_string.h" #include "encryption/hashing.h" #include "application_manager/mock_application_manager_settings.h" -#include "application_manager/mock_resumption_data.h" #include "application_manager/mock_command_factory.h" #include "application_manager/mock_request.h" +#include "application_manager/mock_resumption_data.h" +#include "application_manager/mock_rpc_plugin.h" +#include "application_manager/mock_rpc_plugin_manager.h" #include "connection_handler/mock_connection_handler.h" #include "policy/mock_policy_settings.h" #include "policy/usage_statistics/mock_statistics_manager.h" -#include "protocol_handler/mock_session_observer.h" #include "protocol_handler/mock_protocol_handler.h" -#include "application_manager/mock_rpc_plugin_manager.h" -#include "application_manager/mock_rpc_plugin.h" +#include "protocol_handler/mock_session_observer.h" #include "utils/optional.h" namespace test { @@ -63,9 +63,9 @@ namespace am = application_manager; using testing::_; using ::testing::DoAll; using ::testing::Mock; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; using ::testing::SetArgPointee; using namespace application_manager; @@ -269,6 +269,6 @@ TEST_F(ApplicationManagerImplMockHmiTest, Mock::VerifyAndClearExpectations(&mock_command_factory); } -} // application_manager_test +} // namespace application_manager_test } // namespace components } // namespace test diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index 7e57b51329..804959e1db 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -29,38 +29,43 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +#include <bson_object.h> #include <stdint.h> #include <memory> #include <set> #include <string> #include <vector> -#include <bson_object.h> -#include "gtest/gtest.h" #include "application_manager/application.h" #include "application_manager/application_impl.h" #include "application_manager/application_manager_impl.h" +#include "application_manager/mock_app_service_manager.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_resumption_data.h" -#include "application_manager/mock_rpc_service.h" #include "application_manager/mock_rpc_plugin_manager.h" +#include "application_manager/mock_rpc_service.h" +#include "application_manager/policies/mock_policy_handler_interface.h" #include "application_manager/resumption/resume_ctrl_impl.h" #include "application_manager/test/include/application_manager/mock_message_helper.h" #include "connection_handler/mock_connection_handler.h" +#include "gtest/gtest.h" #include "hmi_message_handler/mock_hmi_message_handler.h" #include "media_manager/mock_media_manager.h" #include "policy/mock_policy_settings.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "protocol/bson_object_keys.h" -#include "protocol_handler/mock_session_observer.h" #include "protocol_handler/mock_protocol_handler.h" +#include "protocol_handler/mock_session_observer.h" +#include "resumption/mock_last_state.h" #include "utils/custom_string.h" #include "utils/file_system.h" #include "utils/lock.h" -#include "utils/push_log.h" #include "encryption/hashing.h" +#ifdef ENABLE_LOG +#include "utils/push_log.h" +#endif namespace test { namespace components { @@ -72,15 +77,16 @@ namespace con_test = connection_handler_test; using testing::_; using ::testing::An; -using ::testing::Matcher; using ::testing::ByRef; using ::testing::DoAll; +using ::testing::Matcher; using ::testing::Mock; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; using ::testing::SaveArg; using ::testing::SetArgPointee; +using ::testing::SetArgReferee; using namespace application_manager; @@ -96,6 +102,19 @@ connection_handler::DeviceHandle kDeviceId = 12345u; const std::string kAppId = "someID"; const uint32_t kConnectionKey = 1232u; const std::string kAppName = "appName"; + +#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) +// Cloud application params +const std::string kEndpoint = "endpoint"; +const std::string kEndpoint2 = "https://fakesdlcloudapptesting.com:8080"; +const std::string kAuthToken = "auth_token"; +const std::string kCertificate = "cert"; +const std::string kTransportType = "WS"; +const mobile_api::HybridAppPreference::eType kHybridAppPreference = + mobile_api::HybridAppPreference::CLOUD; +const std::string kHybridAppPreferenceStr = "CLOUD"; +const bool kEnabled = true; +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT } // namespace class ApplicationManagerImplTest : public ::testing::Test { @@ -106,6 +125,10 @@ class ApplicationManagerImplTest : public ::testing::Test { std::make_shared<NiceMock<resumption_test::MockResumptionData> >( mock_app_mngr_)) , mock_rpc_service_(new MockRPCService) + , mock_policy_handler_( + new test::components::policy_test::MockPolicyHandlerInterface) + , mock_app_service_manager_( + new MockAppServiceManager(mock_app_mngr_, mock_last_state_)) , mock_message_helper_( application_manager::MockMessageHelper::message_helper_mock()) @@ -122,14 +145,21 @@ class ApplicationManagerImplTest : public ::testing::Test { protected: void SetUp() OVERRIDE { CreateAppManager(); - ON_CALL(mock_connection_handler_, GetDataOnSessionKey(_, _, _, &kDeviceId)) - .WillByDefault(DoAll(SetArgPointee<3u>(app_id_), Return(0))); + ON_CALL(mock_session_observer_, GetDataOnSessionKey(_, _, _, _)) + .WillByDefault(DoAll(SetArgPointee<3u>(kDeviceId), Return(0))); ON_CALL(mock_connection_handler_, get_session_observer()) .WillByDefault(ReturnRef(mock_session_observer_)); - app_manager_impl_->SetRPCService(mock_rpc_service_); + app_manager_impl_->SetMockRPCService(mock_rpc_service_); app_manager_impl_->resume_controller().set_resumption_storage( mock_storage_); app_manager_impl_->set_connection_handler(&mock_connection_handler_); + ON_CALL(*mock_app_service_manager_, UnpublishServices(_)) + .WillByDefault(Return()); + ON_CALL(*mock_app_service_manager_, OnAppActivated(_)) + .WillByDefault(Return()); + app_manager_impl_->SetAppServiceManager(mock_app_service_manager_); + Json::Value empty; + ON_CALL(mock_last_state_, get_dictionary()).WillByDefault(ReturnRef(empty)); } void CreateAppManager() { @@ -149,7 +179,8 @@ class ApplicationManagerImplTest : public ::testing::Test { ON_CALL(mock_application_manager_settings_, default_timeout()) .WillByDefault(ReturnRef(kTimeout)); ON_CALL(mock_application_manager_settings_, - application_list_update_timeout()).WillByDefault(Return(kTimeout)); + application_list_update_timeout()) + .WillByDefault(Return(kTimeout)); app_manager_impl_.reset(new am::ApplicationManagerImpl( mock_application_manager_settings_, mock_policy_settings_)); @@ -196,16 +227,24 @@ class ApplicationManagerImplTest : public ::testing::Test { connection_handler::DeviceHandle secondary_device_handle, std::string secondary_transport_device_string); +#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) + void AddCloudAppToPendingDeviceMap(); + void CreatePendingApplication(); +#endif uint32_t app_id_; NiceMock<policy_test::MockPolicySettings> mock_policy_settings_; std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_; - std::unique_ptr<rpc_service::RPCService> mock_rpc_service_; + MockRPCService* mock_rpc_service_; + resumption_test::MockLastState mock_last_state_; NiceMock<con_test::MockConnectionHandler> mock_connection_handler_; NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_; NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_; + test::components::policy_test::MockPolicyHandlerInterface* + mock_policy_handler_; application_manager_test::MockApplicationManager mock_app_mngr_; std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_; + MockAppServiceManager* mock_app_service_manager_; application_manager::MockMessageHelper* mock_message_helper_; std::shared_ptr<MockApplication> mock_app_ptr_; @@ -1120,9 +1159,10 @@ bool ApplicationManagerImplTest::CheckResumptionRequiredTransportAvailableTest( TransportTypeProfileStringFromDeviceHandle(secondary_device_handle)) .WillOnce(Return(secondary_transport_device_string)); } else { - EXPECT_CALL(mock_session_observer_, - TransportTypeProfileStringFromDeviceHandle( - secondary_device_handle)).WillOnce(Return(std::string(""))); + EXPECT_CALL( + mock_session_observer_, + TransportTypeProfileStringFromDeviceHandle(secondary_device_handle)) + .WillOnce(Return(std::string(""))); } return app_manager_impl_->CheckResumptionRequiredTransportAvailable( @@ -1413,6 +1453,280 @@ TEST_F(ApplicationManagerImplTest, EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true)); } -} // application_manager_test +#if defined(CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT) +void ApplicationManagerImplTest::AddCloudAppToPendingDeviceMap() { + app_manager_impl_->SetMockPolicyHandler(mock_policy_handler_); + std::vector<std::string> enabled_apps{"1234"}; + EXPECT_CALL(*mock_policy_handler_, GetEnabledCloudApps(_)) + .WillOnce(SetArgReferee<0>(enabled_apps)); + EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _)) + .WillOnce(DoAll(SetArgReferee<1>(kEnabled), + SetArgReferee<2>(kEndpoint2), + SetArgReferee<3>(kCertificate), + SetArgReferee<4>(kAuthToken), + SetArgReferee<5>(kTransportType), + SetArgReferee<6>(kHybridAppPreferenceStr), + Return(true))); + + std::vector<std::string> nicknames{"CloudApp"}; + EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _)) + .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true))); + + EXPECT_CALL(*mock_policy_handler_, GetIconUrl(_)).WillOnce(Return("")); + + app_manager_impl_->RefreshCloudAppInformation(); +} + +void ApplicationManagerImplTest::CreatePendingApplication() { + AddCloudAppToPendingDeviceMap(); + + // CreatePendingApplication + transport_manager::DeviceInfo device_info( + 1, "mac", kEndpoint2, "CLOUD_WEBSOCKET"); + std::vector<std::string> nicknames{"CloudApp"}; + EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _)) + .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true))); + std::vector<std::string> enabled_apps{"1234"}; + + EXPECT_CALL(*mock_policy_handler_, GetStatisticManager()) + .WillOnce(Return(std::shared_ptr<usage_statistics::StatisticsManager>( + new usage_statistics_test::MockStatisticsManager()))); + EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _)) + .WillOnce(DoAll(SetArgReferee<1>(kEnabled), + SetArgReferee<2>(kEndpoint2), + SetArgReferee<3>(kCertificate), + SetArgReferee<4>(kAuthToken), + SetArgReferee<5>(kTransportType), + SetArgReferee<6>(kHybridAppPreferenceStr), + Return(true))); + // Expect Update app list + EXPECT_CALL(*mock_rpc_service_, ManageHMICommand(_, _)).Times(1); + app_manager_impl_->CreatePendingApplication(1, device_info, 1); + AppsWaitRegistrationSet app_list = + app_manager_impl_->AppsWaitingForRegistration().GetData(); + EXPECT_EQ(1u, app_list.size()); +} + +TEST_F(ApplicationManagerImplTest, CreatePendingApplication) { + CreatePendingApplication(); +} + +TEST_F(ApplicationManagerImplTest, SetPendingState) { + AddCloudAppToPendingDeviceMap(); + AddMockApplication(); + AppsWaitRegistrationSet app_list = + app_manager_impl_->AppsWaitingForRegistration().GetData(); + EXPECT_EQ(0u, app_list.size()); + EXPECT_CALL(*mock_app_ptr_, policy_app_id()).WillRepeatedly(Return("1234")); + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(123)); + std::string mac = "MAC_ADDRESS"; + EXPECT_CALL(*mock_app_ptr_, mac_address()).WillRepeatedly(ReturnRef(mac)); + transport_manager::DeviceInfo device_info( + 1, "mac", kEndpoint2, "CLOUD_WEBSOCKET"); + + std::vector<std::string> enabled_apps{"1234"}; + + EXPECT_CALL(*mock_policy_handler_, GetEnabledCloudApps(_)) + .WillOnce(SetArgReferee<0>(enabled_apps)); + EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _)) + .WillOnce(DoAll(SetArgReferee<1>(kEnabled), + SetArgReferee<2>(kEndpoint2), + SetArgReferee<3>(kCertificate), + SetArgReferee<4>(kAuthToken), + SetArgReferee<5>(kTransportType), + SetArgReferee<6>(kHybridAppPreferenceStr), + Return(true))); + + std::vector<std::string> nicknames{"CloudApp"}; + EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _)) + .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true))); + + EXPECT_CALL(*mock_policy_handler_, GetIconUrl(_)).WillOnce(Return("")); + + plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager = + new plugin_manager::MockRPCPluginManager; + std::unique_ptr<plugin_manager::RPCPluginManager> mock_rpc_plugin_manager_ptr( + mock_rpc_plugin_manager); + app_manager_impl_->SetPluginManager(mock_rpc_plugin_manager_ptr); + + EXPECT_CALL(mock_connection_handler_, GetDeviceID(_, _)) + .WillOnce(DoAll(SetArgPointee<1>(0), Return(true))); + app_manager_impl_->SetPendingApplicationState(1, device_info); + app_list = app_manager_impl_->AppsWaitingForRegistration().GetData(); + EXPECT_EQ(1u, app_list.size()); +} + +TEST_F(ApplicationManagerImplTest, + RegisterApplication_CloudAppRegisterSuccess) { + std::shared_ptr<MockApplication> waiting_app = + std::make_shared<MockApplication>(); + ON_CALL(*waiting_app, device()).WillByDefault(Return(kDeviceId)); + EXPECT_CALL(*waiting_app, cloud_app_endpoint()) + .WillOnce(ReturnRef(kEndpoint)); + EXPECT_CALL(*waiting_app, auth_token()).WillOnce(ReturnRef(kAuthToken)); + EXPECT_CALL(*waiting_app, cloud_app_certificate()) + .WillOnce(ReturnRef(kCertificate)); + EXPECT_CALL(*waiting_app, cloud_app_transport_type()) + .WillOnce(ReturnRef(kTransportType)); + EXPECT_CALL(*waiting_app, hybrid_app_preference()) + .WillOnce(ReturnRef(kHybridAppPreference)); + ON_CALL(*waiting_app, is_cloud_app()).WillByDefault(Return(true)); + EXPECT_CALL(*waiting_app, policy_app_id()).WillRepeatedly(Return(kAppId)); + app_manager_impl_->AddMockPendingApplication(waiting_app); + + EXPECT_CALL( + mock_session_observer_, + GetDataOnSessionKey(kConnectionKey, + _, + _, + testing::An<connection_handler::DeviceHandle*>())) + .WillOnce(DoAll(SetArgPointee<3u>(kDeviceId), Return(0))); + EXPECT_CALL(*mock_rpc_service_, + ManageMobileCommand(_, commands::Command::SOURCE_SDL)) + .Times(0); + smart_objects::SmartObject request_for_registration( + smart_objects::SmartType_Map); + + smart_objects::SmartObject& params = + request_for_registration[strings::msg_params]; + params[strings::app_id] = kAppId; + params[strings::language_desired] = mobile_api::Language::EN_US; + params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US; + + request_for_registration[strings::params][strings::connection_key] = + kConnectionKey; + request_for_registration[strings::msg_params][strings::app_name] = kAppName; + request_for_registration[strings::msg_params][strings::sync_msg_version] + [strings::minor_version] = APIVersion::kAPIV2; + request_for_registration[strings::msg_params][strings::sync_msg_version] + [strings::major_version] = APIVersion::kAPIV3; + + request_for_registration[strings::params][strings::protocol_version] = + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2; + + smart_objects::SmartObjectSPtr request_for_registration_ptr = + std::make_shared<smart_objects::SmartObject>(request_for_registration); + + ApplicationSharedPtr application = + app_manager_impl_->RegisterApplication(request_for_registration_ptr); + + EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2, + application->protocol_version()); + EXPECT_EQ(APIVersion::kAPIV2, + application->version().min_supported_api_version); + EXPECT_EQ(APIVersion::kAPIV3, + application->version().max_supported_api_version); + EXPECT_EQ(kEndpoint, application->cloud_app_endpoint()); + EXPECT_EQ(kAuthToken, application->auth_token()); + EXPECT_EQ(kCertificate, application->cloud_app_certificate()); + EXPECT_EQ(kTransportType, application->cloud_app_transport_type()); + EXPECT_EQ(kHybridAppPreference, application->hybrid_app_preference()); +} + +TEST_F(ApplicationManagerImplTest, + RegisterApplication_CloudAppRegisterFailed_DISALLOWED) { + std::shared_ptr<MockApplication> waiting_app = + std::make_shared<MockApplication>(); + EXPECT_CALL(*waiting_app, device()).WillRepeatedly(Return(kDeviceId)); + EXPECT_CALL(*waiting_app, is_cloud_app()).WillRepeatedly(Return(true)); + EXPECT_CALL(*waiting_app, policy_app_id()) + .WillRepeatedly(Return("Fake" + kAppId)); + app_manager_impl_->AddMockPendingApplication(waiting_app); + + EXPECT_CALL( + mock_session_observer_, + GetDataOnSessionKey(kConnectionKey, + _, + _, + testing::An<connection_handler::DeviceHandle*>())) + .WillOnce(DoAll(SetArgPointee<3u>(kDeviceId), Return(0))); + EXPECT_CALL(*mock_rpc_service_, + ManageMobileCommand(_, commands::Command::SOURCE_SDL)) + .WillOnce(Return(true)); + smart_objects::SmartObject request_for_registration( + smart_objects::SmartType_Map); + + smart_objects::SmartObject& params = + request_for_registration[strings::msg_params]; + params[strings::app_id] = kAppId; + params[strings::language_desired] = mobile_api::Language::EN_US; + params[strings::hmi_display_language_desired] = mobile_api::Language::EN_US; + + request_for_registration[strings::params][strings::connection_key] = + kConnectionKey; + request_for_registration[strings::msg_params][strings::app_name] = kAppName; + request_for_registration[strings::msg_params][strings::sync_msg_version] + [strings::minor_version] = APIVersion::kAPIV2; + request_for_registration[strings::msg_params][strings::sync_msg_version] + [strings::major_version] = APIVersion::kAPIV3; + + request_for_registration[strings::params][strings::protocol_version] = + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2; + + smart_objects::SmartObjectSPtr request_for_registration_ptr = + std::make_shared<smart_objects::SmartObject>(request_for_registration); + + ApplicationSharedPtr application = + app_manager_impl_->RegisterApplication(request_for_registration_ptr); + EXPECT_EQ(0, application.use_count()); +} + +TEST_F(ApplicationManagerImplTest, PolicyIDByIconUrl_Success) { + app_manager_impl_->SetMockPolicyHandler(mock_policy_handler_); + std::vector<std::string> enabled_apps{"1234"}; + EXPECT_CALL(*mock_policy_handler_, GetEnabledCloudApps(_)) + .WillOnce(SetArgReferee<0>(enabled_apps)); + EXPECT_CALL(*mock_policy_handler_, GetCloudAppParameters(_, _, _, _, _, _, _)) + .WillOnce(DoAll(SetArgReferee<1>(kEnabled), + SetArgReferee<2>(kEndpoint2), + SetArgReferee<3>(kCertificate), + SetArgReferee<4>(kAuthToken), + SetArgReferee<5>(kTransportType), + SetArgReferee<6>(kHybridAppPreferenceStr), + Return(true))); + + std::vector<std::string> nicknames{"CloudApp"}; + EXPECT_CALL(*mock_policy_handler_, GetInitialAppData(_, _, _)) + .WillOnce(DoAll(SetArgPointee<1>(nicknames), Return(true))); + + const std::string url = "https://www.fakeiconurl.com/icon.png"; + EXPECT_CALL(*mock_policy_handler_, GetIconUrl("1234")) + .WillRepeatedly(Return(url)); + + app_manager_impl_->RefreshCloudAppInformation(); + + std::string result = app_manager_impl_->PolicyIDByIconUrl(url); + EXPECT_EQ(result, "1234"); +} + +TEST_F(ApplicationManagerImplTest, SetIconFileFromSystemRequest_Success) { + CreatePendingApplication(); + Mock::VerifyAndClearExpectations(mock_message_helper_); + + file_system::CreateDirectory(kDirectoryName); + const std::string full_icon_path = kDirectoryName + "/1234"; + ASSERT_TRUE(file_system::CreateFile(full_icon_path)); + + const std::string url = "https://www.fakeiconurl.com/icon.png"; + EXPECT_CALL(*mock_policy_handler_, GetIconUrl("1234")) + .WillRepeatedly(Return(url)); + + smart_objects::SmartObject dummy_object(smart_objects::SmartType_Map); + smart_objects::SmartObjectSPtr sptr = + std::make_shared<smart_objects::SmartObject>(dummy_object); + + EXPECT_CALL(*mock_message_helper_, + CreateModuleInfoSO( + hmi_apis::FunctionID::BasicCommunication_UpdateAppList, _)) + .WillOnce(Return(sptr)); + EXPECT_CALL(*mock_rpc_service_, ManageHMICommand(sptr, _)).Times(1); + EXPECT_CALL(mock_application_manager_settings_, app_icons_folder()) + .WillOnce(ReturnRef(kDirectoryName)); + app_manager_impl_->SetIconFileFromSystemRequest("1234"); + EXPECT_TRUE(file_system::RemoveDirectory(kDirectoryName, true)); +} + +#endif // CLOUD_APP_WEBSOCKET_TRANSPORT_SUPPORT +} // namespace application_manager_test } // namespace components } // namespace test diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc index a0bfa2890f..5ebcdd29c7 100644 --- a/src/components/application_manager/test/application_state_test.cc +++ b/src/components/application_manager/test/application_state_test.cc @@ -31,15 +31,15 @@ */ #include "application_manager/application_state.h" -#include "gtest/gtest.h" +#include "application_manager/event_engine/event_dispatcher.h" #include "application_manager/hmi_state.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/mock_application.h" -#include "application_manager/event_engine/event_dispatcher.h" -#include "resumption/last_state.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/policies/policy_handler.h" -#include "application_manager/state_controller.h" #include "application_manager/resumption/resume_ctrl.h" +#include "application_manager/state_controller.h" +#include "gtest/gtest.h" +#include "resumption/last_state.h" namespace test { namespace components { @@ -60,7 +60,7 @@ std::vector<StateID> GenerateCurrentStates() { states.push_back(StateID::STATE_ID_DEACTIVATE_HMI); return states; } -} +} // namespace class ApplicationStateTest : public ::testing::Test { public: diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc index 56e24b8d29..8a5c639775 100644 --- a/src/components/application_manager/test/command_holder_test.cc +++ b/src/components/application_manager/test/command_holder_test.cc @@ -36,8 +36,8 @@ #include "application_manager/commands/command.h" #include "smart_objects/smart_object.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" #include "application_manager/mock_rpc_service.h" namespace test { @@ -84,7 +84,7 @@ TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) { mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_); // Act - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)); cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand); } @@ -99,7 +99,8 @@ TEST_F(CommandHolderImplTest, HoldMany_ExpectReleaseSame) { } while (iterations < 5); // Act - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)) + .Times(iterations); cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand); } @@ -112,7 +113,7 @@ TEST_F(CommandHolderImplTest, Hold_Drop_ExpectNoReleased) { // Act cmd_holder.Clear(mock_app_ptr_); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)).Times(0); cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand); } @@ -127,7 +128,7 @@ TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) { std::shared_ptr<MockApplication> another_app = std::make_shared<MockApplication>(); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)).Times(0); cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand); } @@ -146,7 +147,8 @@ TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) { std::make_shared<MockApplication>(); cmd_holder.Clear(another_app); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)) + .Times(iterations); cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand); } @@ -160,7 +162,7 @@ TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) { mock_app_ptr_, am::CommandHolder::CommandType::kMobileCommand, cmd_ptr_); // Act - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_, _)); cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand); EXPECT_CALL( @@ -171,6 +173,6 @@ TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) { am::CommandHolder::CommandType::kMobileCommand); } -} // application_manager_test -} // components -} // test +} // namespace application_manager_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt index 33258e60db..556f3a5032 100644 --- a/src/components/application_manager/test/commands/CMakeLists.txt +++ b/src/components/application_manager/test/commands/CMakeLists.txt @@ -59,6 +59,7 @@ set(LIBRARIES ApplicationManager jsoncpp Policy + Resumption ) create_test("commands_test" "${SOURCES}" "${LIBRARIES}") diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc index 222f16ef46..734a7d91b8 100644 --- a/src/components/application_manager/test/commands/command_impl_test.cc +++ b/src/components/application_manager/test/commands/command_impl_test.cc @@ -31,35 +31,35 @@ */ #include <stdint.h> -#include <string> #include <algorithm> #include <functional> #include <set> +#include <string> #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" +#include "application_manager/application_manager.h" #include "application_manager/commands/command.h" #include "application_manager/commands/command_impl.h" -#include "application_manager/application_manager.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { namespace commands_test { namespace command_impl { -using ::testing::Return; -using ::testing::AtLeast; using ::testing::_; +using ::testing::AtLeast; +using ::testing::Return; namespace strings = ::application_manager::strings; -using ::application_manager::commands::CommandImpl; using ::application_manager::ApplicationManager; -using ::application_manager::commands::MessageSharedPtr; using ::application_manager::ApplicationSharedPtr; +using ::application_manager::commands::CommandImpl; +using ::application_manager::commands::MessageSharedPtr; using ::test::components::application_manager_test::MockApplication; typedef std::shared_ptr<MockApplication> MockAppPtr; @@ -82,14 +82,15 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> { public: class UnwrappedCommandImpl : CommandImpl { public: - using CommandImpl::ReplaceMobileWithHMIAppId; using CommandImpl::ReplaceHMIWithMobileAppId; + using CommandImpl::ReplaceMobileWithHMIAppId; - UnwrappedCommandImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager, - app_mngr::rpc_service::RPCService& rpc_service, - app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handler) + UnwrappedCommandImpl( + const MessageSharedPtr& message, + ApplicationManager& application_manager, + application_manager::rpc_service::RPCService& rpc_service, + application_manager::HMICapabilities& hmi_capabilities, + policy::PolicyHandlerInterface& policy_handler) : CommandImpl(message, application_manager, rpc_service, diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc index c70dd14852..cf26c19249 100644 --- a/src/components/application_manager/test/commands/command_request_impl_test.cc +++ b/src/components/application_manager/test/commands/command_request_impl_test.cc @@ -31,25 +31,28 @@ */ #include <stdint.h> -#include <string> #include <algorithm> +#include <string> -#include "gtest/gtest.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/command_request_impl.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" +#include "application_manager/commands/commands_test.h" +#include "gtest/gtest.h" #include "utils/lock.h" -#include "utils/data_accessor.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" #include "application_manager/application_manager.h" -#include "application_manager/mock_application.h" #include "application_manager/event_engine/event.h" -#include "application_manager/mock_message_helper.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" #include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" +#include "utils/data_accessor.h" + +#include "application_manager/mock_app_service_manager.h" +#include "resumption/last_state_impl.h" namespace test { namespace components { @@ -61,19 +64,21 @@ namespace strings = am::strings; namespace hmi_response = am::hmi_response; using ::testing::_; +using ::testing::DoAll; using ::testing::Return; using ::testing::SaveArg; -using ::testing::DoAll; +using ::testing::SetArgReferee; -using am::commands::MessageSharedPtr; -using am::CommandParametersPermissions; -using am::event_engine::EventObserver; -using am::commands::CommandImpl; -using am::commands::CommandRequestImpl; using am::ApplicationManager; using am::ApplicationSet; -using am::RPCParams; +using am::CommandParametersPermissions; using am::MockHmiInterfaces; +using am::RPCParams; +using am::commands::CommandImpl; +using am::commands::CommandRequestImpl; +using am::commands::MessageSharedPtr; +using am::event_engine::EventObserver; +using test::components::application_manager_test::MockAppServiceManager; typedef am::commands::CommandRequestImpl::RequestState RequestState; @@ -100,10 +105,10 @@ class CommandRequestImplTest class UnwrappedCommandRequestImpl : public CommandRequestImpl { public: - using CommandRequestImpl::CheckAllowedParameters; - using CommandRequestImpl::RemoveDisallowedParameters; using CommandRequestImpl::AddDisallowedParameters; + using CommandRequestImpl::CheckAllowedParameters; using CommandRequestImpl::HasDisallowedParams; + using CommandRequestImpl::RemoveDisallowedParameters; UnwrappedCommandRequestImpl(const MessageSharedPtr& message, ApplicationManager& am, @@ -258,7 +263,7 @@ TEST_F(CommandRequestImplTest, CreateHMINotification_SUCCESS) { MessageSharedPtr result; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); command->CreateHMINotification(kInvalidFunctionId, *msg_params); @@ -280,7 +285,7 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) { .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Return `true` prevents call of `SendResponse` method; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); EXPECT_EQ(kCorrelationId, command->SendHMIRequest(kInvalidFunctionId, NULL, false)); @@ -298,7 +303,7 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) { .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Return `true` prevents call of `SendResponse` method; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); EXPECT_CALL(event_dispatcher_, add_observer(_, _, _)); EXPECT_EQ(kCorrelationId, @@ -585,6 +590,87 @@ TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) { command.reset(); } +TEST_F(CommandRequestImplTest, SendProviderRequest_ByServiceType) { + resumption::LastStateImpl last_state("app_storage_folder", + "app_info_storage"); + MockAppServiceManager app_service_manager(app_mngr_, last_state); + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(app_mngr_, GetAppServiceManager()) + .WillRepeatedly(ReturnRef(app_service_manager)); + EXPECT_CALL(app_service_manager, GetProviderByType("MEDIA", _, _, _)) + .WillOnce(DoAll(SetArgReferee<2>(mock_app), SetArgReferee<3>(false))); + + MessageSharedPtr result; + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + MessageSharedPtr msg = CreateMessage(); + (*msg)[strings::params][strings::function_id] = + mobile_apis::FunctionID::GetAppServiceDataID; + (*msg)[strings::msg_params][strings::service_type] = "MEDIA"; + + CommandPtr command = CreateCommand<UCommandRequestImpl>(msg); + command->SendProviderRequest( + mobile_apis::FunctionID::GetAppServiceDataID, + hmi_apis::FunctionID::AppService_GetAppServiceData, + &(*msg), + true); +} + +TEST_F(CommandRequestImplTest, SendProviderRequest_ByProviderID) { + resumption::LastStateImpl last_state("app_storage_folder", + "app_info_storage"); + MockAppServiceManager app_service_manager(app_mngr_, last_state); + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(app_mngr_, GetAppServiceManager()) + .WillRepeatedly(ReturnRef(app_service_manager)); + EXPECT_CALL(app_service_manager, GetProviderByID("serviceid12345", _, _, _)) + .WillOnce(DoAll(SetArgReferee<2>(mock_app), SetArgReferee<3>(false))); + + MessageSharedPtr result; + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + MessageSharedPtr msg = CreateMessage(); + (*msg)[strings::params][strings::function_id] = + mobile_apis::FunctionID::GetAppServiceDataID; + (*msg)[strings::msg_params][strings::service_id] = "serviceid12345"; + + CommandPtr command = CreateCommand<UCommandRequestImpl>(msg); + command->SendProviderRequest( + mobile_apis::FunctionID::GetAppServiceDataID, + hmi_apis::FunctionID::AppService_GetAppServiceData, + &(*msg), + true); +} + +TEST_F(CommandRequestImplTest, SendProviderRequestToHMI_ByProviderID) { + resumption::LastStateImpl last_state("app_storage_folder", + "app_info_storage"); + MockAppServiceManager app_service_manager(app_mngr_, last_state); + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(app_mngr_, GetAppServiceManager()) + .WillRepeatedly(ReturnRef(app_service_manager)); + EXPECT_CALL(app_service_manager, GetProviderByID("serviceid12345", _, _, _)) + .WillOnce(DoAll(SetArgReferee<2>(mock_app), SetArgReferee<3>(true))); + + MessageSharedPtr result; + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + MessageSharedPtr msg = CreateMessage(); + (*msg)[strings::params][strings::function_id] = + mobile_apis::FunctionID::GetAppServiceDataID; + (*msg)[strings::msg_params][strings::service_id] = "serviceid12345"; + + CommandPtr command = CreateCommand<UCommandRequestImpl>(msg); + command->SendProviderRequest( + mobile_apis::FunctionID::GetAppServiceDataID, + hmi_apis::FunctionID::AppService_GetAppServiceData, + &(*msg), + true); +} + } // namespace command_request_impl } // namespace commands_test } // namespace components diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc index 41cc654a24..6362ea702e 100644 --- a/src/components/application_manager/test/commands/command_response_impl_test.cc +++ b/src/components/application_manager/test/commands/command_response_impl_test.cc @@ -35,12 +35,12 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" -#include "application_manager/smart_object_keys.h" -#include "application_manager/commands/commands_test.h" #include "application_manager/commands/command.h" #include "application_manager/commands/command_response_impl.h" +#include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { @@ -50,8 +50,8 @@ namespace command_response_impl { namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; -using ::application_manager::commands::MessageSharedPtr; using ::application_manager::commands::CommandResponseImpl; +using ::application_manager::commands::MessageSharedPtr; class CommandResponseImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc index de0b5afb3c..6746e0d5ec 100644 --- a/src/components/application_manager/test/event_engine_test.cc +++ b/src/components/application_manager/test/event_engine_test.cc @@ -32,11 +32,11 @@ #include "gtest/gtest.h" -#include "application_manager/event_engine/event_observer.h" #include "application_manager/event_engine/event.h" #include "application_manager/event_engine/event_dispatcher_impl.h" -#include "application_manager/mock_event_observer.h" +#include "application_manager/event_engine/event_observer.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_event_observer.h" #include "smart_objects/smart_object.h" #include "interfaces/HMI_API.h" @@ -45,10 +45,12 @@ namespace test { namespace components { namespace event_engine_test { -using application_manager::event_engine::EventDispatcherImpl; using application_manager::event_engine::Event; +using application_manager::event_engine::EventDispatcherImpl; using application_manager::event_engine::EventObserver; using testing::_; +using ::testing::An; +using ::testing::Matcher; class EventEngineTest : public testing::Test { public: @@ -122,7 +124,9 @@ class EventEngineTest : public testing::Test { event_dispatcher_instance_->add_observer( event_id, correlation_id, event_observer_mock_); event_->set_smart_object(so); - EXPECT_CALL(event_observer_mock_, on_event(_)).Times(calls_number); + + EXPECT_CALL(event_observer_mock_, on_event(An<const Event&>())) + .Times(calls_number); event_dispatcher_instance_->raise_event(*event_); } }; diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc index f921eb1dde..dc6635b049 100644 --- a/src/components/application_manager/test/help_prompt_manager_test.cc +++ b/src/components/application_manager/test/help_prompt_manager_test.cc @@ -136,10 +136,12 @@ class HelpPromptManagerTest : public ::testing::Test { typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager MockAppManager; MockAppManager app_mngr_; + // put this before ApplicationImplTest instance, so that app_mngr_settings_ + // will still exist during app_impl_'s destructor. + NiceMock<MockApplicationManagerSettings> app_mngr_settings_; std::shared_ptr<ApplicationImplTest> app_impl_; MockHmiInterfaces mock_hmi_interfaces_; NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; - NiceMock<MockApplicationManagerSettings> app_mngr_settings_; std::shared_ptr<application_manager_test::MockApplication> mock_app_; sync_primitives::Lock app_lock_; MockRPCService mock_rpc_service_; @@ -175,11 +177,6 @@ void HelpPromptManagerTest::SetUp() { mock_help_prompt_manager_ = std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager()); - HmiStatePtr state = std::make_shared<HmiState>( - static_cast<std::shared_ptr<Application> >(mock_app_), - app_mngr_, - HmiState::STATE_ID_REGULAR); - std::string path = file_system::CreateDirectory("storage"); file_system::CreateFile(path + "/" + "certificate"); diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index ae95fca35f..e883e7bddb 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -36,32 +36,32 @@ #include <string> #include "application_manager/hmi_capabilities.h" -#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/mock_message_helper.h" -#include "smart_objects/enum_schema_item.h" +#include "gtest/gtest.h" #include "interfaces/HMI_API.h" +#include "smart_objects/enum_schema_item.h" +#include "smart_objects/smart_object.h" #include "application_manager/hmi_capabilities_for_testing.h" -#include "utils/file_system.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_rpc_service.h" +#include "application_manager/resumption/resume_ctrl.h" #include "application_manager/state_controller.h" #include "resumption/last_state_impl.h" -#include "application_manager/resumption/resume_ctrl.h" +#include "utils/file_system.h" namespace test { namespace components { namespace application_manager_test { using ::testing::_; -using ::testing::Return; -using ::testing::ReturnRef; using ::testing::AtLeast; -using ::testing::Invoke; using ::testing::InSequence; +using ::testing::Invoke; +using ::testing::Return; +using ::testing::ReturnRef; using namespace application_manager; @@ -76,7 +76,8 @@ class HMICapabilitiesTest : public ::testing::Test { EXPECT_CALL(app_mngr_, get_settings()) .WillRepeatedly(ReturnRef(mock_application_manager_settings_)); EXPECT_CALL(mock_application_manager_settings_, - hmi_capabilities_file_name()).WillOnce(ReturnRef(file_name_)); + hmi_capabilities_file_name()) + .WillOnce(ReturnRef(file_name_)); EXPECT_CALL(mock_event_dispatcher, add_observer(_, _, _)).Times(1); EXPECT_CALL(mock_event_dispatcher, remove_observer(_)).Times(1); EXPECT_CALL(mock_application_manager_settings_, launch_hmi()) @@ -140,9 +141,9 @@ struct CStringComparator { } }; -typedef std::map<const char*, - hmi_apis::Common_Language::eType, - CStringComparator> CStringToEnumMap; +typedef std:: + map<const char*, hmi_apis::Common_Language::eType, CStringComparator> + CStringToEnumMap; CStringToEnumMap InitCStringToEnumMap() { size_t value = sizeof(cstring_values_) / sizeof(cstring_values_[0]); @@ -407,7 +408,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { .asInt()); EXPECT_EQ(350, vs_capability_so[strings::preferred_resolution] - [strings::resolution_height].asInt()); + [strings::resolution_height] + .asInt()); EXPECT_TRUE(vs_capability_so.keyExists(strings::max_bitrate)); EXPECT_EQ(10000, vs_capability_so[strings::max_bitrate].asInt()); EXPECT_TRUE(vs_capability_so.keyExists(strings::supported_formats)); @@ -454,7 +456,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { rc_capability_so["climateControlCapabilities"][0]["fanSpeedAvailable"] .asBool()); EXPECT_TRUE(rc_capability_so["climateControlCapabilities"][0] - ["desiredTemperatureAvailable"].asBool()); + ["desiredTemperatureAvailable"] + .asBool()); EXPECT_TRUE( rc_capability_so["climateControlCapabilities"][0]["acEnableAvailable"] .asBool()); @@ -582,8 +585,9 @@ TEST_F(HMICapabilitiesTest, VerifyImageType) { void HMICapabilitiesTest::SetCooperating() { smart_objects::SmartObjectSPtr test_so; EXPECT_CALL(*(MockMessageHelper::message_helper_mock()), - CreateModuleInfoSO(_, _)).WillRepeatedly(Return(test_so)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + CreateModuleInfoSO(_, _)) + .WillRepeatedly(Return(test_so)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillRepeatedly(Return(true)); } diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc index ec88075212..5f07c1b9d1 100644 --- a/src/components/application_manager/test/hmi_language_handler_test.cc +++ b/src/components/application_manager/test/hmi_language_handler_test.cc @@ -32,18 +32,18 @@ #include <stdint.h> -#include "gtest/gtest.h" #include "application_manager/application_manager.h" #include "application_manager/hmi_language_handler.h" -#include "application_manager/state_controller.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_event_dispatcher.h" -#include "application_manager/mock_message_helper.h" -#include "application_manager/resumption/resume_ctrl_impl.h" #include "application_manager/mock_hmi_capabilities.h" -#include "application_manager/mock_application.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/mock_rpc_service.h" +#include "application_manager/resumption/resume_ctrl_impl.h" #include "application_manager/smart_object_keys.h" +#include "application_manager/state_controller.h" +#include "gtest/gtest.h" #include "test/resumption/mock_last_state.h" #include "utils/lock.h" @@ -54,13 +54,13 @@ namespace hmi_language_handler { namespace am = ::application_manager; -using am::event_engine::Event; using am::ApplicationSet; +using am::event_engine::Event; +using ::testing::_; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; -using ::testing::_; typedef NiceMock< ::test::components::application_manager_test::MockApplicationManager> diff --git a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h index 1980ffa100..3a44d7b3ff 100644 --- a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h @@ -37,11 +37,11 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" +#include "application_manager/commands/command_request_impl.h" #include "application_manager/smart_object_keys.h" #include "application_manager/test/include/application_manager/commands/commands_test.h" -#include "application_manager/commands/command_request_impl.h" #include "application_manager/test/include/application_manager/mock_event_dispatcher.h" +#include "smart_objects/smart_object.h" #include "application_manager/event_engine/event.h" @@ -49,12 +49,12 @@ namespace test { namespace components { namespace commands_test { +using ::test::components::event_engine_test::MockEventDispatcher; using ::testing::_; -using ::testing::Return; -using ::testing::SaveArg; using ::testing::DoAll; using ::testing::NiceMock; -using ::test::components::event_engine_test::MockEventDispatcher; +using ::testing::Return; +using ::testing::SaveArg; namespace am = ::application_manager; using am::commands::Command; using am::commands::CommandRequestImpl; @@ -105,7 +105,7 @@ class CommandRequestTest : public CommandsTest<kIsNice> { MessageSharedPtr CatchHMICommandResult(CallableT delegate, bool call_return = true) { MessageSharedPtr result_msg; - EXPECT_CALL(this->mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(this->mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(call_return))); delegate(); return result_msg; diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h index 9a961ea1a9..cd0514a0da 100644 --- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h @@ -36,38 +36,38 @@ #include <stdint.h> #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" #include "application_manager/commands/command.h" +#include "smart_objects/smart_object.h" #include "application_manager/mock_application_manager.h" -#include "test/application_manager/mock_application_manager_settings.h" -#include "application_manager/test/include/application_manager/mock_hmi_interface.h" -#include "application_manager/test/include/application_manager/mock_application.h" -#include "application_manager/test/include/application_manager/mock_message_helper.h" #include "application_manager/mock_application_manager_settings.h" -#include "application_manager/mock_rpc_service.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_rpc_service.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/test/include/application_manager/mock_application.h" +#include "application_manager/test/include/application_manager/mock_hmi_interface.h" +#include "application_manager/test/include/application_manager/mock_message_helper.h" +#include "test/application_manager/mock_application_manager_settings.h" namespace test { namespace components { namespace commands_test { namespace am = ::application_manager; -using ::testing::ReturnRef; -using ::testing::Return; -using ::testing::NiceMock; -using ::testing::Mock; using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnRef; -using ::smart_objects::SmartObject; +using am::ApplicationSharedPtr; +using am::MockMessageHelper; using am::commands::MessageSharedPtr; +using ::smart_objects::SmartObject; +using ::test::components::application_manager_test::MockApplication; using ::test::components::application_manager_test::MockApplicationManager; using ::test::components::application_manager_test:: MockApplicationManagerSettings; -using am::ApplicationSharedPtr; -using am::MockMessageHelper; -using ::test::components::application_manager_test::MockApplication; // Depending on the value type will be selected template <const bool kIf, class ThenT, class ElseT> @@ -100,9 +100,8 @@ class CommandsTest : public ::testing::Test { typedef typename TypeIf<kIsNice, NiceMock<MockApplicationManager>, MockApplicationManager>::Result MockAppManager; - typedef typename TypeIf<kIsNice, - NiceMock<MockApplication>, - MockApplication>::Result MockApp; + typedef typename TypeIf<kIsNice, NiceMock<MockApplication>, MockApplication>:: + Result MockApp; typedef std::shared_ptr<MockApp> MockAppPtr; virtual ~CommandsTest() { @@ -183,11 +182,11 @@ class CommandsTest : public ::testing::Test { void InitHMIToMobileResultConverter() { namespace MobileResult = mobile_apis::Result; namespace HMIResult = hmi_apis::Common_Result; - auto link_hmi_to_mob_result = - [this](HMIResult::eType hmi_result, MobileResult::eType mobile_result) { - ON_CALL(mock_message_helper_, HMIToMobileResult(hmi_result)) - .WillByDefault(Return(mobile_result)); - }; + auto link_hmi_to_mob_result = [this](HMIResult::eType hmi_result, + MobileResult::eType mobile_result) { + ON_CALL(mock_message_helper_, HMIToMobileResult(hmi_result)) + .WillByDefault(Return(mobile_result)); + }; link_hmi_to_mob_result(HMIResult::INVALID_ENUM, MobileResult::INVALID_ENUM); link_hmi_to_mob_result(HMIResult::SUCCESS, MobileResult::SUCCESS); link_hmi_to_mob_result(HMIResult::UNSUPPORTED_REQUEST, @@ -233,17 +232,17 @@ class CommandsTest : public ::testing::Test { }; MATCHER_P(MobileResultCodeIs, result_code, "") { - return result_code == - static_cast<mobile_apis::Result::eType>( - (*arg)[application_manager::strings::msg_params] - [application_manager::strings::result_code].asInt()); + return result_code == static_cast<mobile_apis::Result::eType>( + (*arg)[application_manager::strings::msg_params] + [application_manager::strings::result_code] + .asInt()); } MATCHER_P(HMIResultCodeIs, result_code, "") { - return result_code == - static_cast<hmi_apis::FunctionID::eType>( - (*arg)[application_manager::strings::params] - [application_manager::strings::function_id].asInt()); + return result_code == static_cast<hmi_apis::FunctionID::eType>( + (*arg)[application_manager::strings::params] + [application_manager::strings::function_id] + .asInt()); } MATCHER_P3(MobileResponseIs, result_code, result_info, result_success, "") { diff --git a/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h b/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h index 881ebb2575..9f50a73075 100644 --- a/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h +++ b/src/components/application_manager/test/include/application_manager/mock_app_launch_data.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_DATA_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_LAUNCH_DATA_H_ -#include "gmock/gmock.h" #include "application_manager/app_launch/app_launch_data.h" +#include "gmock/gmock.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/include/application_manager/mock_app_service_manager.h b/src/components/application_manager/test/include/application_manager/mock_app_service_manager.h new file mode 100644 index 0000000000..f77b5685da --- /dev/null +++ b/src/components/application_manager/test/include/application_manager/mock_app_service_manager.h @@ -0,0 +1,95 @@ +/* + Copyright (c) 2019, Ford Motor Company, Livio + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the + distribution. + + Neither the name of the the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_SERVICE_MANAGER_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_SERVICE_MANAGER_H_ + +#include <gmock/gmock.h> +#include "application_manager/app_service_manager.h" +#include "application_manager/commands/command.h" +#include "application_manager/commands/command_impl.h" + +namespace test { +namespace components { +namespace application_manager_test { + +class MockAppServiceManager : public application_manager::AppServiceManager { + public: + MockAppServiceManager(application_manager::ApplicationManager& app_manager, + resumption::LastState& last_state) + : application_manager::AppServiceManager(app_manager, last_state) {} + MOCK_METHOD3( + PublishAppService, + smart_objects::SmartObject(const smart_objects::SmartObject& manifest, + const bool mobile_service, + const uint32_t connection_key)); + MOCK_METHOD1(UnpublishAppService, bool(const std::string service_id)); + MOCK_METHOD1(UnpublishServices, void(const uint32_t connection_key)); + MOCK_METHOD1(OnAppActivated, + void(application_manager::ApplicationConstSharedPtr app)); + MOCK_METHOD1(SetDefaultService, bool(const std::string service_id)); + MOCK_METHOD1(RemoveDefaultService, bool(const std::string service_id)); + MOCK_METHOD1(ActivateAppService, bool(const std::string service_id)); + MOCK_METHOD1(DeactivateAppService, bool(const std::string service_id)); + MOCK_METHOD0(GetAllServiceRecords, std::vector<smart_objects::SmartObject>()); + MOCK_METHOD0(GetActiveServices, + std::vector<application_manager::AppService>()); + MOCK_METHOD4(GetProviderByType, + void(const std::string& service_type, + const bool mobile_consumer, + application_manager::ApplicationSharedPtr& app, + bool& hmi_service)); + MOCK_METHOD4(GetProviderByID, + void(const std::string& service_id, + const bool mobile_consumer, + application_manager::ApplicationSharedPtr& app, + bool& hmi_service)); + MOCK_METHOD1( + ActiveServiceForType, + application_manager::AppService*(const std::string service_type)); + MOCK_METHOD1( + EmbeddedServiceForType, + application_manager::AppService*(const std::string service_type)); + MOCK_METHOD1(FindServiceByID, + application_manager::AppService*(const std::string service_id)); + MOCK_METHOD2(SetServicePublished, + void(const std::string service_id, + const bool service_published)); + MOCK_METHOD1(UpdateNavigationCapabilities, + bool(smart_objects::SmartObject& out_params)); +}; + +} // namespace application_manager_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APP_SERVICE_MANAGER_H_ diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index fe16e8ce6e..74d09661c7 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -1,43 +1,43 @@ /* * Copyright (c) 2016, Ford Motor Company -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* Redistributions of source code must retain the above copyright notice, this -* list of conditions and the following disclaimer. -* -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following -* disclaimer in the documentation and/or other materials provided with the -* distribution. -* -* Neither the name of the Ford Motor Company nor the names of its contributors -* may be used to endorse or promote products derived from this software -* without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_H_ #include <string> -#include "gmock/gmock.h" -#include "application_manager/application.h" #include "application_manager/app_extension.h" +#include "application_manager/application.h" +#include "application_manager/usage_statistics.h" +#include "gmock/gmock.h" #include "smart_objects/smart_object.h" #include "utils/custom_string.h" -#include "application_manager/usage_statistics.h" #include "utils/semantic_version.h" namespace test { @@ -342,6 +342,21 @@ class MockApplication : public ::application_manager::Application { const std::list<application_manager::AppExtensionPtr>&()); MOCK_CONST_METHOD0(is_remote_control_supported, bool()); MOCK_METHOD1(set_remote_control_supported, void(const bool allow)); + MOCK_CONST_METHOD0(cloud_app_endpoint, const std::string&()); + MOCK_CONST_METHOD0(auth_token, const std::string&()); + MOCK_CONST_METHOD0(cloud_app_transport_type, const std::string&()); + MOCK_CONST_METHOD0(hybrid_app_preference, + const mobile_apis::HybridAppPreference::eType&()); + MOCK_CONST_METHOD0(cloud_app_certificate, const std::string&()); + MOCK_CONST_METHOD0(is_cloud_app, bool()); + MOCK_METHOD1(set_cloud_app_endpoint, void(const std::string& endpoint)); + MOCK_METHOD1(set_auth_token, void(const std::string& auth_token)); + MOCK_METHOD1(set_cloud_app_transport_type, + void(const std::string& transport_type)); + MOCK_METHOD1(set_hybrid_app_preference, + void(const mobile_apis::HybridAppPreference::eType& + hybrid_app_preference)); + MOCK_METHOD1(set_cloud_app_certificate, void(const std::string& certificate)); }; } // namespace application_manager_test diff --git a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h index 916f4a69f0..b345f53c1c 100644 --- a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h +++ b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h @@ -37,6 +37,7 @@ #include "application_manager/event_engine/event.h" #include "application_manager/event_engine/event_dispatcher.h" #include "application_manager/event_engine/event_observer.h" +#include "gmock/gmock.h" namespace test { namespace components { @@ -59,6 +60,26 @@ class MockEventDispatcher MOCK_METHOD1( remove_observer, void(::application_manager::event_engine::EventObserver& observer)); + + MOCK_METHOD1( + raise_mobile_event, + void(const ::application_manager::event_engine::MobileEvent& event)); + MOCK_METHOD3( + add_mobile_observer, + void( + const ::application_manager::event_engine::MobileEvent::MobileEventID& + event_id, + int32_t mobile_correlation_id, + ::application_manager::event_engine::EventObserver& observer)); + MOCK_METHOD2( + remove_mobile_observer, + void( + const ::application_manager::event_engine::MobileEvent::MobileEventID& + event_id, + ::application_manager::event_engine::EventObserver& observer)); + MOCK_METHOD1( + remove_mobile_observer, + void(::application_manager::event_engine::EventObserver& observer)); }; } // namespace event_engine_test diff --git a/src/components/application_manager/test/include/application_manager/mock_event_observer.h b/src/components/application_manager/test/include/application_manager/mock_event_observer.h index 8af31c1998..1357d67a65 100644 --- a/src/components/application_manager/test/include/application_manager/mock_event_observer.h +++ b/src/components/application_manager/test/include/application_manager/mock_event_observer.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_ -#include "application_manager/event_engine/event_observer.h" #include "application_manager/event_engine/event.h" +#include "application_manager/event_engine/event_observer.h" #include "gmock/gmock.h" namespace test { @@ -49,6 +49,9 @@ class MockEventObserver : application_manager::event_engine::EventObserver(event_dispatcher) {} MOCK_METHOD1(on_event, void(const application_manager::event_engine::Event& event)); + MOCK_METHOD1( + on_event, + void(const application_manager::event_engine::MobileEvent& event)); }; } // namespace event_engine_test diff --git a/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h index a415f94d56..b44345deff 100644 --- a/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h +++ b/src/components/application_manager/test/include/application_manager/mock_help_prompt_manager.h @@ -1,34 +1,34 @@ /* * Copyright (c) 2018, Ford Motor Company -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* Redistributions of source code must retain the above copyright notice, this -* list of conditions and the following disclaimer. -* -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following -* disclaimer in the documentation and/or other materials provided with the -* distribution. -* -* Neither the name of the Ford Motor Company nor the names of its contributors -* may be used to endorse or promote products derived from this software -* without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HELP_PROMPT_MANAGER_H_ diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h index 84a3b6bc87..819ead8d8b 100644 --- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h +++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h @@ -32,13 +32,13 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_ -#include "gmock/gmock.h" #include "application_manager/application.h" +#include "application_manager/application_manager.h" #include "application_manager/message_helper.h" +#include "application_manager/policies/policy_handler_interface.h" +#include "gmock/gmock.h" #include "interfaces/HMI_API.h" #include "policy/policy_types.h" -#include "application_manager/policies/policy_handler_interface.h" -#include "application_manager/application_manager.h" #include "smart_objects/smart_object.h" #include "transport_manager/common.h" @@ -164,6 +164,8 @@ class MockMessageHelper { ApplicationManager& app_mngr)); MOCK_METHOD1(CommonLanguageFromString, hmi_apis::Common_Language::eType(const std::string& language)); + MOCK_METHOD1(CommonLightNameFromString, + hmi_apis::Common_LightName::eType(const std::string& lightName)); MOCK_METHOD1(CommonLanguageToString, std::string(hmi_apis::Common_Language::eType)); MOCK_METHOD2(CreateModuleInfoSO, @@ -199,14 +201,16 @@ class MockMessageHelper { MessageHelper::ChoiceSetVRCommandsStatus( const smart_objects::SmartObject&)); - MOCK_METHOD6(GetBCActivateAppRequestToHMI, + MOCK_METHOD5(GetBCActivateAppRequestToHMI, smart_objects::SmartObjectSPtr( ApplicationConstSharedPtr app, - const protocol_handler::SessionObserver& session_observer, const policy::PolicyHandlerInterface& policy_handler, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority, ApplicationManager& app_mngr)); + MOCK_METHOD2(GetBCCloseApplicationRequestToHMI, + smart_objects::SmartObjectSPtr(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr)); MOCK_METHOD2(GetOnAppInterfaceUnregisteredNotificationToMobile, ns_smart_device_link::ns_smart_objects::SmartObjectSPtr( int32_t connection_key, @@ -308,6 +312,12 @@ class MockMessageHelper { void(mobile_apis::ButtonName::eType button, ApplicationSharedPtr application, ApplicationManager& app_mngr)); + MOCK_METHOD1(CreateAppServiceCapabilities, + smart_objects::SmartObject( + std::vector<smart_objects::SmartObject>& all_services)); + MOCK_METHOD2(BroadcastCapabilityUpdate, + void(smart_objects::SmartObject& msg_params, + ApplicationManager& app_mngr)); static MockMessageHelper* message_helper_mock(); }; diff --git a/src/components/application_manager/test/include/application_manager/mock_request.h b/src/components/application_manager/test/include/application_manager/mock_request.h index e4cfa84841..dfc6691ef4 100644 --- a/src/components/application_manager/test/include/application_manager/mock_request.h +++ b/src/components/application_manager/test/include/application_manager/mock_request.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_ -#include "gmock/gmock.h" #include "application_manager/commands/command.h" +#include "gmock/gmock.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h index 0fa7a898be..4fd3b7fc5a 100644 --- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h +++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h @@ -31,9 +31,9 @@ */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUME_CTRL_H_ -#include "gmock/gmock.h" -#include "application_manager/resumption/resume_ctrl.h" #include "application_manager/application.h" +#include "application_manager/resumption/resume_ctrl.h" +#include "gmock/gmock.h" #include "resumption/last_state.h" namespace test { diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h index 38d1944dba..7cabc12086 100644 --- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h +++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h @@ -1,42 +1,42 @@ /* -* Copyright (c) 2016, Ford Motor Company -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* -* Redistributions of source code must retain the above copyright notice, this -* list of conditions and the following disclaimer. -* -* Redistributions in binary form must reproduce the above copyright notice, -* this list of conditions and the following -* disclaimer in the documentation and/or other materials provided with the -* distribution. -* -* Neither the name of the Ford Motor Company nor the names of its contributors -* may be used to endorse or promote products derived from this software -* without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_RESUMPTION_DATA_H_ #include <string> -#include "gmock/gmock.h" -#include "application_manager/resumption/resumption_data.h" #include "application_manager/application.h" -#include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/resumption/resumption_data.h" +#include "gmock/gmock.h" #include "smart_objects/smart_object.h" namespace test { diff --git a/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h index cd4632965c..c79a31817e 100644 --- a/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h +++ b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_ -#include "gmock/gmock.h" #include "application_manager/telemetry_observer.h" +#include "gmock/gmock.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h index 4e614c4d9f..cab3c23253 100644 --- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h +++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h @@ -33,20 +33,20 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_RESUMPTION_DATA_TEST_H_ -#include <string> #include <algorithm> -#include "gtest/gtest.h" -#include "application_manager/usage_statistics.h" +#include <string> +#include "application_manager/event_engine/event_dispatcher.h" +#include "application_manager/mock_app_extension.h" #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/mock_app_extension.h" -#include "utils/data_accessor.h" -#include "config_profile/profile.h" +#include "application_manager/mock_application_manager_settings.h" #include "application_manager/policies/policy_handler.h" -#include "application_manager/state_controller.h" #include "application_manager/resumption/resume_ctrl.h" -#include "application_manager/event_engine/event_dispatcher.h" -#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/state_controller.h" +#include "application_manager/usage_statistics.h" +#include "config_profile/profile.h" +#include "gtest/gtest.h" +#include "utils/data_accessor.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h b/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h index e10f60afac..3f5802cb5a 100644 --- a/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h +++ b/src/components/application_manager/test/include/application_manager/test_resumption_data_db.h @@ -33,10 +33,10 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_TEST_RESUMPTION_DATA_DB_H_ -#include "utils/sqlite_wrapper/sql_database.h" -#include "application_manager/resumption/resumption_data_db.h" -#include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/resumption/resumption_data_db.h" +#include "utils/sqlite_wrapper/sql_database.h" using ::resumption::ResumptionDataDB; diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt index d115ad8b40..99031849f6 100755 --- a/src/components/application_manager/test/message_helper/CMakeLists.txt +++ b/src/components/application_manager/test/message_helper/CMakeLists.txt @@ -40,6 +40,7 @@ set(LIBRARIES ApplicationManager MessageHelper jsoncpp + Policy connectionHandler MediaManager Resumption diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 15a09c33cc..d0fbe696cd 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -36,18 +36,21 @@ #include "gmock/gmock.h" #include "utils/macro.h" -#include "application_manager/policies/policy_handler.h" +#include "application_manager/commands/command_impl.h" +#include "application_manager/event_engine/event_dispatcher.h" #include "application_manager/mock_application.h" -#include "application_manager/mock_help_prompt_manager.h" -#include "utils/custom_string.h" -#include "utils/lock.h" -#include "policy/mock_policy_settings.h" -#include "application_manager/policies/policy_handler.h" #include "application_manager/mock_application_manager.h" +#include "application_manager/mock_help_prompt_manager.h" #include "application_manager/mock_rpc_service.h" -#include "application_manager/event_engine/event_dispatcher.h" -#include "application_manager/state_controller.h" +#include "application_manager/policies/policy_handler.h" #include "application_manager/resumption/resume_ctrl.h" +#include "application_manager/state_controller.h" +#include "policy/mock_policy_settings.h" +#include "utils/custom_string.h" +#include "utils/lock.h" + +#include "policy/policy_table/types.h" +#include "rpc_base/rpc_base_json_inl.h" #ifdef EXTERNAL_PROPRIETARY_MODE #include "policy/policy_external/include/policy/policy_types.h" @@ -67,12 +70,12 @@ typedef std::shared_ptr<MockApplication> MockApplicationSharedPtr; typedef std::vector<std::string> StringArray; typedef std::shared_ptr<application_manager::Application> ApplicationSharedPtr; +using testing::_; using testing::AtLeast; -using testing::ReturnRefOfCopy; -using testing::ReturnRef; using testing::Return; +using testing::ReturnRef; +using testing::ReturnRefOfCopy; using testing::SaveArg; -using testing::_; TEST(MessageHelperTestCreate, CreateBlockedByPoliciesResponse_SmartObject_Equal) { @@ -948,7 +951,8 @@ TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) { size_t function_id = 1; // EXPECT_CALL(*appSharedPtr, - SubscribeToSoftButtons(function_id, SoftButtonID())).Times(1); + SubscribeToSoftButtons(function_id, SoftButtonID())) + .Times(1); MessageHelper::SubscribeApplicationToSoftButton( message_params, appSharedPtr, function_id); } @@ -964,7 +968,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) { ON_CALL(mock_application_manager, GetRPCService()) .WillByDefault(ReturnRef(mock_rpc_service_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); const uint32_t correlation_id = 0u; @@ -1004,7 +1008,7 @@ TEST_F(MessageHelperTest, ON_CALL(mock_application_manager, GetRPCService()) .WillByDefault(ReturnRef(mock_rpc_service_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); const uint32_t correlation_id = 0u; @@ -1050,7 +1054,7 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) { smart_objects::SmartObjectSPtr result; ON_CALL(mock_application_manager, GetRPCService()) .WillByDefault(ReturnRef(mock_rpc_service_)); - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); int32_t app_id = 123; diff --git a/src/components/application_manager/test/mobile_event_engine_test.cc b/src/components/application_manager/test/mobile_event_engine_test.cc new file mode 100644 index 0000000000..cad1ff14ff --- /dev/null +++ b/src/components/application_manager/test/mobile_event_engine_test.cc @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "gtest/gtest.h" + +#include "application_manager/event_engine/event.h" +#include "application_manager/event_engine/event_dispatcher_impl.h" +#include "application_manager/event_engine/event_observer.h" +#include "application_manager/message.h" +#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_event_observer.h" +#include "smart_objects/smart_object.h" + +#include "interfaces/MOBILE_API.h" + +namespace test { +namespace components { +namespace event_engine_test { + +using application_manager::event_engine::Event; +using application_manager::event_engine::EventDispatcherImpl; +using application_manager::event_engine::EventObserver; +using application_manager::event_engine::MobileEvent; +using testing::_; +using ::testing::An; +using ::testing::Matcher; + +class MobileEventEngineTest : public testing::Test { + public: + MobileEventEngineTest() + : event_id(MobileEvent::MobileEventID::GetAppServiceDataID) + , event_observer_mock_(mock_event_dispatcher_) {} + + protected: + EventDispatcherImpl* event_dispatcher_instance_; + MobileEvent* event_; + const MobileEvent::MobileEventID event_id; + MockEventDispatcher mock_event_dispatcher_; + MockEventObserver event_observer_mock_; + const int32_t correlation_id = 1121; + smart_objects::SmartObject smart_object_with_type_notification; + smart_objects::SmartObject smart_object_with_type_response; + smart_objects::SmartObject smart_object_with_type_error_response; + smart_objects::SmartObject smart_object_with_type_request; + smart_objects::SmartObject smart_object_with_invalid_type; + + virtual void SetUp() OVERRIDE { + event_dispatcher_instance_ = new EventDispatcherImpl(); + event_ = + new MobileEvent(mobile_apis::FunctionID::eType::GetAppServiceDataID); + smart_object_with_type_notification["params"]["message_type"] = + application_manager::MessageType::kNotification; + smart_object_with_type_notification["params"]["correlation_id"] = + correlation_id; + smart_object_with_type_notification["params"]["function_id"] = + mobile_apis::FunctionID::eType::GetAppServiceDataID; + + smart_object_with_type_response["params"]["message_type"] = + application_manager::MessageType::kResponse; + smart_object_with_type_response["params"]["correlation_id"] = + correlation_id; + smart_object_with_type_response["params"]["function_id"] = + mobile_apis::FunctionID::eType::GetAppServiceDataID; + + smart_object_with_type_request["params"]["message_type"] = + application_manager::MessageType::kRequest; + smart_object_with_type_request["params"]["correlation_id"] = correlation_id; + smart_object_with_type_request["params"]["function_id"] = + mobile_apis::FunctionID::eType::GetAppServiceDataID; + + smart_object_with_invalid_type["params"]["message_type"] = + application_manager::MessageType::kUnknownType; + smart_object_with_invalid_type["params"]["correlation_id"] = correlation_id; + smart_object_with_invalid_type["params"]["function_id"] = + mobile_apis::FunctionID::eType::GetAppServiceDataID; + } + + void TearDown() OVERRIDE { + delete event_dispatcher_instance_; + delete event_; + } + + void CheckRaiseMobileEvent(const MobileEvent::MobileEventID& event_id, + const uint32_t calls_number, + const smart_objects::SmartObject& so) { + // Arrange + event_dispatcher_instance_->add_mobile_observer( + event_id, correlation_id, event_observer_mock_); + event_->set_smart_object(so); + EXPECT_CALL(event_observer_mock_, on_event(An<const MobileEvent&>())) + .Times(calls_number); + event_dispatcher_instance_->raise_mobile_event(*event_); + } +}; + +TEST_F(MobileEventEngineTest, EventObserverTest_ExpectObserversEmpty) { + // Arrange + EventObserver* event_observer_ptr = + static_cast<EventObserver*>(&event_observer_mock_); + // Check + EXPECT_EQ(reinterpret_cast<unsigned long>(event_observer_ptr), + event_observer_mock_.id()); +} + +TEST_F(MobileEventEngineTest, + EventDispatcherImpl_RaiseEvent_EventSOTypeResponse_ExpectEventRaised) { + CheckRaiseMobileEvent(event_id, 1u, smart_object_with_type_response); +} + +TEST_F(MobileEventEngineTest, + EventDispatcherImpl_RaiseEvent_EventSOTypeInvalid_ExpectEventNotRaised) { + CheckRaiseMobileEvent(event_id, 0u, smart_object_with_invalid_type); +} + +TEST_F(MobileEventEngineTest, + EventDispatcherImpl_RaiseEvent_EventSOTypeRequest_ExpectEventNotRaised) { + CheckRaiseMobileEvent(event_id, 0u, smart_object_with_type_request); +} + +TEST_F( + MobileEventEngineTest, + EventDispatcherImpl_RaiseEvent_EventSOTypeNotification_ExpectEventNotRaised) { + CheckRaiseMobileEvent(event_id, 0u, smart_object_with_type_notification); +} + +TEST_F(MobileEventEngineTest, Event_set_smart_object_ExpectObjectSet) { + // Act + event_->set_smart_object(smart_object_with_type_response); + const int32_t obj_type = + static_cast<int32_t>(application_manager::MessageType::kResponse); + const int32_t function_id = + static_cast<int32_t>(mobile_apis::FunctionID::eType::GetAppServiceDataID); + // Checks + EXPECT_EQ(obj_type, event_->smart_object_type()); + EXPECT_EQ(function_id, event_->smart_object_function_id()); + EXPECT_EQ(correlation_id, event_->smart_object_correlation_id()); + EXPECT_EQ(smart_object_with_type_response, event_->smart_object()); +} + +} // namespace event_engine_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc index 23957b61fb..cac04d4508 100644 --- a/src/components/application_manager/test/mobile_message_handler_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_test.cc @@ -32,30 +32,30 @@ #include "application_manager/mobile_message_handler.h" -#include <string> -#include <ctime> #include <algorithm> +#include <ctime> #include <iterator> +#include <string> #include <vector> -#include "gmock/gmock.h" #include "application_manager/message.h" +#include "gmock/gmock.h" #include "protocol/raw_message.h" namespace test { namespace components { namespace application_manager_test { +using ::application_manager::Message; +using ::application_manager::MobileMessage; +using application_manager::MobileMessageHandler; +using protocol_handler::MajorProtocolVersion; +using protocol_handler::MessagePriority; +using protocol_handler::PROTOCOL_HEADER_V2_SIZE; using protocol_handler::RawMessage; using protocol_handler::RawMessagePtr; using protocol_handler::ServiceType; -using protocol_handler::MessagePriority; -using protocol_handler::PROTOCOL_HEADER_V2_SIZE; -using application_manager::MobileMessageHandler; -using protocol_handler::MajorProtocolVersion; using ::testing::_; -using ::application_manager::Message; -using ::application_manager::MobileMessage; using testing::Return; diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc index 5cbc28b20c..7801798705 100644 --- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc @@ -32,19 +32,19 @@ #include "application_manager/mobile_message_handler.h" -#include <string> -#include <vector> #include <algorithm> #include <iterator> +#include <string> +#include <vector> -#include "gmock/gmock.h" #include "application_manager/message.h" +#include "gmock/gmock.h" #include "protocol/raw_message.h" +using application_manager::MobileMessageHandler; +using protocol_handler::PROTOCOL_HEADER_V1_SIZE; using protocol_handler::RawMessage; using protocol_handler::RawMessagePtr; -using protocol_handler::PROTOCOL_HEADER_V1_SIZE; -using application_manager::MobileMessageHandler; namespace test { namespace components { diff --git a/src/components/application_manager/test/mock_application_helper.cc b/src/components/application_manager/test/mock_application_helper.cc index c64a56e53e..ea57709a73 100644 --- a/src/components/application_manager/test/mock_application_helper.cc +++ b/src/components/application_manager/test/mock_application_helper.cc @@ -41,15 +41,16 @@ MockApplicationHelper& MockApplicationHelper::application_helper_mock() { return application_helper_mock; } -} // application_manager_test -} // components -} // test +} // namespace application_manager_test +} // namespace components +} // namespace test namespace application_manager { void DeleteApplicationData(ApplicationSharedPtr app, ApplicationManager& app_manager) { test::components::application_manager_test::MockApplicationHelper:: - application_helper_mock().RecallApplicationData(app, app_manager); + application_helper_mock() + .RecallApplicationData(app, app_manager); } -} // application_managers +} // namespace application_manager diff --git a/src/components/application_manager/test/mock_hmi_command_factory.cc b/src/components/application_manager/test/mock_hmi_command_factory.cc index 375da26067..5f76a9300b 100644 --- a/src/components/application_manager/test/mock_hmi_command_factory.cc +++ b/src/components/application_manager/test/mock_hmi_command_factory.cc @@ -30,9 +30,9 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "application_manager/mock_hmi_command_factory.h" #include <gmock/gmock.h> #include "application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/hmi_command_factory.h" -#include "application_manager/mock_hmi_command_factory.h" namespace test { namespace components { @@ -43,9 +43,9 @@ MockHMICommandFactory* MockHMICommandFactory::mock_hmi_command_factory() { return &mock_hmi_command_factory; } -} // application_manager_test -} // components -} // test +} // namespace application_manager_test +} // namespace components +} // namespace test namespace sdl_rpc_plugin { namespace app_mngr = application_manager; @@ -53,6 +53,7 @@ app_mngr::CommandSharedPtr HMICommandFactory::CreateCommand( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager) { return test::components::application_manager_test::MockHMICommandFactory:: - mock_hmi_command_factory()->CreateCommand(message, application_manager); + mock_hmi_command_factory() + ->CreateCommand(message, application_manager); } -} // application_manager +} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc index f091e183dc..522ef3dbd5 100644 --- a/src/components/application_manager/test/mock_message_helper.cc +++ b/src/components/application_manager/test/mock_message_helper.cc @@ -30,12 +30,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "application_manager/message_helper.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/message_helper.h" #include "application_manager/policies/policy_handler_interface.h" -#include "transport_manager/common.h" -#include "gtest/gtest.h" #include "gmock/gmock.h" +#include "gtest/gtest.h" +#include "transport_manager/common.h" namespace application_manager { @@ -277,6 +277,12 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString( language); } +hmi_apis::Common_LightName::eType MessageHelper::CommonLightNameFromString( + const std::string& lightName) { + return MockMessageHelper::message_helper_mock()->CommonLightNameFromString( + lightName); +} + smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO( uint32_t function_id, ApplicationManager& app_mngr) { return MockMessageHelper::message_helper_mock()->CreateModuleInfoSO( @@ -362,18 +368,18 @@ std::string MessageHelper::CommonLanguageToString( smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( ApplicationConstSharedPtr app, - const protocol_handler::SessionObserver& session_observer, const policy::PolicyHandlerInterface& policy_handler, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority, ApplicationManager& app_mngr) { return MockMessageHelper::message_helper_mock()->GetBCActivateAppRequestToHMI( - app, - session_observer, - policy_handler, - level, - send_policy_priority, - app_mngr); + app, policy_handler, level, send_policy_priority, app_mngr); +} + +smart_objects::SmartObjectSPtr MessageHelper::GetBCCloseApplicationRequestToHMI( + ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { + return MockMessageHelper::message_helper_mock() + ->GetBCCloseApplicationRequestToHMI(app, app_mngr); } ns_smart_device_link::ns_smart_objects::SmartObjectSPtr @@ -572,4 +578,15 @@ void MessageHelper::SendUnsubscribeButtonNotification( ->SendUnsubscribeButtonNotification(button, application, app_mngr); } +smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities( + std::vector<smart_objects::SmartObject>& all_services) { + return MockMessageHelper::message_helper_mock()->CreateAppServiceCapabilities( + all_services); +} + +void MessageHelper::BroadcastCapabilityUpdate( + smart_objects::SmartObject& msg_params, ApplicationManager& app_mngr) { + MockMessageHelper::message_helper_mock()->BroadcastCapabilityUpdate( + msg_params, app_mngr); +} } // namespace application_manager diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc index 9b97f054b3..a74b12071c 100644 --- a/src/components/application_manager/test/policy_event_observer_test.cc +++ b/src/components/application_manager/test/policy_event_observer_test.cc @@ -33,10 +33,10 @@ #include "application_manager/policies/policy_event_observer.h" #include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/mock_event_dispatcher.h" #include "gmock/gmock.h" #include "policy/policy_types.h" #include "smart_objects/smart_object.h" -#include "application_manager/mock_event_dispatcher.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index a1471eff36..458b065cdd 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -30,48 +30,47 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <fstream> #include <string> #include <vector> -#include <fstream> #include "gmock/gmock.h" -#include "application_manager/policies/policy_handler.h" +#include "application_manager/application_impl.h" +#include "application_manager/application_manager_impl.h" #include "application_manager/policies/delegates/app_permission_delegate.h" +#include "application_manager/policies/policy_handler.h" #include "connection_handler/connection_handler_impl.h" -#include "application_manager/application_manager_impl.h" -#include "application_manager/application_impl.h" #ifdef ENABLE_SECURITY -#include "security_manager/mock_security_manager.h" #include "security_manager/mock_crypto_manager.h" +#include "security_manager/mock_security_manager.h" #endif // ENABLE_SECURITY #include "application_manager/mock_message_helper.h" #include "connection_handler/mock_connection_handler_settings.h" -#include "transport_manager/mock_transport_manager.h" -#include "policy/policy_types.h" #include "json/reader.h" -#include "json/writer.h" #include "json/value.h" +#include "json/writer.h" +#include "policy/policy_types.h" #include "smart_objects/smart_object.h" +#include "transport_manager/mock_transport_manager.h" #include "utils/file_system.h" -#include "utils/custom_string.h" -#include "policy/usage_statistics/counter.h" -#include "policy/usage_statistics/statistics_manager.h" #include "interfaces/MOBILE_API.h" #include "policy/mock_policy_settings.h" +#include "policy/usage_statistics/counter.h" +#include "policy/usage_statistics/statistics_manager.h" +#include "utils/custom_string.h" #include "application_manager/mock_application.h" -#include "policy/usage_statistics/mock_statistics_manager.h" -#include "protocol_handler/mock_session_observer.h" -#include "connection_handler/mock_connection_handler.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/policies/mock_policy_handler_observer.h" #include "application_manager/mock_event_dispatcher.h" -#include "application_manager/mock_state_controller.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_rpc_service.h" +#include "application_manager/mock_state_controller.h" +#include "application_manager/policies/mock_policy_handler_observer.h" +#include "connection_handler/mock_connection_handler.h" #include "policy/mock_policy_manager.h" #include "policy/usage_statistics/mock_statistics_manager.h" +#include "protocol_handler/mock_session_observer.h" namespace test { namespace components { @@ -81,15 +80,13 @@ using namespace application_manager; using namespace policy; using namespace utils::custom_string; using testing::_; +using ::testing::DoAll; using ::testing::Mock; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; -using ::testing::SetArgReferee; using ::testing::SetArgPointee; -using ::testing::DoAll; using ::testing::SetArgReferee; -using ::testing::Mock; typedef NiceMock<application_manager_test::MockRPCService> MockRPCService; @@ -380,6 +377,70 @@ TEST_F(PolicyHandlerTest, ClearUserConsent) { policy_handler_.ClearUserConsent(); } +TEST_F(PolicyHandlerTest, AppServiceUpdate_CheckAppService) { + // Arrange + EnablePolicy(); + EXPECT_TRUE(policy_handler_.LoadPolicyLibrary()); + // Check + EXPECT_TRUE(policy_handler_.InitPolicyTable()); + ChangePolicyManagerToMock(); + std::string file_name("sdl_pt_update.json"); + std::ifstream ifile(file_name); + Json::Reader reader; + std::string json; + Json::Value root(Json::objectValue); + if (ifile.is_open() && reader.parse(ifile, root, true)) { + json = root.toStyledString(); + } + ifile.close(); + BinaryMessage msg(json.begin(), json.end()); + // Checks + EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(true)); + policy_handler_.ReceiveMessageFromSDK("", msg); + + policy_table::AppServiceParameters app_service_params = + policy_table::AppServiceParameters(); + std::string kServiceType = "MEDIA"; + std::string as_app_id = "1010101010"; + std::string service_name1 = "SDL Music"; + std::string service_name2 = "SDL App"; + (app_service_params)[kServiceType] = policy_table::AppServiceInfo(); + (app_service_params)[kServiceType].service_names->push_back(service_name2); + (app_service_params)[kServiceType].service_names->push_back(service_name1); + (app_service_params)[kServiceType].service_names->mark_initialized(); + policy_table::AppServiceHandledRpc handled_rpc; + handled_rpc.function_id = 41; + (app_service_params)[kServiceType].handled_rpcs.push_back(handled_rpc); + EXPECT_CALL(*mock_policy_manager_, GetAppServiceParameters(_, _)) + .WillRepeatedly(SetArgPointee<1>(app_service_params)); + + ns_smart_device_link::ns_smart_objects::SmartArray requested_handled_rpcs; + ns_smart_device_link::ns_smart_objects::SmartObject rpc_id(41); + requested_handled_rpcs.push_back(rpc_id); + + ns_smart_device_link::ns_smart_objects::SmartArray fake_handled_rpcs; + ns_smart_device_link::ns_smart_objects::SmartObject fake_rpc_id(40); + fake_handled_rpcs.push_back(fake_rpc_id); + + EXPECT_TRUE(policy_handler_.CheckAppServiceParameters( + as_app_id, service_name1, kServiceType, &requested_handled_rpcs)); + EXPECT_TRUE(policy_handler_.CheckAppServiceParameters( + as_app_id, service_name2, kServiceType, &requested_handled_rpcs)); + EXPECT_TRUE(policy_handler_.CheckAppServiceParameters( + as_app_id, service_name2, kServiceType, NULL)); + EXPECT_TRUE(policy_handler_.CheckAppServiceParameters( + as_app_id, "", kServiceType, NULL)); + + EXPECT_FALSE( + policy_handler_.CheckAppServiceParameters(as_app_id, "", "", NULL)); + EXPECT_FALSE(policy_handler_.CheckAppServiceParameters( + as_app_id, service_name2, "NAVIGATION", &requested_handled_rpcs)); + EXPECT_FALSE(policy_handler_.CheckAppServiceParameters( + as_app_id, "MUSIC", kServiceType, &requested_handled_rpcs)); + EXPECT_FALSE(policy_handler_.CheckAppServiceParameters( + as_app_id, service_name2, kServiceType, &fake_handled_rpcs)); +} + TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK) { // Arrange EnablePolicy(); @@ -448,7 +509,8 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) { EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) .WillOnce(Return(invalid_app)); EXPECT_CALL(mock_message_helper_, - SendOnPermissionsChangeNotification(_, _, _)).Times(0); + SendOnPermissionsChangeNotification(_, _, _)) + .Times(0); Permissions permissions; policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions); @@ -916,7 +978,8 @@ TEST_F(PolicyHandlerTest, AppPermissions permissions(kPolicyAppId_); permissions.appPermissionsConsentNeeded = false; EXPECT_CALL(mock_message_helper_, - SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0); + SendOnAppPermissionsChangedNotification(kAppId1_, _, _)) + .Times(0); EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_)) .WillOnce(Return(permissions)); @@ -1055,7 +1118,8 @@ TEST_F(PolicyHandlerTest, // Check expectations // Notification won't be sent EXPECT_CALL(mock_message_helper_, - SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0); + SendOnAppPermissionsChangedNotification(kAppId1_, _, _)) + .Times(0); EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_)) .WillOnce(Return(permissions)); @@ -2180,7 +2244,8 @@ TEST_F(PolicyHandlerTest, _, NULL, _, - _)).WillOnce(Return(1u)); + _)) + .WillOnce(Return(1u)); EXPECT_CALL(app_manager_, application(kConnectionKey_)) .WillOnce(Return(mock_app_)); @@ -2536,6 +2601,104 @@ TEST_F(PolicyHandlerTest, RemoteAppsUrl_SUCCESS) { EXPECT_EQ(url, policy_handler_.RemoteAppsUrl()); } +TEST_F(PolicyHandlerTest, OnSetCloudAppProperties_AllProperties_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + bool enabled = true; + std::string app_name = "anAppName"; + std::string auth_token = "anAuthToken"; + std::string cloud_transport_type = "aTransportType"; + mobile_apis::HybridAppPreference::eType hybrid_app_preference = + mobile_apis::HybridAppPreference::CLOUD; + std::string hybrid_app_preference_str = "CLOUD"; + std::string endpoint = "anEndpoint"; + + StringArray nicknames_vec; + nicknames_vec.push_back(app_name); + + smart_objects::SmartObject message(smart_objects::SmartType_Map); + smart_objects::SmartObject properties(smart_objects::SmartType_Map); + smart_objects::SmartObject nicknames(smart_objects::SmartType_Array); + + properties[strings::app_id] = kPolicyAppId_; + nicknames[0] = app_name; + properties[strings::nicknames] = nicknames; + properties[strings::enabled] = enabled; + properties[strings::auth_token] = auth_token; + properties[strings::cloud_transport_type] = cloud_transport_type; + properties[strings::hybrid_app_preference] = hybrid_app_preference; + properties[strings::endpoint] = endpoint; + message[strings::msg_params][strings::properties] = properties; + + application_manager_test::MockPolicyHandlerObserver policy_handler_observer; + policy_handler_.add_listener(&policy_handler_observer); + + EXPECT_CALL(*mock_policy_manager_, InitCloudApp(kPolicyAppId_)); + EXPECT_CALL(*mock_policy_manager_, + SetCloudAppEnabled(kPolicyAppId_, enabled)); + EXPECT_CALL(*mock_policy_manager_, + SetAppNicknames(kPolicyAppId_, nicknames_vec)); + EXPECT_CALL(*mock_policy_manager_, + SetAppAuthToken(kPolicyAppId_, auth_token)); + EXPECT_CALL(*mock_policy_manager_, + SetAppCloudTransportType(kPolicyAppId_, cloud_transport_type)); + EXPECT_CALL(*mock_policy_manager_, + SetHybridAppPreference(kPolicyAppId_, hybrid_app_preference_str)); + EXPECT_CALL(*mock_policy_manager_, SetAppEndpoint(kPolicyAppId_, endpoint)); + EXPECT_CALL(*mock_policy_manager_, + GetCloudAppParameters(kPolicyAppId_, _, _, _, _, _, _)) + .WillOnce(DoAll(SetArgReferee<4>(auth_token), Return(true))); + EXPECT_CALL(app_manager_, RefreshCloudAppInformation()); + EXPECT_CALL(policy_handler_observer, + OnAuthTokenUpdated(kPolicyAppId_, auth_token)); + + policy_handler_.OnSetCloudAppProperties(message); +} + +TEST_F(PolicyHandlerTest, GetCloudAppParameters_AllProperties_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + bool enabled = true; + std::string certificate = "aCertificate"; + std::string auth_token = "anAuthToken"; + std::string cloud_transport_type = "aTransportType"; + std::string hybrid_app_preference_str = "CLOUD"; + std::string endpoint = "anEndpoint"; + + application_manager_test::MockPolicyHandlerObserver policy_handler_observer; + policy_handler_.add_listener(&policy_handler_observer); + + EXPECT_CALL(*mock_policy_manager_, + GetCloudAppParameters(kPolicyAppId_, _, _, _, _, _, _)) + .WillOnce(DoAll(SetArgReferee<1>(enabled), + SetArgReferee<2>(endpoint), + SetArgReferee<3>(certificate), + SetArgReferee<4>(auth_token), + SetArgReferee<5>(cloud_transport_type), + SetArgReferee<6>(hybrid_app_preference_str), + Return(true))); + + bool enabled_out; + std::string endpoint_out; + std::string cert_out; + std::string auth_token_out; + std::string ctt_out; + std::string hap_out; + EXPECT_TRUE(policy_handler_.GetCloudAppParameters(kPolicyAppId_, + enabled_out, + endpoint_out, + cert_out, + auth_token_out, + ctt_out, + hap_out)); + EXPECT_EQ(enabled, enabled_out); + EXPECT_EQ(endpoint, endpoint_out); + EXPECT_EQ(certificate, cert_out); + EXPECT_EQ(auth_token, auth_token_out); + EXPECT_EQ(cloud_transport_type, ctt_out); + EXPECT_EQ(hybrid_app_preference_str, hap_out); +} + } // namespace policy_handler_test } // namespace components } // namespace test diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index b7caf635c9..818a014a3f 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -30,34 +30,34 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <fstream> #include <string> #include <vector> -#include <fstream> #include "gmock/gmock.h" -#include "application_manager/policies/policy_handler.h" -#include "application_manager/policies/delegates/app_permission_delegate.h" -#include "policy/mock_cache_manager.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/policies/delegates/app_permission_delegate.h" +#include "application_manager/policies/policy_handler.h" #include "connection_handler/mock_connection_handler_settings.h" -#include "policy/policy_types.h" -#include "policy/access_remote.h" #include "json/reader.h" -#include "json/writer.h" #include "json/value.h" +#include "json/writer.h" +#include "policy/access_remote.h" +#include "policy/mock_cache_manager.h" +#include "policy/policy_types.h" #include "smart_objects/smart_object.h" -#include "utils/custom_string.h" -#include "interfaces/MOBILE_API.h" -#include "policy/mock_policy_settings.h" #include "application_manager/mock_application.h" -#include "policy/usage_statistics/mock_statistics_manager.h" -#include "protocol_handler/mock_session_observer.h" -#include "connection_handler/mock_connection_handler.h" #include "application_manager/mock_application_manager.h" -#include "application_manager/policies/mock_policy_handler_observer.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/policies/mock_policy_handler_observer.h" +#include "connection_handler/mock_connection_handler.h" +#include "interfaces/MOBILE_API.h" #include "policy/mock_policy_manager.h" +#include "policy/mock_policy_settings.h" +#include "policy/usage_statistics/mock_statistics_manager.h" +#include "protocol_handler/mock_session_observer.h" +#include "utils/custom_string.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc index 112e3c1c39..71e12b2825 100644 --- a/src/components/application_manager/test/request_controller/request_controller_test.cc +++ b/src/components/application_manager/test/request_controller/request_controller_test.cc @@ -32,24 +32,23 @@ #include <stdint.h> -#include "gtest/gtest.h" +#include "application_manager/mock_request.h" #include "application_manager/request_controller.h" #include "application_manager/request_info.h" -#include "application_manager/mock_request.h" +#include "gtest/gtest.h" -#include "smart_objects/smart_object.h" +#include "application_manager/application_impl.h" #include "application_manager/commands/command_request_impl.h" #include "application_manager/message_helper.h" -#include "application_manager/application_impl.h" +#include "smart_objects/smart_object.h" -#include "application_manager/mock_application_manager.h" #include "application_manager/event_engine/event_dispatcher.h" -#include "resumption/last_state.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_request_controller_settings.h" #include "application_manager/policies/policy_handler.h" -#include "application_manager/state_controller.h" #include "application_manager/resumption/resume_ctrl.h" -#include "application_manager/mock_request_controller_settings.h" -#include "application_manager/mock_application_manager.h" +#include "application_manager/state_controller.h" +#include "resumption/last_state.h" #include "utils/test_async_waiter.h" namespace test { @@ -59,10 +58,10 @@ namespace request_controller_test { using ::application_manager::request_controller::RequestController; using ::application_manager::request_controller::RequestInfo; +using ::testing::_; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; -using ::testing::_; typedef NiceMock<application_manager_test::MockRequest> MRequest; typedef std::shared_ptr<MRequest> RequestPtr; diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc index 0abef44e9a..a0b1793cf5 100644 --- a/src/components/application_manager/test/request_info_test.cc +++ b/src/components/application_manager/test/request_info_test.cc @@ -31,10 +31,10 @@ */ #include "application_manager/request_info.h" -#include "application_manager/mock_request.h" #include <iostream> -#include <vector> #include <limits> +#include <vector> +#include "application_manager/mock_request.h" #include "gmock/gmock.h" namespace request_info = application_manager::request_controller; diff --git a/src/components/application_manager/test/request_tracker_test.cc b/src/components/application_manager/test/request_tracker_test.cc index ee09e0a3e0..9175652da6 100644 --- a/src/components/application_manager/test/request_tracker_test.cc +++ b/src/components/application_manager/test/request_tracker_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "utils/macro.h" #include "application_manager/request_tracker.h" #include "application_manager/mock_request_controller_settings.h" +#include "gtest/gtest.h" #include "interfaces/MOBILE_API.h" -#include "utils/lock.h" #include "utils/conditional_variable.h" +#include "utils/lock.h" +#include "utils/macro.h" namespace test { namespace components { @@ -246,6 +246,6 @@ TEST_F(RequestTrackerTestClass, tracker_.Track(app_id, none_level)); } -} // namespace request_controller +} // namespace request_controller_test } // namespace components } // namespace test diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc index 1c2339096c..a82358b451 100644 --- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc +++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc @@ -30,26 +30,26 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <algorithm> +#include <string> -#include "gtest/gtest.h" -#include "application_manager/resumption/resume_ctrl_impl.h" -#include "application_manager/usage_statistics.h" -#include "application_manager/mock_application.h" +#include "application_manager/application.h" +#include "application_manager/application_manager_impl.h" #include "application_manager/mock_app_extension.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_help_prompt_manager.h" #include "application_manager/mock_resumption_data.h" +#include "application_manager/resumption/resume_ctrl_impl.h" +#include "application_manager/usage_statistics.h" +#include "config_profile/profile.h" +#include "gtest/gtest.h" #include "interfaces/MOBILE_API.h" -#include "application_manager/application_manager_impl.h" -#include "application_manager/application.h" #include "utils/data_accessor.h" -#include "config_profile/profile.h" -#include "application_manager/mock_message_helper.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/mock_state_controller.h" namespace test { @@ -64,10 +64,10 @@ using ::testing::Eq; using ::testing::Mock; using ::testing::NiceMock; using ::testing::Return; -using ::testing::ReturnRef; -using ::testing::SetArgReferee; using ::testing::ReturnPointee; +using ::testing::ReturnRef; using ::testing::SaveArg; +using ::testing::SetArgReferee; using namespace application_manager_test; using namespace resumption; @@ -153,6 +153,7 @@ class ResumeCtrlTest : public ::testing::Test { ON_CALL(*mock_app_, mac_address()).WillByDefault(ReturnRef(kMacAddress_)); ON_CALL(*mock_app_, device()).WillByDefault(Return(kTestDevId_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kTestAppId_)); + ON_CALL(*mock_app_, is_cloud_app()).WillByDefault(Return(false)); } NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; @@ -500,7 +501,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) { EXPECT_CALL(*mock_app_extension_, ProcessResumption(test_subscriptions)); EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(), - SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2); + SendAllOnButtonSubscriptionNotificationsForApp(_, _)) + .Times(2); const bool res = res_ctrl_->StartResumption(mock_app_, kHash_); EXPECT_TRUE(res); diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc index 8423520b9f..d67c229cc3 100644 --- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc @@ -30,30 +30,30 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <algorithm> -#include "gtest/gtest.h" +#include <string> #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager_settings.h" +#include "gtest/gtest.h" #include "interfaces/MOBILE_API.h" #include "utils/sqlite_wrapper/sql_database.h" #include "utils/sqlite_wrapper/sql_query.h" -#include "utils/file_system.h" #include "application_manager/resumption_data_test.h" #include "application_manager/test_resumption_data_db.h" +#include "utils/file_system.h" -#include "application_manager/resumption/resumption_sql_queries.h" #include "application_manager/resumption/resumption_data_db.h" +#include "application_manager/resumption/resumption_sql_queries.h" namespace test { namespace components { namespace resumption_test { +using application_manager_test::MockApplication; +using ::testing::_; using ::testing::NiceMock; using ::testing::ReturnRef; -using ::testing::_; -using application_manager_test::MockApplication; namespace am = application_manager; using namespace file_system; @@ -344,7 +344,8 @@ void ResumptionDataDBTest::CheckCharacters(int64_t global_properties_key) { while (select_characters.Next()) { std::string character = (*keyboard_props_)[am::strings::limited_character_list] - [characters_idx++].asString(); + [characters_idx++] + .asString(); EXPECT_EQ(character, select_characters.GetString(0)); } } @@ -392,16 +393,17 @@ void ResumptionDataDBTest::CheckCommandsData() { ++i; uint cmd = (*test_commands_map[i])[am::strings::cmd_id].asUInt(); EXPECT_EQ(cmd, select_commands.GetUInteger(1)); - std::string name = - (*test_commands_map[i])[am::strings::menu_params] - [am::strings::menu_name].asString(); + std::string name = (*test_commands_map[i])[am::strings::menu_params] + [am::strings::menu_name] + .asString(); EXPECT_EQ(name, select_commands.GetString(2)); int position = (*test_commands_map[i])[am::strings::menu_params] - [am::strings::position].asInt(); + [am::strings::position] + .asInt(); EXPECT_EQ(position, select_commands.GetInteger(4)); - int parent_id = - (*test_commands_map[i])[am::strings::menu_params] - [am::hmi_request::parent_id].asInt(); + int parent_id = (*test_commands_map[i])[am::strings::menu_params] + [am::hmi_request::parent_id] + .asInt(); EXPECT_EQ(parent_id, select_commands.GetInteger(3)); std::string icon_name = (*test_commands_map[i])[am::strings::cmd_icon][am::strings::value] @@ -409,7 +411,8 @@ void ResumptionDataDBTest::CheckCommandsData() { EXPECT_EQ(icon_name, select_commands.GetString(5)); int icon_type = (*test_commands_map[i])[am::strings::cmd_icon] - [am::strings::image_type].asInt(); + [am::strings::image_type] + .asInt(); EXPECT_EQ(icon_type, select_commands.GetInteger(6)); j = 0; @@ -461,12 +464,12 @@ void ResumptionDataDBTest::CheckChoiceSetData() { std::string menu_name = command[am::strings::choice_set][choice_idx][am::strings::menu_name] .asString(); - std::string secondary_text = - command[am::strings::choice_set][choice_idx] - [am::strings::secondary_text].asString(); - std::string tertiary_text = - command[am::strings::choice_set][choice_idx] - [am::strings::tertiary_text].asString(); + std::string secondary_text = command[am::strings::choice_set][choice_idx] + [am::strings::secondary_text] + .asString(); + std::string tertiary_text = command[am::strings::choice_set][choice_idx] + [am::strings::tertiary_text] + .asString(); EXPECT_EQ(choice_id, select_choice_set.GetInteger(4)); EXPECT_EQ(menu_name, select_choice_set.GetString(5)); @@ -478,12 +481,12 @@ void ResumptionDataDBTest::CheckChoiceSetData() { EXPECT_TRUE(select_image.Prepare(kSelectImage)); select_image.Bind(0, select_choice_set.GetLongInt(8)); EXPECT_TRUE(select_image.Exec()); - std::string image_value = - command[am::strings::choice_set][choice_idx][am::strings::image] - [am::strings::value].asString(); - int image_type = - command[am::strings::choice_set][choice_idx][am::strings::image] - [am::strings::image_type].asInt(); + std::string image_value = command[am::strings::choice_set][choice_idx] + [am::strings::image][am::strings::value] + .asString(); + int image_type = command[am::strings::choice_set][choice_idx] + [am::strings::image][am::strings::image_type] + .asInt(); EXPECT_EQ(image_value, select_image.GetString(1)); EXPECT_EQ(image_type, select_image.GetInteger(0)); @@ -491,9 +494,9 @@ void ResumptionDataDBTest::CheckChoiceSetData() { EXPECT_TRUE(select_image.Prepare(kSelectImage)); select_image.Bind(0, select_choice_set.GetLongInt(9)); EXPECT_TRUE(select_image.Exec()); - image_value = - command[am::strings::choice_set][choice_idx] - [am::strings::secondary_image][am::strings::value].asString(); + image_value = command[am::strings::choice_set][choice_idx] + [am::strings::secondary_image][am::strings::value] + .asString(); image_type = command[am::strings::choice_set][choice_idx] [am::strings::secondary_image][am::strings::image_type] @@ -503,9 +506,9 @@ void ResumptionDataDBTest::CheckChoiceSetData() { vr_cmd_idx = 0; } - std::string vr_comm = - command[am::strings::choice_set][choice_idx][am::strings::vr_commands] - [vr_cmd_idx++].asString(); + std::string vr_comm = command[am::strings::choice_set][choice_idx] + [am::strings::vr_commands][vr_cmd_idx++] + .asString(); EXPECT_EQ(vr_comm, select_choice_set.GetString(10)); } } diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc index 40e61a3c53..955309e091 100644 --- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <algorithm> +#include <string> #include "gtest/gtest.h" -#include "application_manager/usage_statistics.h" #include "application_manager/mock_application.h" #include "application_manager/mock_resumption_data.h" +#include "application_manager/usage_statistics.h" #include "interfaces/MOBILE_API.h" #include "resumption/last_state_impl.h" @@ -51,9 +51,9 @@ namespace components { namespace resumption_test { using ::testing::_; +using ::testing::NiceMock; using ::testing::Return; using ::testing::ReturnRef; -using ::testing::NiceMock; namespace am = application_manager; using namespace Json; diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc index fe24ea39b6..29718b631c 100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_test.cc @@ -30,16 +30,16 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <algorithm> +#include <string> #include "gtest/gtest.h" -#include "application_manager/usage_statistics.h" +#include "application_manager/application.h" +#include "application_manager/message_helper.h" #include "application_manager/mock_resumption_data.h" +#include "application_manager/usage_statistics.h" #include "utils/custom_string.h" -#include "application_manager/application.h" #include "utils/data_accessor.h" -#include "application_manager/message_helper.h" #include "application_manager/resumption_data_test.h" @@ -47,10 +47,10 @@ namespace test { namespace components { namespace resumption_test { namespace custom_str = utils::custom_string; +using ::testing::_; using ::testing::Return; -using ::testing::ReturnRef; using ::testing::ReturnPointee; -using ::testing::_; +using ::testing::ReturnRef; void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) { EXPECT_EQ(policy_app_id_, resume_app_list[am::strings::app_id].asString()); @@ -79,9 +79,9 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) { void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) { for (uint32_t i = 0; i < kCountOfCommands_; ++i) { EXPECT_EQ(i, res_list[i][am::strings::cmd_id].asUInt()); - std::string name = - (*test_commands_map[i])[am::strings::menu_params] - [am::strings::menu_name].asString(); + std::string name = (*test_commands_map[i])[am::strings::menu_params] + [am::strings::menu_name] + .asString(); EXPECT_EQ(name, res_list[i][am::strings::menu_params][am::strings::menu_name] .asString()); @@ -93,7 +93,8 @@ void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) { res_list[i][am::strings::menu_params][am::strings::position].asInt()); int parent_id = (*test_commands_map[i])[am::strings::menu_params] - [am::hmi_request::parent_id].asInt(); + [am::hmi_request::parent_id] + .asInt(); EXPECT_EQ(parent_id, res_list[i][am::strings::menu_params][am::hmi_request::parent_id] .asInt()); @@ -150,20 +151,24 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) { std::snprintf(numb, 12, "%d", i + j); std::string test_choice = (*test_choiceset_map[i])[am::strings::choice_set][j] - [am::strings::vr_commands][0].asString(); + [am::strings::vr_commands][0] + .asString(); EXPECT_EQ(test_choice, command[am::strings::vr_commands][0].asString()); std::string menu_name = (*test_choiceset_map[i])[am::strings::choice_set][j] - [am::strings::menu_name].asString(); + [am::strings::menu_name] + .asString(); EXPECT_EQ(menu_name, command[am::strings::menu_name].asString()); std::string secondary_text = (*test_choiceset_map[i])[am::strings::choice_set][j] - [am::strings::secondary_text].asString(); + [am::strings::secondary_text] + .asString(); EXPECT_EQ(secondary_text, command[am::strings::secondary_text].asString()); std::string tertiary_text = (*test_choiceset_map[i])[am::strings::choice_set][j] - [am::strings::tertiary_text].asString(); + [am::strings::tertiary_text] + .asString(); EXPECT_EQ(tertiary_text, command[am::strings::tertiary_text].asString()); std::string image_value = @@ -181,13 +186,15 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) { image_value = (*test_choiceset_map[i])[am::strings::choice_set][j] [am::strings::secondary_image] - [am::strings::value].asString(); + [am::strings::value] + .asString(); EXPECT_EQ( image_value, command[am::strings::secondary_image][am::strings::value].asString()); image_type = (*test_choiceset_map[i])[am::strings::choice_set][j] [am::strings::secondary_image] - [am::strings::image_type].asInt(); + [am::strings::image_type] + .asInt(); EXPECT_EQ(image_type, command[am::strings::secondary_image][am::strings::image_type] .asInt()); diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc index 0ec902085f..61490ae4af 100644 --- a/src/components/application_manager/test/resumption_sql_queries_test.cc +++ b/src/components/application_manager/test/resumption_sql_queries_test.cc @@ -31,17 +31,17 @@ */ #include <algorithm> -#include <vector> -#include <string> #include <sstream> +#include <string> #include <utility> +#include <vector> #include "gtest/gtest.h" -#include "utils/sqlite_wrapper/sql_database.h" -#include "utils/sqlite_wrapper/sql_query.h" -#include "utils/file_system.h" #include "application_manager/resumption/resumption_sql_queries.h" #include "policy/sql_pt_queries.h" +#include "utils/file_system.h" +#include "utils/sqlite_wrapper/sql_database.h" +#include "utils/sqlite_wrapper/sql_query.h" namespace test { namespace components { @@ -49,8 +49,8 @@ namespace resumption_test { using namespace ::resumption; -using std::string; using std::pair; +using std::string; using utils::dbms::SQLDatabase; using utils::dbms::SQLQuery; @@ -808,7 +808,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -838,7 +839,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -866,7 +868,8 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -894,7 +897,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -922,7 +926,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -951,7 +956,8 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -980,7 +986,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1017,7 +1024,8 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1045,7 +1053,8 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1091,7 +1100,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1122,7 +1132,8 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1158,7 +1169,8 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1192,7 +1204,8 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1236,7 +1249,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1279,7 +1293,8 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1311,7 +1326,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1326,7 +1342,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) { false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); int64_t key2 = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, key1, key2); @@ -1344,7 +1361,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1359,7 +1377,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); int64_t key2 = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, key1, key2); @@ -1383,7 +1402,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) { int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1398,7 +1418,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) { false, app_id2, device_id, - key).LastInsertId(); + key) + .LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId(); @@ -1417,7 +1438,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1432,7 +1454,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - key).LastInsertId(); + key) + .LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId(); @@ -1454,7 +1477,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1469,7 +1493,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); int64_t key2 = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId(); @@ -1494,7 +1519,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); key1 = FillGlobalPropertiesTable( @@ -1511,7 +1537,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check before action const std::string select_count_image = "SELECT COUNT(*) FROM image;"; @@ -1527,7 +1554,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); key1 = FillGlobalPropertiesTable( @@ -1544,7 +1572,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); FillVRCommandsArrayTable( temp_query, "tst_vr_command", kVRCommandFromCommand, key2); @@ -1564,7 +1593,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); @@ -1582,7 +1612,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) { false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check @@ -1599,7 +1630,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); @@ -1617,7 +1649,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check @@ -1640,13 +1673,15 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillChoiceTable(temp_query, 2, "tst_menu_name", "secondary_txt", "tst_tert_text", - key1).LastInsertId(); + key1) + .LastInsertId(); int64_t key3 = FillApplicationTable(temp_query, connection_key, grammarID, @@ -1658,7 +1693,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) { false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); int64_t key4 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillChoiceArrayTable(temp_query, key4, key2); FillApplicationChoiceSetArrayTable(temp_query, key4, key3); @@ -1678,7 +1714,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillChoiceTable( temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) @@ -1694,7 +1731,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); FillVRCommandsArrayTable( temp_query, "tst_vr_command", kVRCommandFromChoice, key2); @@ -1724,7 +1762,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillChoiceTable( temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) @@ -1740,7 +1779,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) { false, app_id2, device_id, - key1).LastInsertId(); + key1) + .LastInsertId(); int64_t key3 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillChoiceArrayTable(temp_query, key3, key2); FillApplicationChoiceSetArrayTable(temp_query, key3, key1); @@ -1773,7 +1813,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoiceArray_ExpectDataDeleted) { false, app_id2, device_id, - 1).LastInsertId(); + 1) + .LastInsertId(); FillApplicationChoiceSetArrayTable( temp_query, application_choiceset_table_key, application_table_key); FillChoiceArrayTable( @@ -1803,7 +1844,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - 1).LastInsertId(); + 1) + .LastInsertId(); int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillApplicationChoiceSetArrayTable(temp_query, key2, key1); @@ -1838,7 +1880,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id2, device_id, - 1).LastInsertId(); + 1) + .LastInsertId(); int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillApplicationChoiceSetArrayTable(temp_query, key2, key1); @@ -1864,7 +1907,8 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1896,7 +1940,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1929,7 +1974,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, /*image_type=*/1, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1963,9 +2009,9 @@ TEST_F(ResumptionSqlQueriesTest, string character_list = "abcdefghij"; int64_t key1 = FillTableLimitedCharacterListTable(temp_query, character_list) .LastInsertId(); - int64_t key2 = - FillGlobalPropertiesTable( - temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + int64_t key2 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0) + .LastInsertId(); FillApplicationTable(temp_query, connection_key, grammarID, @@ -1999,9 +2045,9 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCharacterArray_ExpectDataDeleted) { string character_list = "abcdefghij"; int64_t key1 = FillTableLimitedCharacterListTable(temp_query, character_list) .LastInsertId(); - int64_t key2 = - FillGlobalPropertiesTable( - temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + int64_t key2 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0) + .LastInsertId(); FillApplicationTable(temp_query, connection_key, grammarID, @@ -2031,7 +2077,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteTTSChunk_ExpectDataDeleted) { FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( - temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0) + .LastInsertId(); FillApplicationTable(temp_query, connection_key, @@ -2087,7 +2134,8 @@ TEST_F(ResumptionSqlQueriesTest, FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( - temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0) + .LastInsertId(); FillApplicationTable(temp_query, connection_key, grammarID, @@ -2121,7 +2169,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) { SQLQuery temp_query(db()); int64_t glob_prop_key = FillGlobalPropertiesTable( - temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0) + .LastInsertId(); FillApplicationTable(temp_query, connection_key, grammarID, @@ -2160,7 +2209,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) { int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); ValToPosPair p1(0, "tst_image"); ValToPosPair p2(1, ""); // Check @@ -2588,7 +2638,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountFiles_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t file_key = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, app_key, file_key); @@ -2613,7 +2664,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectFiles_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t file_key = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, app_key, file_key); @@ -2640,7 +2692,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountSubMenu_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId(); FillApplicationSubMenuArrayTable(temp_query, app_key, submenu_key); @@ -2664,7 +2717,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectSubMenu_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId(); @@ -2691,7 +2745,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountCommands_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t command_key = FillCommandTable(temp_query, 1, "menu_name", 1, 2, 5).LastInsertId(); FillApplicationCommandsArrayTable(temp_query, app_key, command_key); @@ -2715,11 +2770,13 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); FillChoiceTable( temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) @@ -2758,11 +2815,13 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t choice_key = FillChoiceTable( @@ -2814,7 +2873,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountSubscriptions_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2836,7 +2896,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectSubscriptions_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2859,7 +2920,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountChoiceSet_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); FillApplicationChoiceSetArrayTable(temp_query, 2, app_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2881,11 +2943,13 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) { false, app_id1, device_id, - 9).LastInsertId(); + 9) + .LastInsertId(); int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t choice_key = FillChoiceTable( temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) @@ -2920,7 +2984,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) { int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); // Check ValToPosPair p1(0, IntToString(image_key)); ValToPosPair p2(1, ""); @@ -2947,7 +3012,8 @@ TEST_F(ResumptionSqlQueriesTest, false, app_id1, device_id, - glob_prop_key).LastInsertId(); + glob_prop_key) + .LastInsertId(); // Check ValToPosPair p1(0, app_id1); @@ -2961,7 +3027,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, test_image, - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -2977,7 +3044,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { false, app_id1, device_id, - glob_prop_key).LastInsertId(); + glob_prop_key) + .LastInsertId(); FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, 3, 7); // Check @@ -3001,7 +3069,8 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) { int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -3021,7 +3090,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) { int64_t image_key = FillImageTable(temp_query, /*image_type=*/2, "tst_image", - /*is_template=*/true).LastInsertId(); + /*is_template=*/true) + .LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -3046,8 +3116,9 @@ TEST_F(ResumptionSqlQueriesTest, kChecksCharacter_ExpectDataCorrect) { temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 2) .LastInsertId(); string character_list = "abcdefghijkl"; - int64_t lim_char_list_key = FillTableLimitedCharacterListTable( - temp_query, character_list).LastInsertId(); + int64_t lim_char_list_key = + FillTableLimitedCharacterListTable(temp_query, character_list) + .LastInsertId(); FillCharacterArrayTable(temp_query, glob_prop_key, lim_char_list_key); // Check ValToPosPair p1(0, IntToString(glob_prop_key)); @@ -3063,8 +3134,9 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCharacter_ExpectDataCorrect) { temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 2) .LastInsertId(); string character_list = "abcdefghijkl"; - int64_t lim_char_list_key = FillTableLimitedCharacterListTable( - temp_query, character_list).LastInsertId(); + int64_t lim_char_list_key = + FillTableLimitedCharacterListTable(temp_query, character_list) + .LastInsertId(); FillCharacterArrayTable(temp_query, glob_prop_key, lim_char_list_key); // Check ValToPosPair p1(0, IntToString(glob_prop_key)); diff --git a/src/components/application_manager/test/rpc_passing_handler_test.cc b/src/components/application_manager/test/rpc_passing_handler_test.cc new file mode 100644 index 0000000000..fb74a0a7e3 --- /dev/null +++ b/src/components/application_manager/test/rpc_passing_handler_test.cc @@ -0,0 +1,440 @@ +/* + * Copyright (c) 2019, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <gmock/gmock.h> +#include "gtest/gtest.h" + +#include "application_manager/rpc_passing_handler.h" + +#include "application_manager/mock_app_service_manager.h" +#include "application_manager/mock_application.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_application_manager_settings.h" +#include "application_manager/mock_rpc_handler.h" +#include "application_manager/mock_rpc_service.h" +#include "resumption/mock_last_state.h" + +#include <vector> +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" +#include "utils/semantic_version.h" +#include "utils/test_async_waiter.h" + +namespace test { +namespace components { +namespace application_manager_test { + +namespace am = application_manager; +using ::testing::_; +using ::testing::DoAll; +using ::testing::InSequence; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Pointee; +using ::testing::Return; +using ::testing::ReturnRef; + +struct PassthroughParams { + const uint32_t connection_key; + const int32_t correlation_id; + smart_objects::SmartObject message; + smart_objects::SmartObject forwarded_message; +}; + +class RPCPassingHandlerTest : public ::testing::Test { + public: + RPCPassingHandlerTest() + : mock_app_service_manager_(mock_app_manager_, mock_last_state_) + , mock_app_ptr_(std::make_shared<NiceMock<MockApplication> >()) + , version_(utils::SemanticVersion(5, 1, 0)) {} + + ~RPCPassingHandlerTest() {} + + void SetUp() OVERRIDE { + rpc_passing_handler_ = + new am::RPCPassingHandler(mock_app_service_manager_, mock_app_manager_); + app_services_.clear(); + + ON_CALL(mock_app_manager_, IncreaseForwardedRequestTimeout(_, _)) + .WillByDefault(Return()); + ON_CALL(mock_app_manager_, get_settings()) + .WillByDefault(ReturnRef(mock_app_manager_settings_)); + + ON_CALL(mock_app_manager_settings_, rpc_pass_through_timeout()) + .WillByDefault(Return(kRPCPassthroughTimeout)); + + ON_CALL(mock_app_manager_, GetRPCService()) + .WillByDefault(ReturnRef(mock_rpc_service_)); + ON_CALL(mock_rpc_service_, ManageMobileCommand(_, _)) + .WillByDefault(Return(true)); + ON_CALL(mock_rpc_service_, SendMessageToMobile(_, _)) + .WillByDefault(Return()); + + ON_CALL(mock_app_manager_, GetAppServiceManager()) + .WillByDefault(ReturnRef(mock_app_service_manager_)); + ON_CALL(mock_app_service_manager_, GetActiveServices()) + .WillByDefault(Return(app_services_)); + + ON_CALL(mock_app_manager_, GetRPCHandler()) + .WillByDefault(ReturnRef(mock_rpc_handler_)); + ON_CALL(mock_rpc_handler_, ValidateRpcSO(_, _, _, _)) + .WillByDefault(Return(true)); + + ON_CALL(mock_app_manager_, application(_)) + .WillByDefault(Return(mock_app_ptr_)); + ON_CALL(*mock_app_ptr_, msg_version()).WillByDefault(ReturnRef(version_)); + } + + void TearDown() OVERRIDE { + delete rpc_passing_handler_; + rpc_passing_handler_ = NULL; + } + + protected: + am::AppService CreateAppService(uint32_t connection_key, + const std::string& service_id, + const std::string& service_type) { + am::AppService app_service; + + app_service.connection_key = connection_key; + app_service.mobile_service = true; + app_service.default_service = false; + + smart_objects::SmartObject record(smart_objects::SmartType::SmartType_Map); + record[am::strings::service_id] = service_id; + record[am::strings::service_manifest][am::strings::service_type] = + service_type; + record[am::strings::service_manifest][am::strings::allow_app_consumers] = + true; + record[am::strings::service_manifest][am::strings::handled_rpcs] = + smart_objects::SmartObject(smart_objects::SmartType::SmartType_Array); + record[am::strings::service_manifest][am::strings::handled_rpcs][0] = + mobile_apis::FunctionID::SendLocationID; + record[am::strings::service_published] = true; + record[am::strings::service_active] = true; + app_service.record = record; + + return app_service; + } + + smart_objects::SmartObject CreatePassThroughRequest(uint32_t connection_key, + int32_t correlation_id) { + smart_objects::SmartObject record(smart_objects::SmartType::SmartType_Map); + record[am::strings::params][am::strings::connection_key] = connection_key; + record[am::strings::params][am::strings::correlation_id] = correlation_id; + record[am::strings::params][am::strings::function_id] = + mobile_apis::FunctionID::SendLocationID; + record[am::strings::params][am::strings::message_type] = + am::MessageType::kRequest; + record[am::strings::msg_params][am::strings::latitude_degrees] = 50; + record[am::strings::msg_params][am::strings::longitude_degrees] = 50; + record[am::strings::msg_params][am::strings::location_name] = + "TestLocation"; + + return record; + } + + smart_objects::SmartObject CreatePassThroughResponse( + uint32_t connection_key, + int32_t correlation_id, + const std::string& result_code, + bool success, + std::string info = std::string()) { + smart_objects::SmartObject record(smart_objects::SmartType::SmartType_Map); + record[am::strings::params][am::strings::connection_key] = connection_key; + record[am::strings::params][am::strings::correlation_id] = correlation_id; + record[am::strings::params][am::strings::function_id] = + mobile_apis::FunctionID::SendLocationID; + record[am::strings::params][am::strings::message_type] = + am::MessageType::kResponse; + record[am::strings::msg_params][am::strings::result_code] = result_code; + record[am::strings::msg_params][am::strings::success] = success; + record[am::strings::msg_params][am::strings::info] = info; + + return record; + } + + void SendRequestToASP(const PassthroughParams& params, uint32_t timeout = 0) { + if (timeout == 0) { + // If timeout argument is not sepcified + timeout = kRPCPassthroughTimeout; + } + + // Call RPCPassThrough with request smart object + + // Will call PopulateRPCRequestQueue + EXPECT_CALL(mock_app_service_manager_, GetActiveServices()) + .WillOnce(Return(app_services_)); + + // Will call ForwardRequesttoMobile + EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout()) + .WillOnce(Return(timeout)); + EXPECT_CALL(mock_app_manager_, GetRPCService()); + EXPECT_CALL(mock_rpc_service_, + SendMessageToMobile(Pointee(params.forwarded_message), false)); + + bool mobile_result = rpc_passing_handler_->RPCPassThrough(params.message); + EXPECT_EQ(mobile_result, true); + } + + NiceMock<MockApplicationManager> mock_app_manager_; + NiceMock<MockApplicationManagerSettings> mock_app_manager_settings_; + MockRPCService mock_rpc_service_; + MockRPCHandler mock_rpc_handler_; + resumption_test::MockLastState mock_last_state_; + MockAppServiceManager mock_app_service_manager_; + std::shared_ptr<NiceMock<MockApplication> > mock_app_ptr_; + const utils::SemanticVersion version_; + am::RPCPassingHandler* rpc_passing_handler_; + std::vector<am::AppService> app_services_; + + uint32_t kRPCPassthroughTimeout = 10000; + uint32_t kConnectionKey_ASC = 1; + uint32_t kConnectionKey_NAV_ASP = 2; + uint32_t kConnectionKey_MEDIA_ASP = 3; + int32_t kCorrelationId = 1; + const uint32_t MAX_TEST_DURATION = 1000; // 1 second +}; + +TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_ForwardToMobile) { + app_services_.push_back(CreateAppService( + kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); + + PassthroughParams request_params{ + .connection_key = kConnectionKey_ASC, + .correlation_id = kCorrelationId, + .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId), + .forwarded_message = + CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId), + }; + + SendRequestToASP(request_params); +} + +TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_NoPassthrough) { + smart_objects::SmartObject request = + CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId); + + // Call RPCPassThrough with request smart object + + // Will call PopulateRPCRequestQueue + EXPECT_CALL(mock_app_service_manager_, GetActiveServices()) + .WillOnce(Return(app_services_)); + EXPECT_CALL( + mock_app_manager_, + IncreaseForwardedRequestTimeout(kConnectionKey_ASC, kCorrelationId)) + .Times(0); + // Will return false since there are no active services to handle the rpc + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0); + + bool result = rpc_passing_handler_->RPCPassThrough(request); + EXPECT_EQ(result, false); +} + +TEST_F(RPCPassingHandlerTest, RPCPassingTest_RESPONSE_UnknownCorrelationID) { + smart_objects::SmartObject invalid_response = CreatePassThroughResponse( + kConnectionKey_NAV_ASP, kCorrelationId + 1, "SUCCESS", true); + + app_services_.push_back(CreateAppService( + kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); + + PassthroughParams request_params{ + .connection_key = kConnectionKey_ASC, + .correlation_id = kCorrelationId, + .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId), + .forwarded_message = + CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId), + }; + + SendRequestToASP(request_params); + + // Call RPCPassThrough with response smart object + // Will return false since the correlation id does not exist in the map + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); + EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, _)).Times(0); + + bool result = rpc_passing_handler_->RPCPassThrough(invalid_response); + EXPECT_EQ(result, false); +} + +TEST_F(RPCPassingHandlerTest, RPCPassingTest_SUCCESS) { + smart_objects::SmartObject response = CreatePassThroughResponse( + kConnectionKey_NAV_ASP, kCorrelationId, "SUCCESS", true); + smart_objects::SmartObject forwarded_response = CreatePassThroughResponse( + kConnectionKey_ASC, kCorrelationId, "SUCCESS", true); + + app_services_.push_back(CreateAppService( + kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); + + PassthroughParams request_params{ + .connection_key = kConnectionKey_ASC, + .correlation_id = kCorrelationId, + .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId), + .forwarded_message = + CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId), + }; + + SendRequestToASP(request_params); + + // Call RPCPassThrough with response smart object + // Will ForwardResponseToMobile + EXPECT_CALL(mock_app_manager_, GetRPCService()); + EXPECT_CALL(mock_rpc_service_, + SendMessageToMobile(Pointee(forwarded_response), false)); + + bool result = rpc_passing_handler_->RPCPassThrough(response); + EXPECT_EQ(result, true); +} + +TEST_F(RPCPassingHandlerTest, + RPCPassingTest_UNSUPPORTED_REQUEST_ForwardToCore) { + smart_objects::SmartObject unsupported_response = CreatePassThroughResponse( + kConnectionKey_NAV_ASP, kCorrelationId, "UNSUPPORTED_REQUEST", false); + smart_objects::SmartObject forwarded_request = + CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId); + + app_services_.push_back(CreateAppService( + kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); + + PassthroughParams request_params{ + .connection_key = kConnectionKey_ASC, + .correlation_id = kCorrelationId, + .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId), + .forwarded_message = + CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId), + }; + + SendRequestToASP(request_params); + + // Call RPCPassThrough with response smart object + // Will cycle to core (no other app services in list) + EXPECT_CALL(mock_app_manager_, GetRPCHandler()); + EXPECT_CALL(mock_rpc_handler_, ValidateRpcSO(forwarded_request, _, _, false)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_app_manager_, GetRPCService()); + EXPECT_CALL(mock_rpc_service_, + ManageMobileCommand(Pointee(forwarded_request), + am::commands::Command::SOURCE_MOBILE)); + + bool result = rpc_passing_handler_->RPCPassThrough(unsupported_response); + EXPECT_EQ(result, true); +} + +TEST_F(RPCPassingHandlerTest, + RPCPassingTest_UNSUPPORTED_REQUEST_ForwardToMobile) { + smart_objects::SmartObject unsupported_response = CreatePassThroughResponse( + kConnectionKey_NAV_ASP, kCorrelationId, "UNSUPPORTED_REQUEST", false); + smart_objects::SmartObject forwarded_request = + CreatePassThroughRequest(kConnectionKey_MEDIA_ASP, kCorrelationId); + + app_services_.push_back(CreateAppService( + kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); + app_services_.push_back( + CreateAppService(kConnectionKey_MEDIA_ASP, "Media service", "MEDIA")); + + PassthroughParams request_params{ + .connection_key = kConnectionKey_ASC, + .correlation_id = kCorrelationId, + .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId), + .forwarded_message = + CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId), + }; + + SendRequestToASP(request_params); + + // Call RPCPassThrough with response smart object + // Will cycle to next compatible active app service + EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout()); + EXPECT_CALL(mock_app_manager_, GetRPCService()); + EXPECT_CALL(mock_rpc_service_, + SendMessageToMobile(Pointee(forwarded_request), false)); + + bool result = rpc_passing_handler_->RPCPassThrough(unsupported_response); + EXPECT_EQ(result, true); +} + +TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_Timeout) { + uint32_t timeout_in_ms = 4; + std::shared_ptr<TestAsyncWaiter> waiter = std::make_shared<TestAsyncWaiter>(); + + app_services_.push_back(CreateAppService( + kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); + + PassthroughParams request_params{ + .connection_key = kConnectionKey_ASC, + .correlation_id = kCorrelationId, + .message = CreatePassThroughRequest(kConnectionKey_ASC, kCorrelationId), + .forwarded_message = + CreatePassThroughRequest(kConnectionKey_NAV_ASP, kCorrelationId), + }; + + // Call RPCPassThrough with request smart object + + // Will call PopulateRPCRequestQueue + EXPECT_CALL(mock_app_service_manager_, GetActiveServices()) + .WillOnce(Return(app_services_)); + + // Will call ForwardRequesttoMobile + EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout()) + .WillOnce(Return(timeout_in_ms)); + EXPECT_CALL( + mock_rpc_service_, + SendMessageToMobile(Pointee(request_params.forwarded_message), false)); + + // Request timeout will trigger perform next request + // Will cycle to core (no other app services in list) + EXPECT_CALL(mock_app_manager_, GetRPCHandler()); + EXPECT_CALL(mock_rpc_handler_, + ValidateRpcSO(request_params.message, _, _, false)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_app_manager_, GetRPCService()).Times(2); + EXPECT_CALL(mock_rpc_service_, + ManageMobileCommand(Pointee(request_params.message), + am::commands::Command::SOURCE_MOBILE)) + .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(true))); + + bool mobile_result = + rpc_passing_handler_->RPCPassThrough(request_params.message); + EXPECT_EQ(mobile_result, true); + + const uint32_t wait_time = MAX_TEST_DURATION + timeout_in_ms; + EXPECT_TRUE(waiter->WaitFor(1, wait_time)); + + // This sleep prevents a SEGFAULT which occurs after the + // RPCPassingHandlerTests are completed and the next test set runs + usleep(6000); // sleep 6 ms +} + +} // namespace application_manager_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/sdl_preloaded_pt.json b/src/components/application_manager/test/sdl_preloaded_pt.json index 59e3f947c3..ad264c8518 100644 --- a/src/components/application_manager/test/sdl_preloaded_pt.json +++ b/src/components/application_manager/test/sdl_preloaded_pt.json @@ -363,6 +363,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "vin", @@ -383,6 +384,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "vin", @@ -403,6 +405,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "wiperStatus"] @@ -422,6 +425,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "wiperStatus"] diff --git a/src/components/application_manager/test/sdl_pt_update.json b/src/components/application_manager/test/sdl_pt_update.json index 23c75e8475..aea3f7700b 100644 --- a/src/components/application_manager/test/sdl_pt_update.json +++ b/src/components/application_manager/test/sdl_pt_update.json @@ -20,7 +20,13 @@ "nicknames" : [ "SyncProxyTester" ], "priority" : "EMERGENCY", "steal_focus" : true, - "watchdog_timer_ms" : 20000 + "watchdog_timer_ms" : 20000, + "app_services": { + "MEDIA": { + "service_names" : ["SDL App", "SDL Music"], + "handled_rpcs" : [{"function_id": 41}] + } + } }, "default" : { "default_hmi" : "NONE", @@ -1600,6 +1606,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "vin", @@ -1618,6 +1625,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "vin", @@ -1636,6 +1644,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "wiperStatus" @@ -1653,6 +1662,7 @@ "headLampStatus", "instantFuelConsumption", "fuelRange", + "cloudAppVehicleID", "odometer", "tirePressure", "wiperStatus" diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc index 1d4cead52b..9621e20629 100644 --- a/src/components/application_manager/test/state_controller/state_controller_test.cc +++ b/src/components/application_manager/test/state_controller/state_controller_test.cc @@ -30,46 +30,46 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" +#include "application_manager/application_manager_impl.h" #include "application_manager/hmi_state.h" +#include "application_manager/mock_application.h" #include "application_manager/state_controller_impl.h" #include "application_manager/usage_statistics.h" -#include "application_manager/application_manager_impl.h" -#include "application_manager/mock_application.h" -#include "connection_handler/mock_connection_handler_settings.h" #include "connection_handler/connection_handler_impl.h" +#include "connection_handler/mock_connection_handler_settings.h" +#include "gtest/gtest.h" #include "transport_manager/mock_transport_manager.h" -#include "utils/lock.h" #include "utils/data_accessor.h" +#include "utils/lock.h" -#include "application_manager/message_helper.h" #include "application_manager/event_engine/event.h" -#include "application_manager/smart_object_keys.h" +#include "application_manager/message_helper.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_event_dispatcher.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/mock_rpc_service.h" +#include "application_manager/policies/mock_policy_handler_interface.h" +#include "application_manager/resumption/resume_ctrl.h" +#include "application_manager/smart_object_keys.h" +#include "connection_handler/mock_connection_handler.h" #include "policy/mock_policy_settings.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "protocol_handler/mock_session_observer.h" -#include "connection_handler/mock_connection_handler.h" -#include "application_manager/policies/mock_policy_handler_interface.h" -#include "application_manager/mock_event_dispatcher.h" -#include "application_manager/resumption/resume_ctrl.h" -#include "application_manager/mock_application_manager.h" -#include "application_manager/mock_rpc_service.h" namespace am = application_manager; using am::HmiState; using am::HmiStatePtr; using am::UsageStatistics; using ::testing::_; +using ::testing::AtLeast; +using ::testing::InSequence; +using ::testing::Mock; +using ::testing::NiceMock; using ::testing::Return; -using ::testing::ReturnRef; using ::testing::ReturnPointee; +using ::testing::ReturnRef; using ::testing::SaveArg; -using ::testing::Mock; -using ::testing::NiceMock; -using ::testing::InSequence; using ::testing::Truly; -using ::testing::AtLeast; namespace test { namespace components { @@ -170,34 +170,42 @@ class StateControllerImplTest : public ::testing::Test { am::ApplicationSharedPtr simple_app_; NiceMock<application_manager_test::MockApplication>* simple_app_ptr_; uint32_t simple_app_id_ = 1721; + uint32_t simple_hmi_app_id_ = 22770; // random number am::ApplicationSharedPtr navi_app_; NiceMock<application_manager_test::MockApplication>* navi_app_ptr_; uint32_t navi_app_id_ = 1762; + uint32_t navi_hmi_app_id_ = 17559; am::ApplicationSharedPtr media_app_; NiceMock<application_manager_test::MockApplication>* media_app_ptr_; uint32_t media_app_id_ = 1801; + uint32_t media_hmi_app_id_ = 12751; am::ApplicationSharedPtr vc_app_; NiceMock<application_manager_test::MockApplication>* vc_app_ptr_; uint32_t vc_app_id_ = 1825; + uint32_t vc_hmi_app_id_ = 14986; am::ApplicationSharedPtr media_navi_app_; NiceMock<application_manager_test::MockApplication>* media_navi_app_ptr_; uint32_t media_navi_app_id_ = 1855; + uint32_t media_navi_hmi_app_id_ = 16194; am::ApplicationSharedPtr media_vc_app_; NiceMock<application_manager_test::MockApplication>* media_vc_app_ptr_; uint32_t media_vc_app_id_ = 1881; + uint32_t media_vc_hmi_app_id_ = 12798; am::ApplicationSharedPtr navi_vc_app_; NiceMock<application_manager_test::MockApplication>* navi_vc_app_ptr_; uint32_t navi_vc_app_id_ = 1894; + uint32_t navi_vc_hmi_app_id_ = 10807; am::ApplicationSharedPtr media_navi_vc_app_; NiceMock<application_manager_test::MockApplication>* media_navi_vc_app_ptr_; uint32_t media_navi_vc_app_id_ = 1922; + uint32_t media_navi_vc_hmi_app_id_ = 21419; std::vector<am::HmiStatePtr> valid_states_for_audio_app_; std::vector<am::HmiStatePtr> valid_states_for_not_audio_app_; @@ -661,6 +669,7 @@ class StateControllerImplTest : public ::testing::Test { am::ApplicationSharedPtr ConfigureApp( NiceMock<application_manager_test::MockApplication>** app_mock, uint32_t app_id, + uint32_t hmi_app_id, bool media, bool navi, bool vc) { @@ -670,6 +679,7 @@ class StateControllerImplTest : public ::testing::Test { am::ApplicationSharedPtr app(*app_mock); ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id)); + ON_CALL(**app_mock, hmi_app_id()).WillByDefault(Return(hmi_app_id)); ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media)); ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi)); ON_CALL(**app_mock, is_voice_communication_supported()) @@ -871,21 +881,50 @@ class StateControllerImplTest : public ::testing::Test { } void ConfigureApps() { - simple_app_ = ConfigureApp( - &simple_app_ptr_, simple_app_id_, NOT_MEDIA, NOT_NAVI, NOT_VC); - media_app_ = - ConfigureApp(&media_app_ptr_, media_app_id_, MEDIA, NOT_NAVI, NOT_VC); - navi_app_ = - ConfigureApp(&navi_app_ptr_, navi_app_id_, NOT_MEDIA, NAVI, NOT_VC); - vc_app_ = ConfigureApp(&vc_app_ptr_, vc_app_id_, NOT_MEDIA, NOT_NAVI, VC); - media_navi_app_ = ConfigureApp( - &media_navi_app_ptr_, media_navi_app_id_, MEDIA, NAVI, NOT_VC); - media_vc_app_ = - ConfigureApp(&media_vc_app_ptr_, media_vc_app_id_, MEDIA, NOT_NAVI, VC); - navi_vc_app_ = - ConfigureApp(&navi_vc_app_ptr_, navi_vc_app_id_, NOT_MEDIA, NAVI, VC); - media_navi_vc_app_ = ConfigureApp( - &media_navi_vc_app_ptr_, media_navi_vc_app_id_, MEDIA, NAVI, VC); + simple_app_ = ConfigureApp(&simple_app_ptr_, + simple_app_id_, + simple_hmi_app_id_, + NOT_MEDIA, + NOT_NAVI, + NOT_VC); + media_app_ = ConfigureApp(&media_app_ptr_, + media_app_id_, + media_hmi_app_id_, + MEDIA, + NOT_NAVI, + NOT_VC); + navi_app_ = ConfigureApp(&navi_app_ptr_, + navi_app_id_, + navi_hmi_app_id_, + NOT_MEDIA, + NAVI, + NOT_VC); + vc_app_ = ConfigureApp( + &vc_app_ptr_, vc_app_id_, vc_hmi_app_id_, NOT_MEDIA, NOT_NAVI, VC); + media_navi_app_ = ConfigureApp(&media_navi_app_ptr_, + media_navi_app_id_, + media_navi_hmi_app_id_, + MEDIA, + NAVI, + NOT_VC); + media_vc_app_ = ConfigureApp(&media_vc_app_ptr_, + media_vc_app_id_, + media_vc_hmi_app_id_, + MEDIA, + NOT_NAVI, + VC); + navi_vc_app_ = ConfigureApp(&navi_vc_app_ptr_, + navi_vc_app_id_, + navi_vc_hmi_app_id_, + NOT_MEDIA, + NAVI, + VC); + media_navi_vc_app_ = ConfigureApp(&media_navi_vc_app_ptr_, + media_navi_vc_app_id_, + media_navi_vc_hmi_app_id_, + MEDIA, + NAVI, + VC); applications_list_.push_back(simple_app_); applications_list_.push_back(media_app_); applications_list_.push_back(navi_app_); @@ -914,6 +953,15 @@ class StateControllerImplTest : public ::testing::Test { ASSERT_EQ(navi_vc_app_->app_id(), navi_vc_app_id_); ASSERT_EQ(media_navi_vc_app_->app_id(), media_navi_vc_app_id_); + ASSERT_EQ(simple_app_->hmi_app_id(), simple_hmi_app_id_); + ASSERT_EQ(media_app_->hmi_app_id(), media_hmi_app_id_); + ASSERT_EQ(navi_app_->hmi_app_id(), navi_hmi_app_id_); + ASSERT_EQ(vc_app_->hmi_app_id(), vc_hmi_app_id_); + ASSERT_EQ(media_navi_app_->hmi_app_id(), media_navi_hmi_app_id_); + ASSERT_EQ(media_vc_app_->hmi_app_id(), media_vc_hmi_app_id_); + ASSERT_EQ(navi_vc_app_->hmi_app_id(), navi_vc_hmi_app_id_); + ASSERT_EQ(media_navi_vc_app_->hmi_app_id(), media_navi_vc_hmi_app_id_); + ASSERT_FALSE(simple_app_->IsAudioApplication()); ASSERT_TRUE(media_app_->IsAudioApplication()); ASSERT_TRUE(navi_app_->IsAudioApplication()); @@ -988,11 +1036,11 @@ class StateControllerImplTest : public ::testing::Test { (*bc_activate_app_request)[am::strings::params] [am::strings::correlation_id] = corr_id; ON_CALL(message_helper_mock_, - GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _)) + GetBCActivateAppRequestToHMI(_, _, hmi_lvl, _, _)) .WillByDefault(Return(bc_activate_app_request)); ON_CALL(app_manager_mock_, GetRPCService()) .WillByDefault(ReturnRef(mock_rpc_service_)); - ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request)) + ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request, _)) .WillByDefault(Return(true)); } @@ -1040,6 +1088,8 @@ class StateControllerImplTest : public ::testing::Test { application_set_.insert(app); ON_CALL(app_manager_mock_, application(app->app_id())) .WillByDefault(Return(app)); + ON_CALL(app_manager_mock_, application_by_hmi_app(app->hmi_app_id())) + .WillByDefault(Return(app)); } am::HmiStatePtr NoneNotAudibleState() { @@ -1475,9 +1525,9 @@ TEST_F(StateControllerImplTest, NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock; app_in_full = - ConfigureApp(&app_in_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC); - app_moved_to_full = - ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC); + ConfigureApp(&app_in_full_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, NOT_VC); + app_moved_to_full = ConfigureApp( + &app_moved_to_full_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC); InsertApplication(app_in_full); InsertApplication(app_moved_to_full); @@ -1549,11 +1599,11 @@ TEST_F(StateControllerImplTest, namespace SystemContext = mobile_apis::SystemContext; NiceMock<application_manager_test::MockApplication>* app_in_full_mock; am::ApplicationSharedPtr app_in_full = - ConfigureApp(&app_in_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC); + ConfigureApp(&app_in_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC); NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock; - am::ApplicationSharedPtr app_moved_to_full = - ConfigureApp(&app_moved_to_full_mock, 1796, MEDIA, NOT_NAVI, NOT_VC); + am::ApplicationSharedPtr app_moved_to_full = ConfigureApp( + &app_moved_to_full_mock, 1796, 30093, MEDIA, NOT_NAVI, NOT_VC); InsertApplication(app_in_full); InsertApplication(app_moved_to_full); @@ -1575,11 +1625,11 @@ TEST_F(StateControllerImplTest, NiceMock<application_manager_test::MockApplication>* app_in_limited_mock; am::ApplicationSharedPtr app_in_limited = - ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NAVI, NOT_VC); + ConfigureApp(&app_in_limited_mock, 1761, 15685, NOT_MEDIA, NAVI, NOT_VC); NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock; am::ApplicationSharedPtr app_moved_to_full = - ConfigureApp(&app_moved_to_full_mock, 1796, NOT_MEDIA, NAVI, VC); + ConfigureApp(&app_moved_to_full_mock, 1796, 30093, NOT_MEDIA, NAVI, VC); InsertApplication(app_in_limited); InsertApplication(app_moved_to_full); @@ -1600,12 +1650,12 @@ TEST_F(StateControllerImplTest, namespace SystemContext = mobile_apis::SystemContext; NiceMock<application_manager_test::MockApplication>* app_in_limited_mock; am::ApplicationSharedPtr app_in_limited = - ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NOT_NAVI, VC); + ConfigureApp(&app_in_limited_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, VC); NiceMock<application_manager_test::MockApplication>* app_moved_to_limited_mock; - am::ApplicationSharedPtr app_moved_to_limited = - ConfigureApp(&app_moved_to_limited_mock, 1796, NOT_MEDIA, NOT_NAVI, VC); + am::ApplicationSharedPtr app_moved_to_limited = ConfigureApp( + &app_moved_to_limited_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, VC); InsertApplication(app_in_limited); InsertApplication(app_moved_to_limited); @@ -1749,8 +1799,8 @@ TEST_F(StateControllerImplTest, namespace SystemContext = mobile_apis::SystemContext; NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock; - am::ApplicationSharedPtr app_moved_to_full = - ConfigureApp(&app_moved_to_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC); + am::ApplicationSharedPtr app_moved_to_full = ConfigureApp( + &app_moved_to_full_mock, 1761, 15685, NOT_MEDIA, NOT_NAVI, NOT_VC); am::ApplicationSharedPtr limited_app = media_app_; NiceMock<application_manager_test::MockApplication>* limited_app_mock = @@ -1758,7 +1808,7 @@ TEST_F(StateControllerImplTest, NiceMock<application_manager_test::MockApplication>* full_app_mock; am::ApplicationSharedPtr full_app = - ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC); + ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC); InsertApplication(app_moved_to_full); InsertApplication(limited_app); @@ -1786,16 +1836,16 @@ TEST_F( namespace SystemContext = mobile_apis::SystemContext; NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock; - am::ApplicationSharedPtr app_moved_to_full = - ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC); + am::ApplicationSharedPtr app_moved_to_full = ConfigureApp( + &app_moved_to_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC); NiceMock<application_manager_test::MockApplication>* limited_app_mock; am::ApplicationSharedPtr limited_app = - ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC); + ConfigureApp(&limited_app_mock, 1762, 17559, MEDIA, NOT_NAVI, NOT_VC); NiceMock<application_manager_test::MockApplication>* full_app_mock; am::ApplicationSharedPtr full_app = - ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NOT_NAVI, NOT_VC); + ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NOT_NAVI, NOT_VC); InsertApplication(app_moved_to_full); InsertApplication(limited_app); @@ -1823,16 +1873,16 @@ TEST_F( namespace SystemContext = mobile_apis::SystemContext; NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock; - am::ApplicationSharedPtr app_moved_to_full = - ConfigureApp(&app_moved_to_full_mock, 1761, MEDIA, NOT_NAVI, NOT_VC); + am::ApplicationSharedPtr app_moved_to_full = ConfigureApp( + &app_moved_to_full_mock, 1761, 15685, MEDIA, NOT_NAVI, NOT_VC); NiceMock<application_manager_test::MockApplication>* limited_app_mock; am::ApplicationSharedPtr limited_app = - ConfigureApp(&limited_app_mock, 1762, MEDIA, NOT_NAVI, NOT_VC); + ConfigureApp(&limited_app_mock, 1762, 17559, MEDIA, NOT_NAVI, NOT_VC); NiceMock<application_manager_test::MockApplication>* full_app_mock; am::ApplicationSharedPtr full_app = - ConfigureApp(&full_app_mock, 1796, NOT_MEDIA, NAVI, NOT_VC); + ConfigureApp(&full_app_mock, 1796, 30093, NOT_MEDIA, NAVI, NOT_VC); InsertApplication(app_moved_to_full); InsertApplication(limited_app); @@ -1919,12 +1969,6 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) { StateLevelPair(LimitedState(), Common_HMILevel::LIMITED)); hmi_states.push_back( StateLevelPair(BackgroundState(), Common_HMILevel::BACKGROUND)); - hmi_states.push_back( - StateLevelPair(createHmiState(HMILevel::HMI_NONE, - AudioStreamingState::NOT_AUDIBLE, - VideoStreamingState::NOT_STREAMABLE, - SystemContext::SYSCTXT_MAIN), - Common_HMILevel::NONE)); std::vector<StateLevelPair> initial_hmi_states = hmi_states; std::vector<StateLevelPair>::iterator it = hmi_states.begin(); std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin(); @@ -1941,7 +1985,7 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) { SetBCActivateAppRequestToHMI(hmi_level, corr_id); ON_CALL(app_manager_mock_, GetRPCService()) .WillByDefault(ReturnRef(mock_rpc_service_)); - ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request)) + ON_CALL(mock_rpc_service_, ManageHMICommand(bc_activate_app_request, _)) .WillByDefault(Return(true)); EXPECT_CALL(app_manager_mock_, application_id(corr_id)) @@ -2013,7 +2057,8 @@ TEST_F(StateControllerImplTest, SendEventBCActivateApp_HMIReceivesError) { EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(simple_app_)) .Times(0); EXPECT_CALL(app_manager_mock_, - OnHMILevelChanged(simple_app_->app_id(), _, _)).Times(0); + OnHMILevelChanged(simple_app_->app_id(), _, _)) + .Times(0); smart_objects::SmartObject message; message[am::strings::params][am::hmi_response::code] = *it; @@ -2577,7 +2622,8 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) { EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(false)); EXPECT_CALL(message_helper_mock_, - SendOnResumeAudioSourceToHMI(simple_app_id_, _)).Times(0); + SendOnResumeAudioSourceToHMI(simple_app_id_, _)) + .Times(0); EXPECT_CALL(*simple_app_ptr_, SetPostponedState(Truly(HmiStatesComparator(check_state)))) .Times(0); @@ -2845,14 +2891,7 @@ TEST_F(StateControllerImplTest, am::event_engine::Event event(event_id); event.set_smart_object(msg); - const HmiStatePtr state = - createHmiState(mobile_apis::HMILevel::HMI_FULL, - mobile_apis::AudioStreamingState::AUDIBLE, - mobile_apis::VideoStreamingState::NOT_STREAMABLE, - mobile_apis::SystemContext::SYSCTXT_MAIN); - EXPECT_CALL(*simple_app_ptr_, keep_context()).WillOnce(Return(true)); - EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state)); EXPECT_CALL(*simple_app_ptr_, IsAudioApplication()) .WillRepeatedly(Return(true)); EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()) @@ -2884,12 +2923,6 @@ TEST_F(StateControllerImplTest, OnEventChangedAudioSourceAppToBackground) { am::event_engine::Event event(event_id); event.set_smart_object(msg); - const HmiStatePtr state = - createHmiState(mobile_apis::HMILevel::HMI_LIMITED, - mobile_apis::AudioStreamingState::AUDIBLE, - mobile_apis::VideoStreamingState::NOT_STREAMABLE, - mobile_apis::SystemContext::SYSCTXT_MAIN); - EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state)); EXPECT_CALL(*simple_app_ptr_, IsAudioApplication()) .WillRepeatedly(Return(true)); EXPECT_CALL(*simple_app_ptr_, CurrentHmiState()) diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc index dfc694f3c5..b494afb68e 100644 --- a/src/components/application_manager/test/usage_statistics_test.cc +++ b/src/components/application_manager/test/usage_statistics_test.cc @@ -33,9 +33,9 @@ #include "application_manager/usage_statistics.h" #include <memory> #include "gmock/gmock.h" -#include "smart_objects/enum_schema_item.h" -#include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/usage_statistics/mock_app_stopwatch.h" +#include "policy/usage_statistics/mock_statistics_manager.h" +#include "smart_objects/enum_schema_item.h" namespace test { namespace components { diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc index 640a186e2b..0166c036c1 100644 --- a/src/components/application_manager/test/zero_request_amount_test.cc +++ b/src/components/application_manager/test/zero_request_amount_test.cc @@ -30,19 +30,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> #include <algorithm> +#include <string> #include "gtest/gtest.h" -#include "application_manager/request_controller.h" -#include "application_manager/commands/command_request_impl.h" #include "application_manager/application_manager_impl.h" -#include "application_manager/message_helper.h" +#include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/mobile/put_file_request.h" #include "application_manager/commands/mobile/register_app_interface_request.h" #include "application_manager/commands/mobile/unregister_app_interface_request.h" -#include "smart_objects/smart_object.h" +#include "application_manager/message_helper.h" +#include "application_manager/request_controller.h" #include "interfaces/MOBILE_API.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { |